You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-14Lines changed: 78 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,11 @@
5
5
- ♻️ Universal solution (Apple Wallet and Google Wallet)
6
6
- 💳 Easy and secure addition of payment cards from your app directly
7
7
- 💰 Supports Visa, MasterCard, Amex and Discover payment cards
8
+
- 🎉 Expo support (expo-plugin)
8
9
9
10
## Getting started
10
11
11
-
Using the `react-native-wallet` Push Provisioning features requires proper configuration and access from both Google and Apple.
12
+
Using the `react-native-wallet` Push Provisioning features requires proper configuration and access from both Google and Apple.
12
13
Please follow the instructions below before installing the library:
13
14
14
15
### Android
@@ -20,10 +21,10 @@ To be able to interact with the Google Wallet on the Android please make sure to
20
21
1. Visit [the Google Pay Android Push Provisioning API documentation](https://developers.google.com/pay/issuers/apis/push-provisioning/android/) and request access to it.
21
22
22
23
2. Once getting an approval from the Google team
23
-
1. Download the [TapAndPay SDK](https://developers.google.com/pay/issuers/apis/push-provisioning/android/releases).
24
-
2. Unzip it and extract the SDK into the `/android/libs` folder in your React Native project (if there is no `libs` folder, create one).
24
+
1. Download the [TapAndPay SDK](https://developers.google.com/pay/issuers/apis/push-provisioning/android/releases).
25
+
2. Unzip it and extract the SDK into the `/android/libs` folder in your React Native project (if there is no `libs` folder, create one).
25
26
3. Add `/android/libs` to `.gitignore`.
26
-
27
+
27
28
3. Then connect the SDK to your project in `build.gradle`, for example like in [example/android/build.gradle](https://github.com/Expensify/react-native-wallet/blob/main/example/android/build.gradle):
28
29
29
30
```groovy
@@ -37,7 +38,7 @@ allprojects {
37
38
38
39
#### Step 2: Whitelist your app for SDK use.
39
40
40
-
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.
41
+
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.
41
42
To resolve it, please follow the instructions from [the official Google documentation](https://developers.google.com/pay/issuers/apis/push-provisioning/android/allowlist).
42
43
43
44
For your builds, you will need to prepare your app's `package name` and `fingerprint` following [these steps](https://developers.google.com/pay/issuers/apis/push-provisioning/android/allowlist#how_to_get_your_apps_fingerprint). The values should, for example, look like this:
@@ -72,13 +73,13 @@ Make sure to familiarize yourself with that document before deploying your app.
72
73
73
74
### Step 2: Activate the entitlement
74
75
75
-
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.
76
+
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.
76
77
It’s available only for the production environment so your QA must work with physical devices and cards.
77
78
78
79
79
80
### Step 3: Add the entitlement to your project
80
81
81
-
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](https://github.com/Expensify/react-native-wallet/blob/main/example/ios/WalletExample/WalletExample.entitlements)):
82
+
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](https://github.com/Expensify/react-native-wallet/blob/main/example/ios/WalletExample/WalletExample.entitlements)):
82
83
83
84
```xml
84
85
<?xml version="1.0" encoding="UTF-8"?>
@@ -105,14 +106,44 @@ or
105
106
yarn add @expensify/react-native-wallet
106
107
```
107
108
109
+
### Expo plugin
110
+
111
+
To use `@expensify/react-native-wallet` with expo, you will need to use the expo-plugin.
112
+
113
+
In your `app.json` file, add the following configuration:
114
+
115
+
```json
116
+
{
117
+
"expo": {
118
+
"plugins": [
119
+
[
120
+
"@expensify/react-native-wallet",
121
+
{
122
+
enableApplePayProvisioning: true,
123
+
googleTapAndPaySdkPath: "./libs/tapandpay-v18.7.0.zip", // path to the Google Tap & Pay SDK zip file
124
+
},
125
+
],
126
+
]
127
+
}
128
+
}
129
+
```
108
130
131
+
You will need to rebuild your app after that since the lib has native files.
132
+
133
+
```bash
134
+
npx expo prebuild --clean
135
+
npx expo run:ios
136
+
npx expo run:android
137
+
```
109
138
110
-
## Required data
139
+
140
+
141
+
## Required data
111
142
Here you can find data elements used in the library, essential to work with Google Wallet and Apple Wallet APIs.
112
143
113
144
### Android
114
145
-**Opaque Payment Card** (OPC) - a binary blob of information Google Pay receives from the issuer app that could be presented to TSP to receive a token.
115
-
-**Token Service Provider** (TSP) - a service that enhances payment security by replacing a credit card number during transactions with a unique digital identifier - token. The TSP specifies the tokenization service used to create a given token e.g. Visa, MasterCard, American Express.
146
+
-**Token Service Provider** (TSP) - a service that enhances payment security by replacing a credit card number during transactions with a unique digital identifier - token. The TSP specifies the tokenization service used to create a given token e.g. Visa, MasterCard, American Express.
116
147
-**Token Reference ID** - a unique identifying number to refer to a DPAN (Dynamic Personal Account Number). Token Providers will assign each DPAN an issuer token ID at the time of tokenization.
117
148
118
149
### iOS
@@ -170,10 +201,10 @@ The library offers seven functions for seamless integration and use of the Apple
170
201
### `AddToWalletButton`
171
202
172
203
A ready-to-use component that simplifies the addition of payment cards to Google Wallet and Apple Wallet. The button automatically adapts its appearance according to the platform and language specified.
173
-
It uses official assets provided by [Google](https://developers.google.com/wallet/generic/resources/brand-guidelines) and [Apple](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/) in their Wallet-related branding guidelines.
204
+
It uses official assets provided by [Google](https://developers.google.com/wallet/generic/resources/brand-guidelines) and [Apple](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/) in their Wallet-related branding guidelines.
174
205
175
206
> [!IMPORTANT]
176
-
> Please bear in mind the brand rules provided by [Google](https://developers.google.com/wallet/generic/resources/brand-guidelines) and [Apple](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/) when adding this component to your application.
207
+
> Please bear in mind the brand rules provided by [Google](https://developers.google.com/wallet/generic/resources/brand-guidelines) and [Apple](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/) when adding this component to your application.
177
208
178
209
Adhering to these guidelines is crucial not only to comply with legal requirements but also to reassure users of the authenticity and security of your application.
179
210
@@ -204,6 +235,40 @@ Adhering to these guidelines is crucial not only to comply with legal requiremen
This will depend on the implementation of your backend/issuer so make sure to check with them otherwise IOS might fail to provision the card.
271
+
207
272
# Publishing your app
208
273
209
274
To successfully publish your app, you will need to navigate through a series of mandatory test cases on both platforms.
@@ -214,14 +279,14 @@ Before deploying your app to the Google Play Store, make sure you have taken car
214
279
215
280
The latest information about deploying apps with Google TapAndPay SDK can be found in the [pre-launch process](https://developers.google.com/pay/issuers/apis/push-provisioning/android/launch-process#step_3_issuer_app_product_review) and [beta tests](https://developers.google.com/pay/issuers/apis/push-provisioning/android/beta-testing) sections in Google documentation. Make sure to complete all of the steps specified by Google connected to the __Google's branding__, __API safety__, and __app stability__.
216
281
217
-
The app will need to be reviewed by Google. During this process, it will need to pass 4 mandatory test cases that are specified [here](https://developers.google.com/pay/issuers/apis/push-provisioning/android/test-cases). They verify how your app handles card state tracking in different scenarios.
282
+
The app will need to be reviewed by Google. During this process, it will need to pass 4 mandatory test cases that are specified [here](https://developers.google.com/pay/issuers/apis/push-provisioning/android/test-cases). They verify how your app handles card state tracking in different scenarios.
218
283
219
284
> [!NOTE]
220
285
>Please make sure to hide the `AddtoGoogleWallet` buttons when cards are already added to the wallet.
221
286
222
287
### iOS
223
288
224
-
When implementing the In-App Push Provisioning feature in your App make sure that your app follows Apple's [branding guidelines connected to Apple Wallet](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/). Remember that you must not create your own buttons or your app could be rejected at revision. You can use the[ AddWalletButton component](#components) instead!
289
+
When implementing the In-App Push Provisioning feature in your App make sure that your app follows Apple's [branding guidelines connected to Apple Wallet](https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/). Remember that you must not create your own buttons or your app could be rejected at revision. You can use the[ AddWalletButton component](#components) instead!
225
290
When the pass is already provisioned, make sure to hide this button and replace it with text like `AddedtoAppleWallet`. The card is fully provisioned once it added to your main device (user's iPhone) and all linked devices (for example Apple Watch).
226
291
227
292
Next to branding guidelines, please follow the instructions and best practices from [the In-App provisioning documentation]((#ios)) provided by Apple.
@@ -246,7 +311,6 @@ Additionally, when submitting your app to the App Store, you must include:
246
311
247
312
`@expensify/react-native-wallet` is compatible with the five latest minor releases of React Native (≥0.76.0) and works exclusively with the new architecture.
248
313
249
-
250
314
# Contributing
251
315
252
316
Contributions to this library are done under [https://github.com/Expensify/App](https://github.com/Expensify/App). Please refer to that repo and all its guidelines for contributing.
0 commit comments