@rnw-community/react-native-payments 0.54.4 → 0.54.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/payments/PaymentsModule.java +6 -6
- package/dist/cjs/@standard/android/response/android-intermediate-signing-key.d.ts +6 -0
- package/dist/cjs/@standard/android/response/android-intermediate-signing-key.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/android-intermediate-signing-key.js +3 -0
- package/dist/cjs/@standard/android/response/android-intermediate-signing-key.js.map +1 -0
- package/dist/cjs/@standard/android/response/android-payment-method-token.d.ts +9 -0
- package/dist/cjs/@standard/android/response/android-payment-method-token.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/android-payment-method-token.js +3 -0
- package/dist/cjs/@standard/android/response/android-payment-method-token.js.map +1 -0
- package/dist/cjs/@standard/android/response/android-payment-method-tokenization-data.d.ts.map +1 -1
- package/dist/cjs/@standard/android/response/android-raw-intermediate-signing-key.d.ts +5 -0
- package/dist/cjs/@standard/android/response/android-raw-intermediate-signing-key.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/android-raw-intermediate-signing-key.js +3 -0
- package/dist/cjs/@standard/android/response/android-raw-intermediate-signing-key.js.map +1 -0
- package/dist/cjs/@standard/android/response/android-raw-payment-method-token.d.ts +8 -0
- package/dist/cjs/@standard/android/response/android-raw-payment-method-token.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/android-raw-payment-method-token.js +3 -0
- package/dist/cjs/@standard/android/response/android-raw-payment-method-token.js.map +1 -0
- package/dist/cjs/@standard/android/response/android-signed-key.d.ts +5 -0
- package/dist/cjs/@standard/android/response/android-signed-key.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/{android-payment-data-token.js → android-signed-key.js} +1 -1
- package/dist/cjs/@standard/android/response/android-signed-key.js.map +1 -0
- package/dist/cjs/@standard/android/response/android-signed-message.d.ts +6 -0
- package/dist/cjs/@standard/android/response/android-signed-message.d.ts.map +1 -0
- package/dist/cjs/@standard/android/response/android-signed-message.js +3 -0
- package/dist/cjs/@standard/android/response/android-signed-message.js.map +1 -0
- package/dist/cjs/class/payment-request/payment-request.d.ts.map +1 -1
- package/dist/cjs/class/payment-request/payment-request.js +2 -3
- package/dist/cjs/class/payment-request/payment-request.js.map +1 -1
- package/dist/cjs/class/payment-response/android-payment-response.d.ts +3 -2
- package/dist/cjs/class/payment-response/android-payment-response.d.ts.map +1 -1
- package/dist/cjs/class/payment-response/android-payment-response.js +31 -1
- package/dist/cjs/class/payment-response/android-payment-response.js.map +1 -1
- package/dist/cjs/tsconfig.build-cjs.tsbuildinfo +1 -1
- package/dist/esm/@standard/android/response/android-intermediate-signing-key.d.ts +6 -0
- package/dist/esm/@standard/android/response/android-intermediate-signing-key.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-intermediate-signing-key.js +2 -0
- package/dist/esm/@standard/android/response/android-intermediate-signing-key.js.map +1 -0
- package/dist/esm/@standard/android/response/android-payment-method-token.d.ts +9 -0
- package/dist/esm/@standard/android/response/android-payment-method-token.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-payment-method-token.js +2 -0
- package/dist/esm/@standard/android/response/android-payment-method-token.js.map +1 -0
- package/dist/esm/@standard/android/response/android-payment-method-tokenization-data.d.ts.map +1 -1
- package/dist/esm/@standard/android/response/android-raw-intermediate-signing-key.d.ts +5 -0
- package/dist/esm/@standard/android/response/android-raw-intermediate-signing-key.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-raw-intermediate-signing-key.js +2 -0
- package/dist/esm/@standard/android/response/android-raw-intermediate-signing-key.js.map +1 -0
- package/dist/esm/@standard/android/response/android-raw-payment-method-token.d.ts +8 -0
- package/dist/esm/@standard/android/response/android-raw-payment-method-token.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-raw-payment-method-token.js +2 -0
- package/dist/esm/@standard/android/response/android-raw-payment-method-token.js.map +1 -0
- package/dist/esm/@standard/android/response/android-signed-key.d.ts +5 -0
- package/dist/esm/@standard/android/response/android-signed-key.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-signed-key.js +2 -0
- package/dist/esm/@standard/android/response/android-signed-key.js.map +1 -0
- package/dist/esm/@standard/android/response/android-signed-message.d.ts +6 -0
- package/dist/esm/@standard/android/response/android-signed-message.d.ts.map +1 -0
- package/dist/esm/@standard/android/response/android-signed-message.js +2 -0
- package/dist/esm/@standard/android/response/android-signed-message.js.map +1 -0
- package/dist/esm/class/payment-request/payment-request.d.ts.map +1 -1
- package/dist/esm/class/payment-request/payment-request.js +1 -2
- package/dist/esm/class/payment-request/payment-request.js.map +1 -1
- package/dist/esm/class/payment-response/android-payment-response.d.ts +3 -2
- package/dist/esm/class/payment-response/android-payment-response.d.ts.map +1 -1
- package/dist/esm/class/payment-response/android-payment-response.js +31 -1
- package/dist/esm/class/payment-response/android-payment-response.js.map +1 -1
- package/dist/esm/tsconfig.build-esm.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/readme.md +63 -31
- package/src/@standard/android/response/android-intermediate-signing-key.ts +7 -0
- package/src/@standard/android/response/android-payment-method-token.ts +9 -0
- package/src/@standard/android/response/android-payment-method-tokenization-data.ts +1 -0
- package/src/@standard/android/response/android-raw-intermediate-signing-key.ts +5 -0
- package/src/@standard/android/response/android-raw-payment-method-token.ts +9 -0
- package/src/@standard/android/response/android-signed-key.ts +5 -0
- package/src/@standard/android/response/android-signed-message.ts +7 -0
- package/src/class/payment-request/payment-request.ts +1 -2
- package/src/class/payment-response/android-payment-response.ts +39 -3
- package/dist/cjs/@standard/android/response/android-payment-data-token.d.ts +0 -8
- package/dist/cjs/@standard/android/response/android-payment-data-token.d.ts.map +0 -1
- package/dist/cjs/@standard/android/response/android-payment-data-token.js.map +0 -1
- package/dist/esm/@standard/android/response/android-payment-data-token.d.ts +0 -8
- package/dist/esm/@standard/android/response/android-payment-data-token.d.ts.map +0 -1
- package/dist/esm/@standard/android/response/android-payment-data-token.js +0 -2
- package/dist/esm/@standard/android/response/android-payment-data-token.js.map +0 -1
- package/src/@standard/android/response/android-payment-data-token.ts +0 -7
package/readme.md
CHANGED
|
@@ -36,7 +36,8 @@ integration experience for your applications.
|
|
|
36
36
|
|
|
37
37
|
- Streamlined. Say goodbye to complicated checkout forms.
|
|
38
38
|
- Efficient. Accelerate checkouts for higher conversion rates.
|
|
39
|
-
- Forward-looking. Utilize a [W3C Standards API](https://www.w3.org/) endorsed by major companies such as Google, Firefox,
|
|
39
|
+
- Forward-looking. Utilize a [W3C Standards API](https://www.w3.org/) endorsed by major companies such as Google, Firefox,
|
|
40
|
+
and more.
|
|
40
41
|
- Versatile. Share payment code seamlessly across iOS, Android, and web applications.
|
|
41
42
|
|
|
42
43
|
## Installation
|
|
@@ -45,21 +46,43 @@ integration experience for your applications.
|
|
|
45
46
|
|
|
46
47
|
### ApplePay setup
|
|
47
48
|
|
|
49
|
+
- ApplePay [overview](https://developer.apple.com/apple-pay/planning/).
|
|
48
50
|
- Create [Apple developer account](https://developer.apple.com/programs/enroll/).
|
|
49
51
|
- Follow [this guide](https://developer.apple.com/library/archive/ApplePay_Guide/Configuration.html) to setup ApplePay in
|
|
50
52
|
your application.
|
|
53
|
+
- [Payment token reference](https://developer.apple.com/documentation/passkit/apple_pay/payment_token_format_reference?language=objc)
|
|
54
|
+
- Add following code to your `AppDelegate.h`:
|
|
55
|
+
```objc
|
|
56
|
+
#import <RCTAppDelegate.h>
|
|
57
|
+
#import <UIKit/UIKit.h>
|
|
58
|
+
#import <PassKit/PassKit.h> // Add this import
|
|
59
|
+
|
|
60
|
+
@interface AppDelegate : RCTAppDelegate
|
|
61
|
+
|
|
62
|
+
```
|
|
51
63
|
|
|
52
64
|
### AndroidPay setup
|
|
53
65
|
|
|
54
66
|
- Create [Google developer account](https://support.google.com/googleplay/android-developer/answer/6112435?hl=en).
|
|
55
67
|
- Follow [this guide](https://developers.google.com/pay/api/android/guides/setup) to setup Google Pay Api in your
|
|
56
68
|
application.
|
|
69
|
+
- [Google payments tutorial](https://developers.google.com/pay/api/android/guides/tutorial)
|
|
70
|
+
- [Google brand guidelines](https://developers.google.com/pay/api/android/guides/brand-guidelines)
|
|
71
|
+
|
|
72
|
+
- Use should use `19.0.0+` version of Google play services in your application:
|
|
73
|
+
```groovy
|
|
74
|
+
dependencies {
|
|
75
|
+
// The version of react-native is set by the React Native Gradle Plugin
|
|
76
|
+
implementation("com.facebook.react:react-android")
|
|
77
|
+
|
|
78
|
+
implementation 'com.google.android.gms:play-services-wallet:19.2.0'
|
|
79
|
+
```
|
|
57
80
|
|
|
58
81
|
## Usage
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
Detailed guide should be found at:
|
|
84
|
+
- [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/API/Payment_Request_API/Using_the_Payment_Request_API) as API is fully compliant.
|
|
85
|
+
- [Google Web Payments guide](https://web.dev/payments/).
|
|
63
86
|
|
|
64
87
|
The PaymentRequest class is designed to facilitate the integration of payment processing into your React Native application.
|
|
65
88
|
It leverages TypeScript for robust typing and ensures seamless payment experiences across both iOS and Android platforms.
|
|
@@ -94,7 +117,8 @@ const paymentRequest = new PaymentRequest(methodData, paymentDetails);
|
|
|
94
117
|
#### 2.1 PaymentDetailsInterface
|
|
95
118
|
|
|
96
119
|
The `PaymentDetailsInterface` is a mapping interface used in React Native Payments to represent the payment details required
|
|
97
|
-
for initiating a payment request. It extends the `PaymentDetailsInit` interface from
|
|
120
|
+
for initiating a payment request. It extends the `PaymentDetailsInit` interface from
|
|
121
|
+
the [W3C Payment Request API(version 08 September 2022)](https://www.w3.org/TR/payment-request/)
|
|
98
122
|
specification and includes additional fields specific to React Native Payments.
|
|
99
123
|
|
|
100
124
|
The `PaymentDetailsInterface` includes the following additional properties:
|
|
@@ -150,16 +174,22 @@ including the payment method used, the payer's information, and transaction-rela
|
|
|
150
174
|
|
|
151
175
|
```ts
|
|
152
176
|
const paymentResponse = paymentRequest.show().then((paymentResponse) => {
|
|
153
|
-
//
|
|
154
|
-
paymentDetails.details
|
|
177
|
+
// This field will have all plaform related information needed for transaction processing
|
|
178
|
+
paymentDetails.details;
|
|
155
179
|
// Aditionally if was requested, shipping, billing and payer info would be available
|
|
180
|
+
paymentDetails.billingAddress;
|
|
181
|
+
paymentDetails.payerEmail;
|
|
182
|
+
paymentDetails.payerName;
|
|
183
|
+
paymentDetails.payerPhone;
|
|
184
|
+
paymentDetails.shippingAddress;
|
|
156
185
|
}).catch(...);
|
|
157
186
|
```
|
|
158
187
|
|
|
159
188
|
### 6. Closing the Payment Sheet
|
|
160
189
|
|
|
161
190
|
Once the payment process is successfully completed, it's essential to close the payment sheet by calling the
|
|
162
|
-
`PaymentResponse.complete()` method. This method takes a parameter from the `PaymentComplete` enum to indicate the outcome of
|
|
191
|
+
`PaymentResponse.complete()` method. This method takes a parameter from the `PaymentComplete` enum to indicate the outcome of
|
|
192
|
+
the
|
|
163
193
|
payment and hide the payment sheet accordingly.
|
|
164
194
|
|
|
165
195
|
```ts
|
|
@@ -169,51 +199,53 @@ paymentResponse.complete(PaymentComplete.Success) // OR PaymentComplete.Fail
|
|
|
169
199
|
> This will have no affect in the Android platform due to AndroidPay implementation.
|
|
170
200
|
|
|
171
201
|
### 7. Aborting the Payment
|
|
172
|
-
|
|
173
|
-
|
|
202
|
+
|
|
203
|
+
The `PaymentRequset.abort()` method in the Payment Request API allows developers to programmatically cancel an ongoing
|
|
204
|
+
payment request or dismiss
|
|
205
|
+
the payment sheet when it is in an interactive state. This method is used to handle scenarios where the user decides to
|
|
206
|
+
cancel the
|
|
174
207
|
payment process or when specific conditions require the payment request to be aborted.
|
|
175
208
|
|
|
176
209
|
> This will have no affect in the Android platform due to AndroidPay implementation.
|
|
177
210
|
|
|
178
|
-
|
|
179
211
|
## Example
|
|
180
212
|
|
|
181
213
|
You can find working example in the `App` component of
|
|
182
214
|
the [react-native-payments-example](../react-native-payments-example/README.md) package.
|
|
183
215
|
|
|
184
216
|
## TODO
|
|
217
|
+
|
|
218
|
+
### Docs
|
|
219
|
+
|
|
185
220
|
- [ ] Add gifs to the docs showing payment sheets appearing on IOS and Android.
|
|
221
|
+
|
|
222
|
+
### Native
|
|
223
|
+
|
|
186
224
|
- [ ] Investigate and implement unified shipping option selection between IOS and Android.(PR are welcome =)) W3C Payment
|
|
187
|
-
Request does not provide anything related to the Shipping options selection, only
|
|
225
|
+
Request does not provide anything related to the Shipping options selection, only mentions
|
|
188
226
|
it [here](https://www.w3.org/TR/payment-request/#describing-what-is-being-paid-for) as a part of the `PaymentRequest`
|
|
189
227
|
details.
|
|
228
|
+
- [ ] Rewrite IOS to swift?
|
|
229
|
+
- [ ] Rewrite Android to Kotlin?
|
|
230
|
+
- [ ] Can we avoid modifying `AppDelegate.h` with importing `PassKit`?
|
|
231
|
+
|
|
232
|
+
### W3C spec:
|
|
233
|
+
|
|
190
234
|
- [ ] Implement events:
|
|
191
235
|
- [ ] [PaymentRequestUpdateEvent](https://www.w3.org/TR/payment-request/#dom-paymentrequestupdateevent)
|
|
192
236
|
- [ ] [PaymentMethodChangeEvent](https://www.w3.org/TR/payment-request/#dom-paymentmethodchangeevent)
|
|
237
|
+
- [ ] Implement [PaymentDetailsModifier](https://www.w3.org/TR/payment-request/#dom-paymentdetailsmodifier)
|
|
238
|
+
- [ ] Improve and unify errors according to the spec
|
|
239
|
+
- [ ] Implement `PaymentResponse` `retry()` method
|
|
240
|
+
- [ ] Implement `PaymentResponse` `toJSON()` method
|
|
241
|
+
|
|
242
|
+
### Other
|
|
243
|
+
|
|
193
244
|
- [ ] Add unit tests
|
|
194
245
|
- [ ] Add web support
|
|
195
|
-
- [ ] Improve and unify errors according to the spec
|
|
196
246
|
- [ ] Merge react-native-payments-example into this package, and setup it properly
|
|
197
247
|
- [ ] CI/CD:
|
|
198
248
|
- [ ] check/setup pull request
|
|
199
249
|
- [ ] check/setup push to master and release to NPM
|
|
200
250
|
- [ ] add e2e via maestro for IOS
|
|
201
251
|
- [ ] add e2e via maestro for Android
|
|
202
|
-
- [ ] Rewrite IOS to swift?
|
|
203
|
-
- [ ] Rewrite Android to Kotlin?
|
|
204
|
-
- [x] Improve, update and finish the docs
|
|
205
|
-
- [x] Implement canMakePayments
|
|
206
|
-
- [x] Implement Android implementation
|
|
207
|
-
- [x] Add lib.dom and comply with the spec - We do not need it
|
|
208
|
-
- [x] Create TurboModule
|
|
209
|
-
- [x] Transfer JS and convert to TS
|
|
210
|
-
- [x] Implement iOS implementation
|
|
211
|
-
- [x] Improve PaymentRequest usage, no index.js changes
|
|
212
|
-
- [x] External dependencies:
|
|
213
|
-
- [x] Do we need validator lib? - Yes, for now
|
|
214
|
-
- [x] Do we need uuid lib? - Yes, for now
|
|
215
|
-
- [x] Check `package.json` files and react-native config, can we use `dist/esm` for metro?
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AndroidSignedKey } from './android-signed-key';
|
|
2
|
+
|
|
3
|
+
// https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#intermediate-signing-key
|
|
4
|
+
export interface AndroidIntermediateSigningKey {
|
|
5
|
+
signatures: string;
|
|
6
|
+
signedKey: AndroidSignedKey;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AndroidIntermediateSigningKey } from './android-intermediate-signing-key';
|
|
2
|
+
import type { AndroidSignedMessage } from './android-signed-message';
|
|
3
|
+
|
|
4
|
+
export interface AndroidPaymentMethodToken {
|
|
5
|
+
intermediateSigningKey: AndroidIntermediateSigningKey;
|
|
6
|
+
protocolVersion: string;
|
|
7
|
+
signature: string;
|
|
8
|
+
signedMessage: AndroidSignedMessage;
|
|
9
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { AndroidPaymentMethodTokenizationType } from '../enum/android-payme
|
|
|
2
2
|
|
|
3
3
|
// https://developers.google.com/pay/api/android/reference/response-objects#PaymentMethodTokenizationData
|
|
4
4
|
export interface AndroidPaymentMethodTokenizationData {
|
|
5
|
+
// AndroidRawPaymentMethodToken is a stringified JSON object
|
|
5
6
|
token?: string;
|
|
6
7
|
type: AndroidPaymentMethodTokenizationType;
|
|
7
8
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AndroidRawIntermediateSigningKey } from './android-raw-intermediate-signing-key';
|
|
2
|
+
|
|
3
|
+
// https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#payment-method-token-structure
|
|
4
|
+
export interface AndroidRawPaymentMethodToken {
|
|
5
|
+
intermediateSigningKey: AndroidRawIntermediateSigningKey;
|
|
6
|
+
protocolVersion: string;
|
|
7
|
+
signature: string;
|
|
8
|
+
signedMessage: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#signed-message
|
|
2
|
+
export interface AndroidSignedMessage {
|
|
3
|
+
// https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#encrypted-message
|
|
4
|
+
encryptedMessage: string;
|
|
5
|
+
ephemeralPublicKey: string;
|
|
6
|
+
tag: string;
|
|
7
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
import { isAndroid } from '@rnw-community/platform/src';
|
|
3
2
|
import uuid from 'react-native-uuid';
|
|
4
3
|
|
|
5
|
-
import { isIOS } from '@rnw-community/platform';
|
|
4
|
+
import { isAndroid, isIOS } from '@rnw-community/platform';
|
|
6
5
|
import { emptyFn, getErrorMessage, isDefined, isNotEmptyArray, isNotEmptyString } from '@rnw-community/shared';
|
|
7
6
|
|
|
8
7
|
import { AndroidPaymentMethodTokenizationType } from '../../@standard/android/enum/android-payment-method-tokenization-type.enum';
|
|
@@ -5,16 +5,19 @@ import { PaymentResponse } from './payment-response';
|
|
|
5
5
|
import type { AndroidFullAddress } from '../../@standard/android/response/android-full-address';
|
|
6
6
|
import type { AndroidMinAddress } from '../../@standard/android/response/android-min-address';
|
|
7
7
|
import type { AndroidPaymentData } from '../../@standard/android/response/android-payment-data';
|
|
8
|
-
import type {
|
|
8
|
+
import type { AndroidPaymentMethodToken } from '../../@standard/android/response/android-payment-method-token';
|
|
9
|
+
import type { AndroidRawPaymentMethodToken } from '../../@standard/android/response/android-raw-payment-method-token';
|
|
10
|
+
import type { AndroidSignedKey } from '../../@standard/android/response/android-signed-key';
|
|
11
|
+
import type { AndroidSignedMessage } from '../../@standard/android/response/android-signed-message';
|
|
9
12
|
import type { PaymentResponseAddressInterface } from '../../interface/payment-response-address.interface';
|
|
10
13
|
|
|
11
|
-
export class AndroidPaymentResponse extends PaymentResponse<
|
|
14
|
+
export class AndroidPaymentResponse extends PaymentResponse<AndroidPaymentMethodToken> {
|
|
12
15
|
constructor(requestId: string, methodName: string, jsonData: string) {
|
|
13
16
|
const data = JSON.parse(jsonData) as AndroidPaymentData;
|
|
14
17
|
|
|
15
18
|
super(requestId, methodName, {
|
|
16
19
|
billingAddress: AndroidPaymentResponse.parseFullAddress(data.paymentMethodData.info.billingAddress),
|
|
17
|
-
details:
|
|
20
|
+
details: AndroidPaymentResponse.parseToken(data.paymentMethodData.tokenizationData.token),
|
|
18
21
|
payerEmail: data.email,
|
|
19
22
|
...(isDefined(data.shippingAddress) && {
|
|
20
23
|
payerName: (data.shippingAddress as AndroidMinAddress).name,
|
|
@@ -28,6 +31,39 @@ export class AndroidPaymentResponse extends PaymentResponse<AndroidPaymentDataTo
|
|
|
28
31
|
});
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
private static parseToken(input = '{}'): AndroidPaymentMethodToken {
|
|
35
|
+
if (input === 'examplePaymentMethodToken') {
|
|
36
|
+
return {
|
|
37
|
+
intermediateSigningKey: {
|
|
38
|
+
signatures: '',
|
|
39
|
+
signedKey: {
|
|
40
|
+
keyExpiration: '',
|
|
41
|
+
keyValue: '',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
protocolVersion: '',
|
|
45
|
+
signature: '',
|
|
46
|
+
signedMessage: {
|
|
47
|
+
encryptedMessage: '',
|
|
48
|
+
ephemeralPublicKey: '',
|
|
49
|
+
tag: '',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const rawToken = JSON.parse(input) as AndroidRawPaymentMethodToken;
|
|
55
|
+
|
|
56
|
+
// TODO: If needed we can add parsing of rawToken.intermediateSigningKey
|
|
57
|
+
return {
|
|
58
|
+
...rawToken,
|
|
59
|
+
intermediateSigningKey: {
|
|
60
|
+
...rawToken.intermediateSigningKey,
|
|
61
|
+
signedKey: JSON.parse(rawToken.intermediateSigningKey.signedKey) as AndroidSignedKey,
|
|
62
|
+
},
|
|
63
|
+
signedMessage: JSON.parse(rawToken.signedMessage) as AndroidSignedMessage,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
31
67
|
private static parseFullAddress(input?: AndroidFullAddress): PaymentResponseAddressInterface {
|
|
32
68
|
return {
|
|
33
69
|
countryCode: input?.countryCode ?? '',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"android-payment-data-token.d.ts","sourceRoot":"","sources":["../../../../../src/@standard/android/response/android-payment-data-token.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"android-payment-data-token.js","sourceRoot":"","sources":["../../../../../src/@standard/android/response/android-payment-data-token.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"android-payment-data-token.d.ts","sourceRoot":"","sources":["../../../../../src/@standard/android/response/android-payment-data-token.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"android-payment-data-token.js","sourceRoot":"","sources":["../../../../../src/@standard/android/response/android-payment-data-token.ts"],"names":[],"mappings":""}
|