功能 - ⚛️ 卡片内置应用配置无缝集成 - ♻️ 通用解决方案 (Apple Wallet 和 Google Wallet) - 简单、安全的添加和管理 - 可在 iOS、Android、Windows 和 Mac 上使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线
功能 - ⚛️ 卡片内置应用配置无缝集成 - ♻️ 通用解决方案 (Apple Wallet 和 Google Wallet) - 简单、安全的添加和管理 - 可在 iOS、Android、Windows 和 Mac 上使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线下使用 - 可在线上和线
Using the react-native-wallet Push Provisioning features requires proper configuration and access from both Google and Apple.
Please follow the instructions below before installing the library:
To be able to interact with the Google Wallet on the Android please make sure to complete all of the steps below following the Google Push Provisioning documentation:
Visit the Google Pay Android Push Provisioning API documentation and request access to it.
Once getting an approval from the Google team
/android/libs folder in your React Native project (if there is no libs folder, create one)./android/libs to .gitignore.Then connect the SDK to your project in build.gradle, for example like in example/android/build.gradle:
allprojects {
repositories {
google()
maven { url "file://${rootDir}/libs" }
}
}To use the Google SDK in your app, you will need to whitelist your app details. Without it, calling some functions will result in a Not verified error.
To resolve it, please follow the instructions from the official Google documentation.
For your builds, you will need to prepare your app's package name and fingerprint following these steps. The values should, for example, look like this:
Package name: com.app.package.name
Fingerprint: SHA256: 36:38:63:59:6E:...:00:82:16:4E:FF[!TIP] You can display your SHA-256 certificate checksum using
apksignerorkeytool.
With all the required data, submit the form and wait for Google's response. After successfully whitelisting your app you will be able to use Google SDK within our library.
To enable In-App Provisioning in your app, you must request activation of the appropriate Apple Pay entitlements for your developer Team ID. Enterprise Team IDs are not supported. This entitlement is not available by default in our panel; you will need to request it.
Submit your request through the In-App Provisioning Submission Form. Only Account Holders can access this form — if you are unable to access it, coordinate with the Account Holder of your team. Alternatively, you can email [email protected] with the following format:
Subject: Apple Pay Entitlements and Allow List Request - [Issuer Name] - [Country Code]
Body:
[!NOTE] Only a production Team ID and Adam ID can receive the entitlement. Test Team IDs don't qualify.
Once Apple verifies your identity, you should get documentation named Getting Started with Apple Pay In-App Provisioning, Verification & Security. In this confidential document you will find all the relevant information about:
Make sure to familiarize yourself with that document before deploying your app.
After getting a positive response from Apple, open the developer portal panel and search Certificates, Identifiers & Profiles -> Profiles -> Our distribution profile -> Edit and add the ApplePay In-App Provisioning Distribution entitlement.
It’s available only for the production environment so your QA must work with physical devices and cards.
Add com.apple.developer.payment-pass-provisioning entitlement to your project. Find or create .entitlements file in your project and add the entitlement like below (similarly to WalletExample.entitlements):
...
com.apple.developer.payment-pass-provisioning
After completing the setup from the section above, install the react-native-wallet package from npm:
npm install @expensify/react-native-walletor
yarn add @expensify/react-native-walletTo use @expensify/react-native-wallet with expo, you will need to use the expo-plugin.
In your app.json file, add the following configuration:
{
"expo": {
"plugins": [
[
"@expensify/react-native-wallet",
{
enableApplePayProvisioning: true,
googleTapAndPaySdkPath: "./libs/tapandpay-v18.7.0.zip", // path to the Google Tap & Pay SDK zip file
},
],
]
}
}You will need to rebuild your app after that since the lib has native files.
npx expo prebuild --clean
npx expo run:ios
npx expo run:androidHere you can find data elements used in the library, essential to work with Google Wallet and Apple Wallet APIs.
The library offers seven functions for seamless integration and use of the Apple Wallet and Google Wallet APIs. Additionally, it includes one listener that informs when the added card has been activated. Below, these functions are described along with the data types involved.
| Function | Description | Parameters | Returns / Type | iOS | Android |
|---|---|---|---|---|---|
| getSecureWalletInfo | Returns necessary platform-specific wallet information for secure transactions. | None | WalletData |
❌ | ✅ |
| checkWalletAvailability | Checks if the wallet is ready and initializes it if possible. | None | boolean |
✅ | ✅ |
| getCardStatusBySuffix | Retrieves the current status of a card in the wallet. | lastDigits: string |
|||
| (The last few digits of the card number) | CardStatus |
✅ | ✅ | ||
| getCardStatusByIdentifier | Returns the state of a card based on a platform-specific identifier. On Android, it's Token Reference ID and on iOS, it's Primary Account Identifier. |
identifier: string, |
|||
tsp: string |
CardStatus |
✅ | ✅ | ||
| addCardToGoogleWallet | Initiates native Push Provisioning flow for adding a card to the Google Wallet. | data: AndroidCardData |
TokenizationStatus |
❌ | ✅ |
| resumeAddCardToGoogleWallet | Resumes the Push Provisioning flow for adding a card to the Google Wallet using existing token reference ID. | data: AndroidResumeCardData |
TokenizationStatus |
❌ | ✅ |
| listTokens | Lists all tokens currently stored in the Google Wallet. | None | TokenInfo[] |
❌ | ✅ |
| addCardToAppleWallet | Initiates native Push Provisioning flow for adding a card to the Apple Wallet. | data: IOSCardData, |
|||
issuerEncrypt- |
|||||
PayloadCallback: IOSIssuerCallback |
void |
✅ | ❌ |
| Type | Description | Fields |
|---|---|---|
| AndroidWalletData | Specific information for Android devices required for wallet transactions. | deviceID: string, |
walletAccountID: string |
||
| AndroidCardData | Data related to a card that is to be added on Android platform wallets. | network: string, |
opaquePaymentCard: string, |
||
cardHolderName: string, |
||
lastDigits: string, |
||
userAddress: UserAddress |
||
| AndroidResumeCardData | Simplified data structure for resuming card addition to Google Wallet using existing token reference ID. | network: string, |
tokenReferenceID: string, |
||
cardHolderName?: string, |
||
lastDigits?: string |
||
| UserAddress | Structured address used for cardholder verification. | name: string, |
addressOne: string, |
||
addressTwo: string, |
||
city: string, |
||
administrativeArea: string, |
||
countryCode: string, |
||
postalCode: string, |
||
phoneNumber: string |
||
| IOSCardData | Data related to a card that is to be added on iOS platform. | network: string, |
activationData: string, |
||
encryptedPassData: string, |
||
ephemeralPublicKey: string, |
||
cardHolderTitle: string, |
||
cardHolderName: string, |
||
lastDigits: string, |
||
cardDescription: string, |
||
cardDescriptionComment: string |
||
| onCardActivatedPayload | Data used by listener to notice when a card's status changes. | tokenId: string, |
status: 'activated' | 'canceled' |
||
| IOSIssuerCallback | This callback is invoked with a nonce, its signature, and a certificate array obtained from Apple. It is expected that you will forward these details to your server or the card issuer's API to securely encrypt the payload required for adding cards to the Apple Wallet. | (nonce: string, nonceSignature: string, certificate: string[]) => IOSEncryptPayload |
| IOSEncryptPayload | An object containing the necessary elements to complete the addition of a card to Apple Wallet. | encryptedPassData: string, |
activationData: string, |
||
ephemeralPublicKey: string |
||
| TokenInfo | Information about a token stored in Google Wallet. | identifier: string, |
lastDigits: string, |
||
tokenState: number |
| Type | Possible Values |
|---|---|
| CardStatus | not found, active, requireAuthorization, pending, suspended, deactivated |
| Listener | Event Description | Register Function | Unregister Function |
|---|---|---|---|
| cardActivation | Notifies when a card's status changes to activated. | addListener(event: string, callback: (data: onCardActivatedPayload) => void): EmitterSubscription |
removeListener(subscription: EmitterSubscription): void |
AddToWalletButtonA ready-to-use compone
暂无开放 Issues,或尚未同步最近议题。