Google Pay In-App Provisioning
npm install capacitor-google-pay
npx cap sync-
Get access to Android Push Provisioning API
-
Set up your environment and Integrate the SDK
-
Unzip downloaded m2repository to
<path to sdk.dir>/extras/google/m2repository,For example:
~/Library/Android/sdk/extras/google/m2repository -
Request Push Provisioning API Access
-
Here we go
addListener('registerDataChangedListener', ...)removeAllListeners()getEnvironment()getStableHardwareId()getActiveWalletID()createWallet()getTokenStatus(...)listTokens()isTokenized(...)pushProvision(...)requestSelectToken(...)requestDeleteToken(...)isGPayDefaultNFCApp()setGPayAsDefaultNFCApp()registerDataChangedListener()- Interfaces
- Enums
addListener(eventName: 'registerDataChangedListener', listenerFunc: (response: any) => void) => Promise<PluginListenerHandle>Event called when an action is performed on a pusn notification.
| Param | Type | Description |
|---|---|---|
eventName |
'registerDataChangedListener' |
pushNotificationActionPerformed. |
listenerFunc |
(response: any) => void |
callback with the notification action. |
Returns: Promise<PluginListenerHandle>
Since: 1.0.0
removeAllListeners() => voidgetEnvironment() => Promise<{ value: 'PROD' | 'SANDBOX' | 'DEV'; }>returns the environment (e.g. production or sandbox)
Returns: Promise<{ value: 'PROD' | 'SANDBOX' | 'DEV'; }>
Since: 1.0.0
getStableHardwareId() => Promise<{ hardwareId: string; }>returns the stable hardware ID of the device
Returns: Promise<{ hardwareId: string; }>
Since: 1.0.0
getActiveWalletID() => Promise<{ walletId: string; }>returns the ID of the active wallet
Returns: Promise<{ walletId: string; }>
Since: 1.0.0
createWallet() => Promise<{ isCreated: boolean; }>Initializes create wallet
Returns: Promise<{ isCreated: boolean; }>
Since: 4.0.1
getTokenStatus(options: GooglePayTokenOptions) => Promise<{ state: TokenStatusReference; code: string; }>returns the status of a token with a given token ID
| Param | Type | Description |
|---|---|---|
options |
GooglePayTokenOptions |
Token Options |
Returns: Promise<{ state: TokenStatusReference; code: string; }>
Since: 1.0.0
listTokens() => Promise<{ tokens: string[]; }>returns a list of tokens registered to the active wallet
Returns: Promise<{ tokens: string[]; }>
Since: 1.0.0
isTokenized(options: GooglePayIsTokenizedOptions) => Promise<{ isTokenized: boolean; }>Starts the push tokenization flow
| Param | Type |
|---|---|
options |
GooglePayIsTokenizedOptions |
Returns: Promise<{ isTokenized: boolean; }>
Since: 1.0.0
pushProvision(options: GooglePayProvisionOptions) => Promise<{ tokenId: string; }>Starts the push tokenization flow
| Param | Type |
|---|---|
options |
GooglePayProvisionOptions |
Returns: Promise<{ tokenId: string; }>
Since: 1.0.0
requestSelectToken(options: GooglePayTokenOptions) => Promise<{ isSuccess: boolean; }>Requests setting token as default in Google Pay
| Param | Type | Description |
|---|---|---|
options |
GooglePayTokenOptions |
Token Options |
Returns: Promise<{ isSuccess: boolean; }>
Since: 1.0.0
requestDeleteToken(options: GooglePayTokenOptions) => Promise<{ isSuccess: boolean; }>Requests deleting token from Google Pay
| Param | Type | Description |
|---|---|---|
options |
GooglePayTokenOptions |
Token Options |
Returns: Promise<{ isSuccess: boolean; }>
Since: 4.0.13
isGPayDefaultNFCApp() => Promise<{ isDefault: boolean; isNFCOn: boolean; }>Check if Google Pay is Default NFC payment App
Returns: Promise<{ isDefault: boolean; isNFCOn: boolean; }>
Since: 4.0.4
setGPayAsDefaultNFCApp() => Promise<{ isDefault: boolean; }>Sets Google Pay as Default NFC payment App
Returns: Promise<{ isDefault: boolean; }>
Since: 4.0.4
registerDataChangedListener() => Promise<any>returns the status of a token with a given token ID
Returns: Promise<any>
Since: 1.0.0
| Prop | Type |
|---|---|
remove |
() => Promise<void> |
| Prop | Type | Description | Since |
|---|---|---|---|
tsp |
string |
Sets the TSP that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
tokenReferenceId |
string |
token registered to the active wallet | 1.0.0 |
| Prop | Type | Description | Since |
|---|---|---|---|
tsp |
string |
Sets the TSP that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
lastDigits |
string |
Sets the lastDigits that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
| Prop | Type | Description | Since |
|---|---|---|---|
opc |
string |
Sets Opaque Payment Card binary data. | 1.0.0 |
tsp |
string |
Sets the TSP that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
clientName |
string |
Sets the clientName that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
lastDigits |
string |
Sets the lastDigits that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
address |
GooglePayAddress |
Sets the address that should be used for the tokenization attempt (see TokenServiceProvider). | 1.0.0 |
| Prop | Type | Description | Since |
|---|---|---|---|
name |
string |
Address name | 1.0.0 |
address1 |
string |
Full address | 1.0.0 |
address2 |
string |
Apartment/Office | 1.0.0 |
locality |
string |
Locality | 1.0.0 |
administrativeArea |
string |
Administrative area | 1.0.0 |
countryCode |
string |
Country code | 1.0.0 |
postalCode |
string |
Postal code | 1.0.0 |
phoneNumber |
string |
Phone number | 1.0.0 |
| Members | Value |
|---|---|
TOKEN_STATE_UNTOKENIZED |
1 |
TOKEN_STATE_PENDING |
2 |
TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION |
3 |
TOKEN_STATE_SUSPENDED |
4 |
TOKEN_STATE_ACTIVE |
5 |
TOKEN_STATE_FELICA_PENDING_PROVISIONING |
6 |
TOKEN_STATE_NOT_FOUND |
-1 |