@stripe/stripe-react-native 0.22.1 → 0.23.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 +14 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +21 -9
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +4 -2
- package/android/src/main/res/layout/googlepay_mark_button.xml +0 -2
- package/ios/ApplePayViewController.swift +23 -15
- package/ios/Mappers.swift +9 -9
- package/ios/PaymentMethodFactory.swift +1 -1
- package/ios/StripeSdk.m +1 -0
- package/ios/StripeSdk.swift +8 -5
- package/ios/Tests/ApplePayUtilsTests.swift +0 -1
- package/jest/mock.js +6 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/useApplePay.js +1 -1
- package/lib/commonjs/hooks/useApplePay.js.map +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/PushProvisioning.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/useApplePay.js +1 -1
- package/lib/module/hooks/useApplePay.js.map +1 -1
- package/lib/module/hooks/usePlatformPay.js +1 -1
- package/lib/module/hooks/usePlatformPay.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/PushProvisioning.js.map +1 -1
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +1 -1
- package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
- package/lib/typescript/src/functions.d.ts +8 -2
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +6 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +22 -11
- package/lib/typescript/src/types/PaymentSheet.d.ts +1 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +6 -1
- package/lib/typescript/src/types/PushProvisioning.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/NativeStripeSdk.tsx +3 -2
- package/src/components/AddToWalletButton.tsx +1 -1
- package/src/functions.ts +35 -4
- package/src/hooks/useApplePay.tsx +1 -2
- package/src/hooks/usePlatformPay.tsx +19 -0
- package/src/hooks/useStripe.tsx +11 -0
- package/src/index.tsx +22 -36
- package/src/types/PaymentSheet.ts +1 -1
- package/src/types/PlatformPay.ts +9 -1
- package/src/types/PushProvisioning.ts +1 -1
- package/src/types/index.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as GooglePayButtonComponent from './components/GooglePayButtonComponent';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n GooglePay,\n ApplePayButtonComponent,\n GooglePayButtonComponent,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport { Address, BillingDetails, AddressDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as GooglePayButtonComponent from './components/GooglePayButtonComponent';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n GooglePay,\n ApplePayButtonComponent,\n GooglePayButtonComponent,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport type { Address, BillingDetails, AddressDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"0tBAeA,4DAAuC,0BACvC,sEAAiD,oCACjD,sEAAiD,oCACjD,oEAA+C,kCAC/C,kEAA6C,gCAC7C,oEAA+C,kCAC/C,8DAAyC,4BACzC,qGAAgF,wDAChF,uGAAkF,0DAClF,uGAAkF,0DAClF,mFAA8D,sCAC9D,+EAA0D,kCAC1D,sDAAiC,oBACjC,oFAA+D,kDAC/D,kEAA6C,gCAoB7C,mYACA,iVAAyB"}
|
|
@@ -43,7 +43,7 @@ declare type NativeStripeSdkType = {
|
|
|
43
43
|
isPlatformPaySupported(params: {
|
|
44
44
|
googlePay?: GooglePay.IsSupportedParams;
|
|
45
45
|
}): Promise<boolean>;
|
|
46
|
-
createPlatformPayPaymentMethod(params: PlatformPay.PaymentMethodParams): Promise<PlatformPay.PaymentMethodResult>;
|
|
46
|
+
createPlatformPayPaymentMethod(params: PlatformPay.PaymentMethodParams, usesDeprecatedTokenFlow: boolean): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;
|
|
47
47
|
dismissPlatformPay(): Promise<boolean>;
|
|
48
48
|
updatePlatformPaySheet(summaryItems: Array<ApplePay.CartSummaryItem>, shippingMethods: Array<ApplePay.ShippingMethod>, errors: Array<PlatformPay.ApplePaySheetError>): Promise<void>;
|
|
49
49
|
confirmPlatformPay(clientSecret: string, params: PlatformPay.ConfirmParams, isPaymentIntent: boolean): Promise<PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult>;
|
|
@@ -10,7 +10,7 @@ export interface Props extends AccessibilityProps {
|
|
|
10
10
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
11
11
|
androidAssetSource: ImageSourcePropType;
|
|
12
12
|
testID?: string;
|
|
13
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
13
|
+
/** 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 */
|
|
14
14
|
testEnv?: boolean;
|
|
15
15
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
16
16
|
cardDetails: {
|
|
@@ -118,11 +118,17 @@ export declare const confirmPlatformPayPayment: (clientSecret: string, params: P
|
|
|
118
118
|
*/
|
|
119
119
|
export declare const dismissPlatformPay: () => Promise<boolean>;
|
|
120
120
|
/**
|
|
121
|
-
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods)
|
|
121
|
+
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
122
122
|
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
123
|
-
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with
|
|
123
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.
|
|
124
124
|
*/
|
|
125
125
|
export declare const createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
128
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
129
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
130
|
+
*/
|
|
131
|
+
export declare const createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
126
132
|
/**
|
|
127
133
|
* iOS only. Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.
|
|
128
134
|
* @param params an object describing the Apple Pay configuration, with the following fields:
|
|
@@ -32,6 +32,12 @@ export declare function usePlatformPay(): {
|
|
|
32
32
|
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
|
|
33
33
|
*/
|
|
34
34
|
createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
37
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
38
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
39
|
+
*/
|
|
40
|
+
createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
35
41
|
/**
|
|
36
42
|
* Dismiss the Apple Pay sheet if it is open. iOS only, this is a no-op on Android.
|
|
37
43
|
* @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.
|
|
@@ -51,6 +51,7 @@ export declare function useStripe(): {
|
|
|
51
51
|
confirmPlatformPayPayment: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmPaymentResult>;
|
|
52
52
|
dismissPlatformPay: () => Promise<boolean>;
|
|
53
53
|
createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
54
|
+
createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
54
55
|
updatePlatformPaySheet: (params: {
|
|
55
56
|
applePay: {
|
|
56
57
|
cartItems: Array<PlatformPay.CartSummaryItem>;
|
|
@@ -2,19 +2,30 @@ export { useConfirmPayment } from './hooks/useConfirmPayment';
|
|
|
2
2
|
export { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';
|
|
3
3
|
export { useStripe } from './hooks/useStripe';
|
|
4
4
|
export { usePlatformPay } from './hooks/usePlatformPay';
|
|
5
|
-
export { useApplePay
|
|
5
|
+
export { useApplePay } from './hooks/useApplePay';
|
|
6
|
+
export type { Props as UseApplePayProps } from './hooks/useApplePay';
|
|
6
7
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
7
8
|
export { useGooglePay } from './hooks/useGooglePay';
|
|
8
9
|
export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
|
|
9
|
-
export { initStripe, StripeProvider
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
10
|
+
export { initStripe, StripeProvider } from './components/StripeProvider';
|
|
11
|
+
export type { Props as StripeProviderProps } from './components/StripeProvider';
|
|
12
|
+
export { CardField } from './components/CardField';
|
|
13
|
+
export type { Props as CardFieldProps } from './components/CardField';
|
|
14
|
+
export { CardForm } from './components/CardForm';
|
|
15
|
+
export type { Props as CardFormProps } from './components/CardForm';
|
|
16
|
+
export { ApplePayButton } from './components/ApplePayButton';
|
|
17
|
+
export type { Props as ApplePayButtonProps } from './components/ApplePayButton';
|
|
18
|
+
export { AuBECSDebitForm } from './components/AuBECSDebitForm';
|
|
19
|
+
export type { Props as AuBECSDebitFormProps } from './components/AuBECSDebitForm';
|
|
20
|
+
export { StripeContainer } from './components/StripeContainer';
|
|
21
|
+
export type { Props as StripeContainerProps } from './components/StripeContainer';
|
|
22
|
+
export { GooglePayButton } from './components/GooglePayButton';
|
|
23
|
+
export type { Props as GooglePayButtonProps } from './components/GooglePayButton';
|
|
24
|
+
export { AddToWalletButton } from './components/AddToWalletButton';
|
|
25
|
+
export type { Props as AddToWalletButtonProps } from './components/AddToWalletButton';
|
|
26
|
+
export { AddressSheet } from './components/AddressSheet';
|
|
27
|
+
export type { Props as AddressSheetProps } from './components/AddressSheet';
|
|
28
|
+
export { PlatformPayButton } from './components/PlatformPayButton';
|
|
29
|
+
export type { Props as PlatformPayButtonProps } from './components/PlatformPayButton';
|
|
19
30
|
export * from './functions';
|
|
20
31
|
export * from './types/index';
|
|
@@ -18,7 +18,7 @@ export declare type SetupParams = ClientSecretParams & {
|
|
|
18
18
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
19
19
|
/** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
|
|
20
20
|
returnURL?: string;
|
|
21
|
-
/** PaymentSheet pre-populates the billing fields with the values provided. */
|
|
21
|
+
/** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */
|
|
22
22
|
defaultBillingDetails?: BillingDetails;
|
|
23
23
|
/**
|
|
24
24
|
* The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
|
|
@@ -262,10 +262,15 @@ export declare type ShippingContact = ApplePayShippingContact;
|
|
|
262
262
|
export declare type IsGooglePaySupportedParams = IsSupportedParams;
|
|
263
263
|
export declare type PaymentMethodResult = {
|
|
264
264
|
paymentMethod: PaymentMethod;
|
|
265
|
-
token: Token;
|
|
266
265
|
error?: undefined;
|
|
267
266
|
} | {
|
|
268
267
|
paymentMethod?: undefined;
|
|
268
|
+
error: StripeError<PlatformPayError>;
|
|
269
|
+
};
|
|
270
|
+
export declare type TokenResult = {
|
|
271
|
+
token: Token;
|
|
272
|
+
error?: undefined;
|
|
273
|
+
} | {
|
|
269
274
|
token?: undefined;
|
|
270
275
|
error: StripeError<PlatformPayError>;
|
|
271
276
|
};
|
|
@@ -35,7 +35,7 @@ export declare type CanAddCardToWalletParams = {
|
|
|
35
35
|
primaryAccountIdentifier: string | null;
|
|
36
36
|
/** Last 4 digits of the card number. */
|
|
37
37
|
cardLastFour: string;
|
|
38
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
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;
|
|
@@ -17,7 +17,7 @@ import * as PlatformPay from './PlatformPay';
|
|
|
17
17
|
export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, GooglePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, PlatformPay, };
|
|
18
18
|
export * from './PushProvisioning';
|
|
19
19
|
export * from './Errors';
|
|
20
|
-
export { Address, BillingDetails, AddressDetails } from './Common';
|
|
20
|
+
export type { Address, BillingDetails, AddressDetails } from './Common';
|
|
21
21
|
/**
|
|
22
22
|
* @ignore
|
|
23
23
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"typescript": "tsc --noEmit",
|
|
14
14
|
"lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
|
|
15
|
-
"prepare": "bob build",
|
|
15
|
+
"prepare": "bob build && husky install",
|
|
16
16
|
"release": "./scripts/publish",
|
|
17
17
|
"example": "yarn --cwd example",
|
|
18
18
|
"pods": "cd example && npx pod-install --quiet",
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -111,8 +111,9 @@ type NativeStripeSdkType = {
|
|
|
111
111
|
googlePay?: GooglePay.IsSupportedParams;
|
|
112
112
|
}): Promise<boolean>;
|
|
113
113
|
createPlatformPayPaymentMethod(
|
|
114
|
-
params: PlatformPay.PaymentMethodParams
|
|
115
|
-
|
|
114
|
+
params: PlatformPay.PaymentMethodParams,
|
|
115
|
+
usesDeprecatedTokenFlow: boolean
|
|
116
|
+
): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;
|
|
116
117
|
dismissPlatformPay(): Promise<boolean>;
|
|
117
118
|
updatePlatformPaySheet(
|
|
118
119
|
summaryItems: Array<ApplePay.CartSummaryItem>,
|
|
@@ -27,7 +27,7 @@ export interface Props extends AccessibilityProps {
|
|
|
27
27
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
28
28
|
androidAssetSource: ImageSourcePropType;
|
|
29
29
|
testID?: string;
|
|
30
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
30
|
+
/** 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 */
|
|
31
31
|
testEnv?: boolean;
|
|
32
32
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
33
33
|
cardDetails: {
|
package/src/functions.ts
CHANGED
|
@@ -810,16 +810,19 @@ export const dismissPlatformPay = async (): Promise<boolean> => {
|
|
|
810
810
|
};
|
|
811
811
|
|
|
812
812
|
/**
|
|
813
|
-
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods)
|
|
813
|
+
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
814
814
|
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
815
|
-
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with
|
|
815
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.
|
|
816
816
|
*/
|
|
817
817
|
export const createPlatformPayPaymentMethod = async (
|
|
818
818
|
params: PlatformPay.PaymentMethodParams
|
|
819
819
|
): Promise<PlatformPay.PaymentMethodResult> => {
|
|
820
820
|
try {
|
|
821
|
-
const { error, paymentMethod
|
|
822
|
-
await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
821
|
+
const { error, paymentMethod } =
|
|
822
|
+
(await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
823
|
+
params,
|
|
824
|
+
false
|
|
825
|
+
)) as PlatformPay.PaymentMethodResult;
|
|
823
826
|
if (error) {
|
|
824
827
|
return {
|
|
825
828
|
error,
|
|
@@ -827,6 +830,34 @@ export const createPlatformPayPaymentMethod = async (
|
|
|
827
830
|
}
|
|
828
831
|
return {
|
|
829
832
|
paymentMethod: paymentMethod!,
|
|
833
|
+
};
|
|
834
|
+
} catch (error: any) {
|
|
835
|
+
return {
|
|
836
|
+
error,
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
843
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
844
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
845
|
+
*/
|
|
846
|
+
export const createPlatformPayToken = async (
|
|
847
|
+
params: PlatformPay.PaymentMethodParams
|
|
848
|
+
): Promise<PlatformPay.TokenResult> => {
|
|
849
|
+
try {
|
|
850
|
+
const { error, token } =
|
|
851
|
+
(await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
852
|
+
params,
|
|
853
|
+
true
|
|
854
|
+
)) as PlatformPay.TokenResult;
|
|
855
|
+
if (error) {
|
|
856
|
+
return {
|
|
857
|
+
error,
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
return {
|
|
830
861
|
token: token!,
|
|
831
862
|
};
|
|
832
863
|
} catch (error: any) {
|
|
@@ -3,8 +3,6 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useStripe } from './useStripe';
|
|
4
4
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
5
5
|
|
|
6
|
-
const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
|
|
7
|
-
|
|
8
6
|
export interface Props {
|
|
9
7
|
/**
|
|
10
8
|
*
|
|
@@ -105,6 +103,7 @@ export function useApplePay({
|
|
|
105
103
|
);
|
|
106
104
|
|
|
107
105
|
useEffect(() => {
|
|
106
|
+
const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
|
|
108
107
|
const didSetShippingMethodListener = eventEmitter.addListener(
|
|
109
108
|
SET_SHIPPING_METHOD_CALLBACK_NAME,
|
|
110
109
|
onDidSetShippingMethod
|
|
@@ -15,6 +15,7 @@ export function usePlatformPay() {
|
|
|
15
15
|
confirmPlatformPaySetupIntent,
|
|
16
16
|
confirmPlatformPayPayment,
|
|
17
17
|
createPlatformPayPaymentMethod,
|
|
18
|
+
createPlatformPayToken,
|
|
18
19
|
dismissPlatformPay,
|
|
19
20
|
updatePlatformPaySheet,
|
|
20
21
|
canAddCardToWallet,
|
|
@@ -70,6 +71,18 @@ export function usePlatformPay() {
|
|
|
70
71
|
[createPlatformPayPaymentMethod]
|
|
71
72
|
);
|
|
72
73
|
|
|
74
|
+
const _createPlatformPayToken = useCallback(
|
|
75
|
+
async (params: PlatformPay.PaymentMethodParams) => {
|
|
76
|
+
setLoading(true);
|
|
77
|
+
|
|
78
|
+
const result = await createPlatformPayToken(params);
|
|
79
|
+
setLoading(false);
|
|
80
|
+
|
|
81
|
+
return result;
|
|
82
|
+
},
|
|
83
|
+
[createPlatformPayToken]
|
|
84
|
+
);
|
|
85
|
+
|
|
73
86
|
const _dismissPlatformPay = useCallback(async () => {
|
|
74
87
|
setLoading(true);
|
|
75
88
|
|
|
@@ -143,6 +156,12 @@ export function usePlatformPay() {
|
|
|
143
156
|
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
|
|
144
157
|
*/
|
|
145
158
|
createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
161
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
162
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
163
|
+
*/
|
|
164
|
+
createPlatformPayToken: _createPlatformPayToken,
|
|
146
165
|
/**
|
|
147
166
|
* Dismiss the Apple Pay sheet if it is open. iOS only, this is a no-op on Android.
|
|
148
167
|
* @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.
|
package/src/hooks/useStripe.tsx
CHANGED
|
@@ -72,6 +72,7 @@ import {
|
|
|
72
72
|
confirmPlatformPayPayment,
|
|
73
73
|
dismissPlatformPay,
|
|
74
74
|
createPlatformPayPaymentMethod,
|
|
75
|
+
createPlatformPayToken,
|
|
75
76
|
updatePlatformPaySheet,
|
|
76
77
|
openPlatformPaySetup,
|
|
77
78
|
} from '../functions';
|
|
@@ -367,6 +368,15 @@ export function useStripe() {
|
|
|
367
368
|
[]
|
|
368
369
|
);
|
|
369
370
|
|
|
371
|
+
const _createPlatformPayToken = useCallback(
|
|
372
|
+
async (
|
|
373
|
+
params: PlatformPay.PaymentMethodParams
|
|
374
|
+
): Promise<PlatformPay.TokenResult> => {
|
|
375
|
+
return createPlatformPayToken(params);
|
|
376
|
+
},
|
|
377
|
+
[]
|
|
378
|
+
);
|
|
379
|
+
|
|
370
380
|
const _updatePlatformPaySheet = useCallback(
|
|
371
381
|
async (params: {
|
|
372
382
|
applePay: {
|
|
@@ -426,6 +436,7 @@ export function useStripe() {
|
|
|
426
436
|
confirmPlatformPayPayment: _confirmPlatformPayPayment,
|
|
427
437
|
dismissPlatformPay: _dismissPlatformPay,
|
|
428
438
|
createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,
|
|
439
|
+
createPlatformPayToken: _createPlatformPayToken,
|
|
429
440
|
updatePlatformPaySheet: _updatePlatformPaySheet,
|
|
430
441
|
openPlatformPaySetup: _openPlatformPaySetup,
|
|
431
442
|
};
|
package/src/index.tsx
CHANGED
|
@@ -3,47 +3,33 @@ export { useConfirmPayment } from './hooks/useConfirmPayment';
|
|
|
3
3
|
export { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';
|
|
4
4
|
export { useStripe } from './hooks/useStripe';
|
|
5
5
|
export { usePlatformPay } from './hooks/usePlatformPay';
|
|
6
|
-
export { useApplePay
|
|
6
|
+
export { useApplePay } from './hooks/useApplePay';
|
|
7
|
+
export type { Props as UseApplePayProps } from './hooks/useApplePay';
|
|
7
8
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
8
9
|
export { useGooglePay } from './hooks/useGooglePay';
|
|
9
10
|
export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
|
|
10
11
|
|
|
11
12
|
//components
|
|
12
|
-
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from './components/
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from './components/
|
|
23
|
-
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from './components/
|
|
27
|
-
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from './components/
|
|
31
|
-
export {
|
|
32
|
-
GooglePayButton,
|
|
33
|
-
Props as GooglePayButtonProps,
|
|
34
|
-
} from './components/GooglePayButton';
|
|
35
|
-
export {
|
|
36
|
-
AddToWalletButton,
|
|
37
|
-
Props as AddToWalletButtonProps,
|
|
38
|
-
} from './components/AddToWalletButton';
|
|
39
|
-
export {
|
|
40
|
-
AddressSheet,
|
|
41
|
-
Props as AddressSheetProps,
|
|
42
|
-
} from './components/AddressSheet';
|
|
43
|
-
export {
|
|
44
|
-
PlatformPayButton,
|
|
45
|
-
Props as PlatformPayButtonProps,
|
|
46
|
-
} from './components/PlatformPayButton';
|
|
13
|
+
export { initStripe, StripeProvider } from './components/StripeProvider';
|
|
14
|
+
export type { Props as StripeProviderProps } from './components/StripeProvider';
|
|
15
|
+
export { CardField } from './components/CardField';
|
|
16
|
+
export type { Props as CardFieldProps } from './components/CardField';
|
|
17
|
+
export { CardForm } from './components/CardForm';
|
|
18
|
+
export type { Props as CardFormProps } from './components/CardForm';
|
|
19
|
+
export { ApplePayButton } from './components/ApplePayButton';
|
|
20
|
+
export type { Props as ApplePayButtonProps } from './components/ApplePayButton';
|
|
21
|
+
export { AuBECSDebitForm } from './components/AuBECSDebitForm';
|
|
22
|
+
export type { Props as AuBECSDebitFormProps } from './components/AuBECSDebitForm';
|
|
23
|
+
export { StripeContainer } from './components/StripeContainer';
|
|
24
|
+
export type { Props as StripeContainerProps } from './components/StripeContainer';
|
|
25
|
+
export { GooglePayButton } from './components/GooglePayButton';
|
|
26
|
+
export type { Props as GooglePayButtonProps } from './components/GooglePayButton';
|
|
27
|
+
export { AddToWalletButton } from './components/AddToWalletButton';
|
|
28
|
+
export type { Props as AddToWalletButtonProps } from './components/AddToWalletButton';
|
|
29
|
+
export { AddressSheet } from './components/AddressSheet';
|
|
30
|
+
export type { Props as AddressSheetProps } from './components/AddressSheet';
|
|
31
|
+
export { PlatformPayButton } from './components/PlatformPayButton';
|
|
32
|
+
export type { Props as PlatformPayButtonProps } from './components/PlatformPayButton';
|
|
47
33
|
|
|
48
34
|
export * from './functions';
|
|
49
35
|
|
|
@@ -19,7 +19,7 @@ export type SetupParams = ClientSecretParams & {
|
|
|
19
19
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
20
20
|
/** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
|
|
21
21
|
returnURL?: string;
|
|
22
|
-
/** PaymentSheet pre-populates the billing fields with the values provided. */
|
|
22
|
+
/** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */
|
|
23
23
|
defaultBillingDetails?: BillingDetails;
|
|
24
24
|
/**
|
|
25
25
|
* The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
|
package/src/types/PlatformPay.ts
CHANGED
|
@@ -296,11 +296,19 @@ export type IsGooglePaySupportedParams = IsSupportedParams;
|
|
|
296
296
|
export type PaymentMethodResult =
|
|
297
297
|
| {
|
|
298
298
|
paymentMethod: PaymentMethod;
|
|
299
|
-
token: Token;
|
|
300
299
|
error?: undefined;
|
|
301
300
|
}
|
|
302
301
|
| {
|
|
303
302
|
paymentMethod?: undefined;
|
|
303
|
+
error: StripeError<PlatformPayError>;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export type TokenResult =
|
|
307
|
+
| {
|
|
308
|
+
token: Token;
|
|
309
|
+
error?: undefined;
|
|
310
|
+
}
|
|
311
|
+
| {
|
|
304
312
|
token?: undefined;
|
|
305
313
|
error: StripeError<PlatformPayError>;
|
|
306
314
|
};
|
|
@@ -41,7 +41,7 @@ export type CanAddCardToWalletParams = {
|
|
|
41
41
|
primaryAccountIdentifier: string | null;
|
|
42
42
|
/** Last 4 digits of the card number. */
|
|
43
43
|
cardLastFour: string;
|
|
44
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
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;
|
package/src/types/index.ts
CHANGED