@stripe/stripe-react-native 0.24.0 → 0.26.0
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/CHANGELOG.md +26 -1
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +26 -16
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/ios/ApplePayViewController.swift +8 -8
- package/ios/Mappers.swift +2 -0
- package/ios/PaymentMethodFactory.swift +24 -0
- package/ios/PaymentPassFinder.swift +9 -5
- package/ios/PushProvisioning/AddToWalletButtonView.swift +1 -1
- package/ios/PushProvisioning/PushProvisioningUtils.swift +8 -19
- package/ios/StripeSdk.swift +2 -10
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentMethod.js.map +1 -1
- package/lib/commonjs/types/PushProvisioning.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentMethod.js.map +1 -1
- package/lib/module/types/PushProvisioning.js.map +1 -1
- package/lib/module/types/SetupIntent.js.map +1 -1
- package/lib/typescript/src/functions.d.ts +1 -1
- package/lib/typescript/src/hooks/useConfirmPayment.d.ts +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +190 -2
- package/lib/typescript/src/types/PaymentMethod.d.ts +7 -1
- package/lib/typescript/src/types/PushProvisioning.d.ts +3 -1
- package/lib/typescript/src/types/SetupIntent.d.ts +3 -3
- package/package.json +2 -1
- package/src/types/PaymentIntent.ts +227 -3
- package/src/types/PaymentMethod.ts +9 -1
- package/src/types/PushProvisioning.ts +3 -1
- package/src/types/SetupIntent.ts +7 -20
- package/stripe-react-native.podspec +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {
|
|
1
|
+
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {\n LastPaymentError,\n ConfirmParams as PaymentIntentConfirmParams,\n ConfirmOptions as PaymentIntentConfirmOptions,\n} from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentIntentConfirmParams;\n\nexport type ConfirmOptions = PaymentIntentConfirmOptions;\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAoCYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
|
|
@@ -11,7 +11,7 @@ export declare const retrieveSetupIntent: (clientSecret: string) => Promise<Retr
|
|
|
11
11
|
* @param {object=} options An optional object that contains options for this payment method.
|
|
12
12
|
* @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.
|
|
13
13
|
*/
|
|
14
|
-
export declare const confirmPayment: (paymentIntentClientSecret: string, params?:
|
|
14
|
+
export declare const confirmPayment: (paymentIntentClientSecret: string, params?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
|
|
15
15
|
/** @deprecated Use `isPlatformPaySupported` instead. */
|
|
16
16
|
export declare const isApplePaySupported: () => Promise<boolean>;
|
|
17
17
|
/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
|
|
@@ -3,6 +3,6 @@ import type { PaymentIntent } from '../types';
|
|
|
3
3
|
* useConfirmPayment hook
|
|
4
4
|
*/
|
|
5
5
|
export declare function useConfirmPayment(): {
|
|
6
|
-
confirmPayment: (paymentIntentClientSecret: string, data?:
|
|
6
|
+
confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<import("../types").ConfirmPaymentResult>;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
};
|
|
@@ -5,7 +5,7 @@ import type { PaymentMethod, PaymentIntent, ApplePay, PaymentSheet, CreatePaymen
|
|
|
5
5
|
export declare function useStripe(): {
|
|
6
6
|
retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>;
|
|
7
7
|
retrieveSetupIntent: (clientSecret: string) => Promise<RetrieveSetupIntentResult>;
|
|
8
|
-
confirmPayment: (paymentIntentClientSecret: string, data?:
|
|
8
|
+
confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
|
|
9
9
|
createPaymentMethod: (data: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>;
|
|
10
10
|
handleNextAction: (paymentIntentClientSecret: string, returnURL?: string | undefined) => Promise<HandleNextActionResult>;
|
|
11
11
|
isApplePaySupported: boolean | null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { StripeError } from '.';
|
|
2
|
-
import type { Address } from './Common';
|
|
2
|
+
import type { Address, BillingDetails } from './Common';
|
|
3
3
|
import type { Result as PaymentMethodResult } from './PaymentMethod';
|
|
4
4
|
import type { NextAction } from './NextAction';
|
|
5
5
|
import type * as PaymentMethod from './PaymentMethod';
|
|
6
|
+
import type { FormDetails } from './components/AuBECSDebitFormComponent';
|
|
7
|
+
import type { BankAcccountHolderType, BankAcccountType } from './Token';
|
|
6
8
|
export interface Result {
|
|
7
9
|
id: string;
|
|
8
10
|
amount: number;
|
|
@@ -24,7 +26,7 @@ export interface Result {
|
|
|
24
26
|
shipping: ShippingDetails | null;
|
|
25
27
|
nextAction: NextAction | null;
|
|
26
28
|
}
|
|
27
|
-
export declare type ConfirmParams =
|
|
29
|
+
export declare type ConfirmParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
|
|
28
30
|
export declare type ConfirmOptions = PaymentMethod.ConfirmOptions;
|
|
29
31
|
export declare type LastPaymentError = StripeError<string> & {
|
|
30
32
|
paymentMethod: PaymentMethodResult;
|
|
@@ -47,3 +49,189 @@ export declare enum Status {
|
|
|
47
49
|
RequiresCapture = "RequiresCapture",
|
|
48
50
|
Unknown = "Unknown"
|
|
49
51
|
}
|
|
52
|
+
export declare type MandateData = {
|
|
53
|
+
customerAcceptance: {
|
|
54
|
+
online: {
|
|
55
|
+
ipAddress: string;
|
|
56
|
+
userAgent: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare type CardParams = {
|
|
61
|
+
paymentMethodType: 'Card';
|
|
62
|
+
paymentMethodData?: {
|
|
63
|
+
token?: string;
|
|
64
|
+
billingDetails?: BillingDetails;
|
|
65
|
+
mandateData?: MandateData;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
paymentMethodType: 'Card';
|
|
69
|
+
paymentMethodData: {
|
|
70
|
+
paymentMethodId: string;
|
|
71
|
+
cvc?: string;
|
|
72
|
+
billingDetails?: BillingDetails;
|
|
73
|
+
mandateData?: MandateData;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export interface IdealParams {
|
|
77
|
+
paymentMethodType: 'Ideal';
|
|
78
|
+
paymentMethodData?: {
|
|
79
|
+
bankName?: string;
|
|
80
|
+
billingDetails?: BillingDetails;
|
|
81
|
+
mandateData?: MandateData;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface FPXParams {
|
|
85
|
+
paymentMethodType: 'Fpx';
|
|
86
|
+
paymentMethodData?: {
|
|
87
|
+
testOfflineBank?: boolean;
|
|
88
|
+
mandateData?: MandateData;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface AlipayParams {
|
|
92
|
+
paymentMethodType: 'Alipay';
|
|
93
|
+
paymentMethodData?: {
|
|
94
|
+
mandateData?: MandateData;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface OxxoParams {
|
|
98
|
+
paymentMethodType: 'Oxxo';
|
|
99
|
+
paymentMethodData: {
|
|
100
|
+
billingDetails: BillingDetails;
|
|
101
|
+
mandateData?: MandateData;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export interface SofortParams {
|
|
105
|
+
paymentMethodType: 'Sofort';
|
|
106
|
+
paymentMethodData: {
|
|
107
|
+
country: string;
|
|
108
|
+
billingDetails: BillingDetails;
|
|
109
|
+
mandateData?: MandateData;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface GrabPayParams {
|
|
113
|
+
paymentMethodType: 'GrabPay';
|
|
114
|
+
paymentMethodData?: {
|
|
115
|
+
billingDetails?: BillingDetails;
|
|
116
|
+
mandateData?: MandateData;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface BancontactParams {
|
|
120
|
+
paymentMethodType: 'Bancontact';
|
|
121
|
+
paymentMethodData: {
|
|
122
|
+
billingDetails: BillingDetails;
|
|
123
|
+
mandateData?: MandateData;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface SepaParams {
|
|
127
|
+
paymentMethodType: 'SepaDebit';
|
|
128
|
+
paymentMethodData: {
|
|
129
|
+
iban: string;
|
|
130
|
+
billingDetails: BillingDetails;
|
|
131
|
+
mandateData?: MandateData;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export interface GiropayParams {
|
|
135
|
+
paymentMethodType: 'Giropay';
|
|
136
|
+
paymentMethodData: {
|
|
137
|
+
billingDetails: BillingDetails;
|
|
138
|
+
mandateData?: MandateData;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface AfterpayClearpayParams {
|
|
142
|
+
paymentMethodType: 'AfterpayClearpay';
|
|
143
|
+
paymentMethodData: {
|
|
144
|
+
shippingDetails: BillingDetails;
|
|
145
|
+
billingDetails: BillingDetails;
|
|
146
|
+
mandateData?: MandateData;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare type KlarnaParams = {
|
|
150
|
+
paymentMethodType: 'Klarna';
|
|
151
|
+
paymentMethodData: {
|
|
152
|
+
billingDetails: Pick<Required<BillingDetails>, 'email'> & {
|
|
153
|
+
address: Pick<Required<Address>, 'country'>;
|
|
154
|
+
} & BillingDetails;
|
|
155
|
+
shippingDetails?: BillingDetails;
|
|
156
|
+
mandateData?: MandateData;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export interface EpsParams {
|
|
160
|
+
paymentMethodType: 'Eps';
|
|
161
|
+
paymentMethodData: {
|
|
162
|
+
billingDetails: BillingDetails;
|
|
163
|
+
mandateData?: MandateData;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export interface P24Params {
|
|
167
|
+
paymentMethodType: 'P24';
|
|
168
|
+
paymentMethodData: {
|
|
169
|
+
billingDetails: BillingDetails;
|
|
170
|
+
mandateData?: MandateData;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface WeChatPayParams {
|
|
174
|
+
paymentMethodType: 'WeChatPay';
|
|
175
|
+
paymentMethodData: {
|
|
176
|
+
appId: string;
|
|
177
|
+
billingDetails?: BillingDetails;
|
|
178
|
+
mandateData?: MandateData;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export interface AuBecsDebitParams {
|
|
182
|
+
paymentMethodType: 'AuBecsDebit';
|
|
183
|
+
paymentMethodData: {
|
|
184
|
+
formDetails: FormDetails;
|
|
185
|
+
mandateData?: MandateData;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export declare type AffirmParams = {
|
|
189
|
+
paymentMethodType: 'Affirm';
|
|
190
|
+
paymentMethodData?: {
|
|
191
|
+
/** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
|
|
192
|
+
shippingDetails?: BillingDetails;
|
|
193
|
+
billingDetails?: BillingDetails;
|
|
194
|
+
mandateData?: MandateData;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* If paymentMethodData is null, it is assumed that the bank account details have already been attached
|
|
199
|
+
* via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
|
|
200
|
+
*/
|
|
201
|
+
export declare type USBankAccountParams = {
|
|
202
|
+
paymentMethodType: 'USBankAccount';
|
|
203
|
+
paymentMethodData?: {
|
|
204
|
+
billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;
|
|
205
|
+
accountNumber: string;
|
|
206
|
+
routingNumber: string;
|
|
207
|
+
/** Defaults to Individual */
|
|
208
|
+
accountHolderType?: BankAcccountHolderType;
|
|
209
|
+
/** Defaults to Checking */
|
|
210
|
+
accountType?: BankAcccountType;
|
|
211
|
+
mandateData?: MandateData;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
export declare type PayPalParams = {
|
|
215
|
+
paymentMethodType: 'PayPal';
|
|
216
|
+
paymentMethodData?: {
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
mandateData?: MandateData;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export declare type CashAppParams = {
|
|
222
|
+
paymentMethodType: 'CashApp';
|
|
223
|
+
paymentMethodData?: {
|
|
224
|
+
billingDetails?: BillingDetails;
|
|
225
|
+
mandateData?: MandateData;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
export declare type CollectBankAccountParams = {
|
|
229
|
+
paymentMethodType: 'USBankAccount';
|
|
230
|
+
paymentMethodData: {
|
|
231
|
+
billingDetails: {
|
|
232
|
+
name: string;
|
|
233
|
+
email?: string;
|
|
234
|
+
};
|
|
235
|
+
mandateData?: MandateData;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
@@ -18,7 +18,7 @@ export interface Result {
|
|
|
18
18
|
Upi: UpiResult;
|
|
19
19
|
USBankAccount: USBankAccountResult;
|
|
20
20
|
}
|
|
21
|
-
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams;
|
|
21
|
+
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
|
|
22
22
|
export declare type ConfirmParams = CreateParams;
|
|
23
23
|
export declare type CreateOptions = {
|
|
24
24
|
setupFutureUsage?: FutureUsage;
|
|
@@ -164,6 +164,12 @@ export declare type PayPalParams = {
|
|
|
164
164
|
billingDetails?: BillingDetails;
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
+
export declare type CashAppParams = {
|
|
168
|
+
paymentMethodType: 'CashApp';
|
|
169
|
+
paymentMethodData?: {
|
|
170
|
+
billingDetails?: BillingDetails;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
167
173
|
export interface AuBecsDebitResult {
|
|
168
174
|
fingerprint?: string;
|
|
169
175
|
last4?: string;
|
|
@@ -33,12 +33,14 @@ export declare type IsCardInWalletResult = {
|
|
|
33
33
|
export declare type CanAddCardToWalletParams = {
|
|
34
34
|
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
35
35
|
primaryAccountIdentifier: string | null;
|
|
36
|
-
/** Last 4 digits of the card number. */
|
|
36
|
+
/** Last 4 digits of the card number. Required for Android. */
|
|
37
37
|
cardLastFour: string;
|
|
38
38
|
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
39
39
|
testEnv?: boolean;
|
|
40
40
|
/** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */
|
|
41
41
|
hasPairedAppleWatch?: boolean;
|
|
42
|
+
/** Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. */
|
|
43
|
+
supportsTapToPay?: boolean;
|
|
42
44
|
};
|
|
43
45
|
export declare type CanAddCardToWalletResult = {
|
|
44
46
|
canAddCard: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Type } from './PaymentMethod';
|
|
2
|
-
import type { LastPaymentError } from './PaymentIntent';
|
|
2
|
+
import type { LastPaymentError, ConfirmParams as PaymentIntentConfirmParams, ConfirmOptions as PaymentIntentConfirmOptions } from './PaymentIntent';
|
|
3
3
|
import type { NextAction } from './NextAction';
|
|
4
4
|
import type * as PaymentMethod from './PaymentMethod';
|
|
5
5
|
export interface Result {
|
|
@@ -18,8 +18,8 @@ export interface Result {
|
|
|
18
18
|
description: string | null;
|
|
19
19
|
nextAction: NextAction | null;
|
|
20
20
|
}
|
|
21
|
-
export declare type ConfirmParams =
|
|
22
|
-
export declare type ConfirmOptions =
|
|
21
|
+
export declare type ConfirmParams = PaymentIntentConfirmParams;
|
|
22
|
+
export declare type ConfirmOptions = PaymentIntentConfirmOptions;
|
|
23
23
|
export declare type FutureUsage = 'Unknown' | 'None' | 'OnSession' | 'OffSession' | 'OneTime';
|
|
24
24
|
export declare enum Status {
|
|
25
25
|
Succeeded = "Succeeded",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"release": "./scripts/publish",
|
|
17
17
|
"example": "yarn --cwd example",
|
|
18
18
|
"pods": "cd example && npx pod-install --quiet",
|
|
19
|
+
"update-pods": "cd example/ios && pod update Stripe StripeApplePay StripeFinancialConnections StripePayments StripePaymentSheet StripePaymentsUI StripeCore StripeUICore",
|
|
19
20
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
20
21
|
"bootstrap-no-pods": "yarn example && yarn",
|
|
21
22
|
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { StripeError } from '.';
|
|
2
|
-
import type { Address } from './Common';
|
|
2
|
+
import type { Address, BillingDetails } from './Common';
|
|
3
3
|
import type { Result as PaymentMethodResult } from './PaymentMethod';
|
|
4
4
|
import type { NextAction } from './NextAction';
|
|
5
5
|
import type * as PaymentMethod from './PaymentMethod';
|
|
6
|
-
|
|
6
|
+
import type { FormDetails } from './components/AuBECSDebitFormComponent';
|
|
7
|
+
import type { BankAcccountHolderType, BankAcccountType } from './Token';
|
|
7
8
|
export interface Result {
|
|
8
9
|
id: string;
|
|
9
10
|
amount: number;
|
|
@@ -26,7 +27,27 @@ export interface Result {
|
|
|
26
27
|
nextAction: NextAction | null;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export type ConfirmParams =
|
|
30
|
+
export type ConfirmParams =
|
|
31
|
+
| CardParams
|
|
32
|
+
| IdealParams
|
|
33
|
+
| OxxoParams
|
|
34
|
+
| P24Params
|
|
35
|
+
| AlipayParams
|
|
36
|
+
| GiropayParams
|
|
37
|
+
| SepaParams
|
|
38
|
+
| EpsParams
|
|
39
|
+
| AuBecsDebitParams
|
|
40
|
+
| SofortParams
|
|
41
|
+
| GrabPayParams
|
|
42
|
+
| FPXParams
|
|
43
|
+
| AfterpayClearpayParams
|
|
44
|
+
| KlarnaParams
|
|
45
|
+
// | WeChatPayParams
|
|
46
|
+
| BancontactParams
|
|
47
|
+
| USBankAccountParams
|
|
48
|
+
| PayPalParams
|
|
49
|
+
| AffirmParams
|
|
50
|
+
| CashAppParams;
|
|
30
51
|
|
|
31
52
|
export type ConfirmOptions = PaymentMethod.ConfirmOptions;
|
|
32
53
|
|
|
@@ -54,3 +75,206 @@ export enum Status {
|
|
|
54
75
|
RequiresCapture = 'RequiresCapture',
|
|
55
76
|
Unknown = 'Unknown',
|
|
56
77
|
}
|
|
78
|
+
|
|
79
|
+
export type MandateData = {
|
|
80
|
+
customerAcceptance: {
|
|
81
|
+
online: {
|
|
82
|
+
ipAddress: string;
|
|
83
|
+
userAgent: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type CardParams =
|
|
89
|
+
| {
|
|
90
|
+
paymentMethodType: 'Card';
|
|
91
|
+
paymentMethodData?: {
|
|
92
|
+
token?: string;
|
|
93
|
+
billingDetails?: BillingDetails;
|
|
94
|
+
mandateData?: MandateData;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
| {
|
|
98
|
+
paymentMethodType: 'Card';
|
|
99
|
+
paymentMethodData: {
|
|
100
|
+
paymentMethodId: string;
|
|
101
|
+
cvc?: string;
|
|
102
|
+
billingDetails?: BillingDetails;
|
|
103
|
+
mandateData?: MandateData;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export interface IdealParams {
|
|
108
|
+
paymentMethodType: 'Ideal';
|
|
109
|
+
paymentMethodData?: {
|
|
110
|
+
bankName?: string;
|
|
111
|
+
billingDetails?: BillingDetails;
|
|
112
|
+
mandateData?: MandateData;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface FPXParams {
|
|
117
|
+
paymentMethodType: 'Fpx';
|
|
118
|
+
paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface AlipayParams {
|
|
122
|
+
paymentMethodType: 'Alipay';
|
|
123
|
+
paymentMethodData?: {
|
|
124
|
+
mandateData?: MandateData;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface OxxoParams {
|
|
129
|
+
paymentMethodType: 'Oxxo';
|
|
130
|
+
paymentMethodData: {
|
|
131
|
+
billingDetails: BillingDetails;
|
|
132
|
+
mandateData?: MandateData;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface SofortParams {
|
|
137
|
+
paymentMethodType: 'Sofort';
|
|
138
|
+
paymentMethodData: {
|
|
139
|
+
country: string;
|
|
140
|
+
billingDetails: BillingDetails;
|
|
141
|
+
mandateData?: MandateData;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export interface GrabPayParams {
|
|
145
|
+
paymentMethodType: 'GrabPay';
|
|
146
|
+
paymentMethodData?: {
|
|
147
|
+
billingDetails?: BillingDetails;
|
|
148
|
+
mandateData?: MandateData;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface BancontactParams {
|
|
153
|
+
paymentMethodType: 'Bancontact';
|
|
154
|
+
paymentMethodData: {
|
|
155
|
+
billingDetails: BillingDetails;
|
|
156
|
+
mandateData?: MandateData;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface SepaParams {
|
|
161
|
+
paymentMethodType: 'SepaDebit';
|
|
162
|
+
paymentMethodData: {
|
|
163
|
+
iban: string;
|
|
164
|
+
billingDetails: BillingDetails;
|
|
165
|
+
mandateData?: MandateData;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface GiropayParams {
|
|
170
|
+
paymentMethodType: 'Giropay';
|
|
171
|
+
paymentMethodData: {
|
|
172
|
+
billingDetails: BillingDetails;
|
|
173
|
+
mandateData?: MandateData;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface AfterpayClearpayParams {
|
|
178
|
+
paymentMethodType: 'AfterpayClearpay';
|
|
179
|
+
paymentMethodData: {
|
|
180
|
+
shippingDetails: BillingDetails;
|
|
181
|
+
billingDetails: BillingDetails;
|
|
182
|
+
mandateData?: MandateData;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type KlarnaParams = {
|
|
187
|
+
paymentMethodType: 'Klarna';
|
|
188
|
+
paymentMethodData: {
|
|
189
|
+
billingDetails: Pick<Required<BillingDetails>, 'email'> & {
|
|
190
|
+
address: Pick<Required<Address>, 'country'>;
|
|
191
|
+
} & BillingDetails;
|
|
192
|
+
shippingDetails?: BillingDetails;
|
|
193
|
+
mandateData?: MandateData;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export interface EpsParams {
|
|
198
|
+
paymentMethodType: 'Eps';
|
|
199
|
+
paymentMethodData: {
|
|
200
|
+
billingDetails: BillingDetails;
|
|
201
|
+
mandateData?: MandateData;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface P24Params {
|
|
206
|
+
paymentMethodType: 'P24';
|
|
207
|
+
paymentMethodData: {
|
|
208
|
+
billingDetails: BillingDetails;
|
|
209
|
+
mandateData?: MandateData;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface WeChatPayParams {
|
|
214
|
+
paymentMethodType: 'WeChatPay';
|
|
215
|
+
paymentMethodData: {
|
|
216
|
+
appId: string;
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
mandateData?: MandateData;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface AuBecsDebitParams {
|
|
223
|
+
paymentMethodType: 'AuBecsDebit';
|
|
224
|
+
paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export type AffirmParams = {
|
|
228
|
+
paymentMethodType: 'Affirm';
|
|
229
|
+
paymentMethodData?: {
|
|
230
|
+
/** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
|
|
231
|
+
shippingDetails?: BillingDetails;
|
|
232
|
+
billingDetails?: BillingDetails;
|
|
233
|
+
mandateData?: MandateData;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* If paymentMethodData is null, it is assumed that the bank account details have already been attached
|
|
239
|
+
* via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
|
|
240
|
+
*/
|
|
241
|
+
export type USBankAccountParams = {
|
|
242
|
+
paymentMethodType: 'USBankAccount';
|
|
243
|
+
paymentMethodData?: {
|
|
244
|
+
billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;
|
|
245
|
+
accountNumber: string;
|
|
246
|
+
routingNumber: string;
|
|
247
|
+
/** Defaults to Individual */
|
|
248
|
+
accountHolderType?: BankAcccountHolderType;
|
|
249
|
+
/** Defaults to Checking */
|
|
250
|
+
accountType?: BankAcccountType;
|
|
251
|
+
mandateData?: MandateData;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export type PayPalParams = {
|
|
256
|
+
paymentMethodType: 'PayPal';
|
|
257
|
+
paymentMethodData?: {
|
|
258
|
+
billingDetails?: BillingDetails;
|
|
259
|
+
mandateData?: MandateData;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export type CashAppParams = {
|
|
264
|
+
paymentMethodType: 'CashApp';
|
|
265
|
+
paymentMethodData?: {
|
|
266
|
+
billingDetails?: BillingDetails;
|
|
267
|
+
mandateData?: MandateData;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export type CollectBankAccountParams = {
|
|
272
|
+
paymentMethodType: 'USBankAccount';
|
|
273
|
+
paymentMethodData: {
|
|
274
|
+
billingDetails: {
|
|
275
|
+
name: string;
|
|
276
|
+
email?: string;
|
|
277
|
+
};
|
|
278
|
+
mandateData?: MandateData;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
@@ -43,7 +43,8 @@ export type CreateParams =
|
|
|
43
43
|
| BancontactParams
|
|
44
44
|
| USBankAccountParams
|
|
45
45
|
| PayPalParams
|
|
46
|
-
| AffirmParams
|
|
46
|
+
| AffirmParams
|
|
47
|
+
| CashAppParams;
|
|
47
48
|
|
|
48
49
|
export type ConfirmParams = CreateParams;
|
|
49
50
|
|
|
@@ -210,6 +211,13 @@ export type PayPalParams = {
|
|
|
210
211
|
};
|
|
211
212
|
};
|
|
212
213
|
|
|
214
|
+
export type CashAppParams = {
|
|
215
|
+
paymentMethodType: 'CashApp';
|
|
216
|
+
paymentMethodData?: {
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
213
221
|
export interface AuBecsDebitResult {
|
|
214
222
|
fingerprint?: string;
|
|
215
223
|
last4?: string;
|
|
@@ -39,12 +39,14 @@ export type IsCardInWalletResult =
|
|
|
39
39
|
export type CanAddCardToWalletParams = {
|
|
40
40
|
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
41
41
|
primaryAccountIdentifier: string | null;
|
|
42
|
-
/** Last 4 digits of the card number. */
|
|
42
|
+
/** Last 4 digits of the card number. Required for Android. */
|
|
43
43
|
cardLastFour: string;
|
|
44
44
|
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
45
45
|
testEnv?: boolean;
|
|
46
46
|
/** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */
|
|
47
47
|
hasPairedAppleWatch?: boolean;
|
|
48
|
+
/** Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. */
|
|
49
|
+
supportsTapToPay?: boolean;
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
export type CanAddCardToWalletResult =
|
package/src/types/SetupIntent.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Type } from './PaymentMethod';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
LastPaymentError,
|
|
4
|
+
ConfirmParams as PaymentIntentConfirmParams,
|
|
5
|
+
ConfirmOptions as PaymentIntentConfirmOptions,
|
|
6
|
+
} from './PaymentIntent';
|
|
3
7
|
import type { NextAction } from './NextAction';
|
|
4
8
|
import type * as PaymentMethod from './PaymentMethod';
|
|
5
9
|
export interface Result {
|
|
@@ -19,26 +23,9 @@ export interface Result {
|
|
|
19
23
|
nextAction: NextAction | null;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export type ConfirmParams =
|
|
23
|
-
| PaymentMethod.CardParams
|
|
24
|
-
| PaymentMethod.IdealParams
|
|
25
|
-
| PaymentMethod.OxxoParams
|
|
26
|
-
| PaymentMethod.P24Params
|
|
27
|
-
| PaymentMethod.AlipayParams
|
|
28
|
-
| PaymentMethod.GiropayParams
|
|
29
|
-
| PaymentMethod.SepaParams
|
|
30
|
-
| PaymentMethod.EpsParams
|
|
31
|
-
| PaymentMethod.AuBecsDebitParams
|
|
32
|
-
| PaymentMethod.SofortParams
|
|
33
|
-
| PaymentMethod.GrabPayParams
|
|
34
|
-
| PaymentMethod.FPXParams
|
|
35
|
-
| PaymentMethod.AfterpayClearpayParams
|
|
36
|
-
| PaymentMethod.KlarnaParams
|
|
37
|
-
| PaymentMethod.BancontactParams
|
|
38
|
-
| PaymentMethod.USBankAccountParams;
|
|
39
|
-
// TODO: Change the above back to PaymentMethod.CreateParams when PayPal is supported through SetupIntents
|
|
26
|
+
export type ConfirmParams = PaymentIntentConfirmParams;
|
|
40
27
|
|
|
41
|
-
export type ConfirmOptions =
|
|
28
|
+
export type ConfirmOptions = PaymentIntentConfirmOptions;
|
|
42
29
|
|
|
43
30
|
export type FutureUsage =
|
|
44
31
|
| 'Unknown'
|