@stripe/stripe-react-native 0.40.0 → 0.42.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/README.md +3 -0
  3. package/android/.project +11 -0
  4. package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
  5. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +21 -0
  6. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +20 -0
  7. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +114 -35
  8. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +50 -0
  9. package/ios/FinancialConnections.swift +14 -2
  10. package/ios/Mappers.swift +23 -0
  11. package/ios/PaymentMethodFactory.swift +31 -29
  12. package/ios/StripeSdk.swift +50 -19
  13. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  14. package/lib/commonjs/functions.js +1 -1
  15. package/lib/commonjs/functions.js.map +1 -1
  16. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +1 -1
  17. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
  18. package/lib/commonjs/hooks/useStripe.js +1 -1
  19. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  20. package/lib/commonjs/types/FinancialConnections.js +1 -1
  21. package/lib/commonjs/types/FinancialConnections.js.map +1 -1
  22. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  23. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  24. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  25. package/lib/module/NativeStripeSdk.js.map +1 -1
  26. package/lib/module/functions.js +1 -1
  27. package/lib/module/functions.js.map +1 -1
  28. package/lib/module/hooks/useFinancialConnectionsSheet.js +1 -1
  29. package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
  30. package/lib/module/hooks/useStripe.js +1 -1
  31. package/lib/module/hooks/useStripe.js.map +1 -1
  32. package/lib/module/types/FinancialConnections.js +1 -1
  33. package/lib/module/types/FinancialConnections.js.map +1 -1
  34. package/lib/module/types/PaymentIntent.js.map +1 -1
  35. package/lib/module/types/PaymentMethod.js.map +1 -1
  36. package/lib/module/types/PaymentSheet.js.map +1 -1
  37. package/lib/typescript/src/NativeStripeSdk.d.ts +1 -1
  38. package/lib/typescript/src/functions.d.ts +6 -2
  39. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +4 -2
  40. package/lib/typescript/src/hooks/useStripe.d.ts +2 -2
  41. package/lib/typescript/src/types/FinancialConnections.d.ts +64 -0
  42. package/lib/typescript/src/types/PaymentIntent.d.ts +26 -0
  43. package/lib/typescript/src/types/PaymentMethod.d.ts +7 -0
  44. package/lib/typescript/src/types/PaymentSheet.d.ts +1 -1
  45. package/package.json +2 -2
  46. package/src/NativeStripeSdk.tsx +1 -1
  47. package/src/functions.ts +57 -2
  48. package/src/hooks/useFinancialConnectionsSheet.tsx +12 -4
  49. package/src/hooks/useStripe.tsx +10 -4
  50. package/src/types/FinancialConnections.ts +69 -0
  51. package/src/types/PaymentIntent.ts +30 -1
  52. package/src/types/PaymentMethod.ts +8 -0
  53. package/src/types/PaymentSheet.ts +1 -1
  54. package/stripe-react-native.podspec +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","handleNextAction","returnURL","Platform","OS","createError","handleNextActionForSetup","setupIntentClientSecret","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","eventEmitter","NativeEventEmitter","NativeModules","StripeSdk","confirmHandlerCallback","orderTrackingCallbackListener","initPaymentSheet","result","confirmHandler","intentConfiguration","remove","addListener","shouldSavePaymentMethod","intentCreationCallback","orderTrackingCallback","applePay","setOrderTracking","configureOrderTracking","console","warn","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPay","confirmPlatformPayPayment","dismissPlatformPay","didDismiss","createPlatformPayPaymentMethod","shippingContact","createPlatformPayToken","updatePlatformPaySheet","cartItems","shippingMethods","errors","openPlatformPaySetup","openApplePaySetup"],"sources":["functions.ts"],"sourcesContent":["import { createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport type {\n PlatformPayError,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n} from './types';\nimport {\n Platform,\n NativeEventEmitter,\n NativeModules,\n EmitterSubscription,\n} from 'react-native';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the SetupIntent.\n * Call this method if you are confirming the SetupIntent on your backend and get a status of requires_action.\n *\n * @param {string} setupIntentClientSecret The client secret associated with the SetupIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextActionForSetup = async (\n setupIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionForSetupResult> => {\n try {\n const { setupIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextActionForSetup(\n setupIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextActionForSetup(\n setupIntentClientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Call this method in your app whenever you receive a URL for a Stripe callback.\n * For convenience, you can pass all URLs you receive to this method first, and\n * check the return value to easily determine whether it is a callback URL that Stripe will handle\n * or if your app should process it normally. This is iOS-only, and will always return false on Android.\n */\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleURLCallback(url)\n : false;\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nconst eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);\nlet confirmHandlerCallback: EmitterSubscription | null = null;\nlet orderTrackingCallbackListener: EmitterSubscription | null = null;\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n let result;\n const confirmHandler = params?.intentConfiguration?.confirmHandler;\n if (confirmHandler) {\n confirmHandlerCallback?.remove();\n confirmHandlerCallback = eventEmitter.addListener(\n 'onConfirmHandlerCallback',\n ({\n paymentMethod,\n shouldSavePaymentMethod,\n }: {\n paymentMethod: PaymentMethod.Result;\n shouldSavePaymentMethod: boolean;\n }) => {\n confirmHandler(\n paymentMethod,\n shouldSavePaymentMethod,\n NativeStripeSdk.intentCreationCallback\n );\n }\n );\n }\n\n const orderTrackingCallback = params?.applePay?.setOrderTracking;\n if (orderTrackingCallback) {\n orderTrackingCallbackListener?.remove();\n orderTrackingCallbackListener = eventEmitter.addListener(\n 'onOrderTrackingCallback',\n () => {\n orderTrackingCallback(NativeStripeSdk.configureOrderTracking);\n }\n );\n }\n\n try {\n if (Platform.OS === 'ios' && !params.returnURL) {\n console.warn(\n `[@stripe/stripe-react-native] You have not provided the 'returnURL' field to 'initPaymentSheet', so payment methods that require redirects will not be shown in your iOS Payment Sheet. Visit https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-set-up-return-url to learn more.`\n );\n }\n result = await NativeStripeSdk.initPaymentSheet(params);\n\n if (result.error) {\n return {\n error: result.error,\n };\n }\n return {\n paymentOption: result.paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet = async (\n options: PaymentSheet.PresentOptions = {}\n): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.presentPaymentSheet(\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\nexport const resetPaymentSheetCustomer = async (): Promise<null> => {\n return await NativeStripeSdk.resetPaymentSheetCustomer();\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string\n): Promise<FinancialConnections.TokenResult> => {\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string\n): Promise<FinancialConnections.SessionResult> => {\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\n */\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/** @deprecated Please use `canAddCardToWallet` instead. */\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n\n/**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\nexport const isPlatformPaySupported = async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n}): Promise<boolean> => {\n return await NativeStripeSdk.isPlatformPaySupported(params ?? {});\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPaySetupIntent = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n try {\n const { error, setupIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n false\n )) as PlatformPay.ConfirmSetupIntentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPayPayment = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmPaymentResult> => {\n try {\n const { error, paymentIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n true\n )) as PlatformPay.ConfirmPaymentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\nexport const dismissPlatformPay = async (): Promise<boolean> => {\n if (Platform.OS !== 'ios') {\n return false;\n }\n try {\n const didDismiss = await NativeStripeSdk.dismissPlatformPay();\n return didDismiss;\n } catch (error: any) {\n return false;\n }\n};\n\n/**\n * 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).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.\n */\nexport const createPlatformPayPaymentMethod = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.PaymentMethodResult> => {\n try {\n const { error, paymentMethod, shippingContact } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n false\n )) as PlatformPay.PaymentMethodResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n shippingContact,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * @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).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.\n */\nexport const createPlatformPayToken = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.TokenResult> => {\n try {\n const { error, token, shippingContact } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n true\n )) as PlatformPay.TokenResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n shippingContact,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * 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.\n * @param params an object describing the Apple Pay configuration, with the following fields:\n * - cartItems An array of payment summary items to display in the Apple Pay sheet.\n * - shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * - errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\nexport const updatePlatformPaySheet = async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n}): Promise<{\n error?: StripeError<PlatformPayError>;\n}> => {\n if (Platform.OS !== 'ios') {\n return {};\n }\n\n try {\n await NativeStripeSdk.updatePlatformPaySheet(\n params.applePay.cartItems,\n params.applePay.shippingMethods,\n params.applePay.errors\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\nexport const openPlatformPaySetup = async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n await NativeStripeSdk.openApplePaySetup();\n }\n};\n"],"mappings":"qqCAAA,kCACA,sCACA,0EAgCA,yCAOO,GAAMA,oBAAmB,oDAAG,UACjCC,MAAkC,CAEK,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,GAAI,CACF,+BAAuCC,yBAAe,CAACH,mBAAmB,CACxEC,MAAM,CACNC,OAAO,CACR,CAHOE,aAAa,uBAAbA,aAAa,CAAEC,KAAK,uBAALA,KAAK,CAI5B,GAAIA,KAAK,CAAE,CACT,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACA,MAAO,CACLD,aAAa,CAAEA,aACjB,CAAC,CACH,CAAE,MAAOC,KAAU,CAAE,CACnB,MAAO,C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AAuC,CACF,CACrC,GAAI,CACF,gBACSE,yBAAe,CAAC6E,8BAA8B,CACnD/E,MAAM,CACN,IAAI,CACL,CAJKI,KAAK,QAALA,KAAK,CAAEO,KAAK,QAALA,KAAK,CAAEqE,eAAe,QAAfA,eAAe,CAKrC,GAAI5E,KAAK,CAAE,CACT,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACA,MAAO,CACLO,KAAK,CAAEA,KAAM,CACbqE,eAAe,CAAfA,eACF,CAAC,CACH,CAAE,MAAO5E,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBAvBY6E,uBAAsB,gDAuBlC,CAAC,sDAWK,GAAMC,uBAAsB,sDAAG,UAAOlF,MAM5C,CAEK,CACJ,GAAIqB,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAC,CAAC,CACX,CAEA,GAAI,CACF,KAAMpB,yBAAe,CAACgF,sBAAsB,CAC1ClF,MAAM,CAACmD,QAAQ,CAACgC,SAAS,CACzBnF,MAAM,CAACmD,QAAQ,CAACiC,eAAe,CAC/BpF,MAAM,CAACmD,QAAQ,CAACkC,MAAM,CACvB,CAED,MAAO,CAAC,CAAC,CACX,CAAE,MAAOjF,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBA1BY8E,uBAAsB,gDA0BlC,CAAC,sDAOK,GAAMI,qBAAoB,sDAAG,WAA2B,CAC7D,GAAIjE,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,KAAMpB,yBAAe,CAACqF,iBAAiB,EAAE,CAC3C,CACF,CAAC,iBAJYD,qBAAoB,4CAIhC,CAAC"}
1
+ {"version":3,"names":["createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","handleNextAction","returnURL","Platform","OS","createError","handleNextActionForSetup","setupIntentClientSecret","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","eventEmitter","NativeEventEmitter","NativeModules","StripeSdk","confirmHandlerCallback","orderTrackingCallbackListener","financialConnectionsEventListener","initPaymentSheet","result","confirmHandler","intentConfiguration","remove","addListener","shouldSavePaymentMethod","intentCreationCallback","orderTrackingCallback","applePay","setOrderTracking","configureOrderTracking","console","warn","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","collectBankAccountForPayment","onEvent","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPay","confirmPlatformPayPayment","dismissPlatformPay","didDismiss","createPlatformPayPaymentMethod","shippingContact","createPlatformPayToken","updatePlatformPaySheet","cartItems","shippingMethods","errors","openPlatformPaySetup","openApplePaySetup"],"sources":["functions.ts"],"sourcesContent":["import { createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport type {\n PlatformPayError,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n} from './types';\nimport {\n Platform,\n NativeEventEmitter,\n NativeModules,\n EmitterSubscription,\n} from 'react-native';\nimport type { CollectFinancialConnectionsAccountsParams } from './types/FinancialConnections';\nimport type { CollectBankAccountTokenParams } from './types/PaymentMethod';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the SetupIntent.\n * Call this method if you are confirming the SetupIntent on your backend and get a status of requires_action.\n *\n * @param {string} setupIntentClientSecret The client secret associated with the SetupIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextActionForSetup = async (\n setupIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionForSetupResult> => {\n try {\n const { setupIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextActionForSetup(\n setupIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextActionForSetup(\n setupIntentClientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Call this method in your app whenever you receive a URL for a Stripe callback.\n * For convenience, you can pass all URLs you receive to this method first, and\n * check the return value to easily determine whether it is a callback URL that Stripe will handle\n * or if your app should process it normally. This is iOS-only, and will always return false on Android.\n */\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleURLCallback(url)\n : false;\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nconst eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);\nlet confirmHandlerCallback: EmitterSubscription | null = null;\nlet orderTrackingCallbackListener: EmitterSubscription | null = null;\nlet financialConnectionsEventListener: EmitterSubscription | null = null;\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n let result;\n const confirmHandler = params?.intentConfiguration?.confirmHandler;\n if (confirmHandler) {\n confirmHandlerCallback?.remove();\n confirmHandlerCallback = eventEmitter.addListener(\n 'onConfirmHandlerCallback',\n ({\n paymentMethod,\n shouldSavePaymentMethod,\n }: {\n paymentMethod: PaymentMethod.Result;\n shouldSavePaymentMethod: boolean;\n }) => {\n confirmHandler(\n paymentMethod,\n shouldSavePaymentMethod,\n NativeStripeSdk.intentCreationCallback\n );\n }\n );\n }\n\n const orderTrackingCallback = params?.applePay?.setOrderTracking;\n if (orderTrackingCallback) {\n orderTrackingCallbackListener?.remove();\n orderTrackingCallbackListener = eventEmitter.addListener(\n 'onOrderTrackingCallback',\n () => {\n orderTrackingCallback(NativeStripeSdk.configureOrderTracking);\n }\n );\n }\n\n try {\n if (Platform.OS === 'ios' && !params.returnURL) {\n console.warn(\n `[@stripe/stripe-react-native] You have not provided the 'returnURL' field to 'initPaymentSheet', so payment methods that require redirects will not be shown in your iOS Payment Sheet. Visit https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-set-up-return-url to learn more.`\n );\n }\n result = await NativeStripeSdk.initPaymentSheet(params);\n\n if (result.error) {\n return {\n error: result.error,\n };\n }\n return {\n paymentOption: result.paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet = async (\n options: PaymentSheet.PresentOptions = {}\n): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.presentPaymentSheet(\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\nexport const resetPaymentSheetCustomer = async (): Promise<null> => {\n return await NativeStripeSdk.resetPaymentSheetCustomer();\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n financialConnectionsEventListener?.remove();\n\n if (params.onEvent) {\n financialConnectionsEventListener = eventEmitter.addListener(\n 'onFinancialConnectionsEvent',\n params.onEvent\n );\n }\n\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n financialConnectionsEventListener?.remove();\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n financialConnectionsEventListener?.remove();\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n financialConnectionsEventListener?.remove();\n\n if (params.onEvent) {\n financialConnectionsEventListener = eventEmitter.addListener(\n 'onFinancialConnectionsEvent',\n params.onEvent\n );\n }\n\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n financialConnectionsEventListener?.remove();\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n financialConnectionsEventListener?.remove();\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @param {CollectBankAccountTokenParams} params Optional parameters.\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string,\n params: CollectBankAccountTokenParams = {}\n): Promise<FinancialConnections.TokenResult> => {\n financialConnectionsEventListener?.remove();\n\n if (params.onEvent) {\n financialConnectionsEventListener = eventEmitter.addListener(\n 'onFinancialConnectionsEvent',\n params.onEvent\n );\n }\n\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n financialConnectionsEventListener?.remove();\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n financialConnectionsEventListener?.remove();\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @param {CollectFinancialConnectionsAccountsParams} params Optional parameters.\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string,\n params: CollectFinancialConnectionsAccountsParams = {}\n): Promise<FinancialConnections.SessionResult> => {\n financialConnectionsEventListener?.remove();\n\n if (params.onEvent) {\n financialConnectionsEventListener = eventEmitter.addListener(\n 'onFinancialConnectionsEvent',\n params.onEvent\n );\n }\n\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n financialConnectionsEventListener?.remove();\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n financialConnectionsEventListener?.remove();\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\n */\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/** @deprecated Please use `canAddCardToWallet` instead. */\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n\n/**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\nexport const isPlatformPaySupported = async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n}): Promise<boolean> => {\n return await NativeStripeSdk.isPlatformPaySupported(params ?? {});\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPaySetupIntent = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n try {\n const { error, setupIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n false\n )) as PlatformPay.ConfirmSetupIntentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPayPayment = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmPaymentResult> => {\n try {\n const { error, paymentIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n true\n )) as PlatformPay.ConfirmPaymentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\nexport const dismissPlatformPay = async (): Promise<boolean> => {\n if (Platform.OS !== 'ios') {\n return false;\n }\n try {\n const didDismiss = await NativeStripeSdk.dismissPlatformPay();\n return didDismiss;\n } catch (error: any) {\n return false;\n }\n};\n\n/**\n * 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).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.\n */\nexport const createPlatformPayPaymentMethod = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.PaymentMethodResult> => {\n try {\n const { error, paymentMethod, shippingContact } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n false\n )) as PlatformPay.PaymentMethodResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n shippingContact,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * @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).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.\n */\nexport const createPlatformPayToken = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.TokenResult> => {\n try {\n const { error, token, shippingContact } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n true\n )) as PlatformPay.TokenResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n shippingContact,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * 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.\n * @param params an object describing the Apple Pay configuration, with the following fields:\n * - cartItems An array of payment summary items to display in the Apple Pay sheet.\n * - shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * - errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\nexport const updatePlatformPaySheet = async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n}): Promise<{\n error?: StripeError<PlatformPayError>;\n}> => {\n if (Platform.OS !== 'ios') {\n return {};\n }\n\n try {\n await NativeStripeSdk.updatePlatformPaySheet(\n params.applePay.cartItems,\n params.applePay.shippingMethods,\n params.applePay.errors\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\nexport const openPlatformPaySetup = async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n await NativeStripeSdk.openApplePaySetup();\n }\n};\n"],"mappings":"qqCAAA,kCACA,sCACA,0EAgCA,yCASO,GAAMA,oBAAmB,oDAAG,UACjCC,MAAkC,CAEK,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,GAAI,CACF,+BAAuCC,yBAAe,CAACH,mBAAmB,CACxEC,MAAM,CACNC,OAAO,CACR,CAHOE,aAAa,uBAAbA,aAAa,CAAEC,KAAK,uBAALA,KAAK,CAI5B,GAAIA,KAAK,CAAE,CACT,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACA,MAAO,CACLD,aAAa,CAAEA,aACjB,CAAC,CACH,CAAE,MAAOC,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBAtBYL,oBAAmB,4CAsB/B,CAAC,gDAEK,GAAMM,Y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AsB,sDAAG,UACpCnF,MAAuC,CACF,CACrC,GAAI,CACF,gBACSE,yBAAe,CAAC+E,8BAA8B,CACnDjF,MAAM,CACN,IAAI,CACL,CAJKI,KAAK,QAALA,KAAK,CAAEO,KAAK,QAALA,KAAK,CAAEuE,eAAe,QAAfA,eAAe,CAKrC,GAAI9E,KAAK,CAAE,CACT,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACA,MAAO,CACLO,KAAK,CAAEA,KAAM,CACbuE,eAAe,CAAfA,eACF,CAAC,CACH,CAAE,MAAO9E,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBAvBY+E,uBAAsB,gDAuBlC,CAAC,sDAWK,GAAMC,uBAAsB,sDAAG,UAAOpF,MAM5C,CAEK,CACJ,GAAIqB,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAC,CAAC,CACX,CAEA,GAAI,CACF,KAAMpB,yBAAe,CAACkF,sBAAsB,CAC1CpF,MAAM,CAACoD,QAAQ,CAACiC,SAAS,CACzBrF,MAAM,CAACoD,QAAQ,CAACkC,eAAe,CAC/BtF,MAAM,CAACoD,QAAQ,CAACmC,MAAM,CACvB,CAED,MAAO,CAAC,CAAC,CACX,CAAE,MAAOnF,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBA1BYgF,uBAAsB,gDA0BlC,CAAC,sDAOK,GAAMI,qBAAoB,sDAAG,WAA2B,CAC7D,GAAInE,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,KAAMpB,yBAAe,CAACuF,iBAAiB,EAAE,CAC3C,CACF,CAAC,iBAJYD,qBAAoB,4CAIhC,CAAC"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useFinancialConnectionsSheet=useFinancialConnectionsSheet;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _useStripe2=require("./useStripe");function useFinancialConnectionsSheet(){var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var _useStripe=(0,_useStripe2.useStripe)(),collectBankAccountToken=_useStripe.collectBankAccountToken,collectFinancialConnectionsAccounts=_useStripe.collectFinancialConnectionsAccounts;var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(clientSecret){setLoading(true);var result=yield collectBankAccountToken(clientSecret);setLoading(false);return result;});return function(_x){return _ref.apply(this,arguments);};}(),[collectBankAccountToken]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(clientSecret){setLoading(true);var result=yield collectFinancialConnectionsAccounts(clientSecret);setLoading(false);return result;});return function(_x2){return _ref2.apply(this,arguments);};}(),[collectFinancialConnectionsAccounts]);return{collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,loading:loading};}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useFinancialConnectionsSheet=useFinancialConnectionsSheet;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _useStripe2=require("./useStripe");function useFinancialConnectionsSheet(){var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var _useStripe=(0,_useStripe2.useStripe)(),collectBankAccountToken=_useStripe.collectBankAccountToken,collectFinancialConnectionsAccounts=_useStripe.collectFinancialConnectionsAccounts;var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(clientSecret,params){setLoading(true);var result=yield collectBankAccountToken(clientSecret,params);setLoading(false);return result;});return function(_x,_x2){return _ref.apply(this,arguments);};}(),[collectBankAccountToken]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(clientSecret,params){setLoading(true);var result=yield collectFinancialConnectionsAccounts(clientSecret,params);setLoading(false);return result;});return function(_x3,_x4){return _ref2.apply(this,arguments);};}(),[collectFinancialConnectionsAccounts]);return{collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,loading:loading};}
2
2
  //# sourceMappingURL=useFinancialConnectionsSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFinancialConnectionsSheet","useState","loading","setLoading","useStripe","collectBankAccountToken","collectFinancialConnectionsAccounts","_collectBankAccountToken","useCallback","clientSecret","result","_collectFinancialConnectionsAccounts"],"sources":["useFinancialConnectionsSheet.tsx"],"sourcesContent":["import { useState, useCallback } from 'react';\nimport { useStripe } from './useStripe';\n\n/**\n * React hook for accessing functions on the Financial Connections sheet.\n *\n * Retuns the `collectBankAccountToken` and `collectFinancialConnectionsAccounts` functions, and a `loading` boolean that you can use\n * to display loading state (like showing a spinner).\n */\nexport function useFinancialConnectionsSheet() {\n const [loading, setLoading] = useState(false);\n const { collectBankAccountToken, collectFinancialConnectionsAccounts } =\n useStripe();\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string) => {\n setLoading(true);\n const result = await collectBankAccountToken(clientSecret);\n setLoading(false);\n return result;\n },\n [collectBankAccountToken]\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (clientSecret: string) => {\n setLoading(true);\n const result = await collectFinancialConnectionsAccounts(clientSecret);\n setLoading(false);\n return result;\n },\n [collectFinancialConnectionsAccounts]\n );\n\n return {\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n loading,\n };\n}\n"],"mappings":"4YAAA,4BACA,uCAQO,QAASA,6BAA4B,EAAG,CAC7C,cAA8B,GAAAC,eAAQ,EAAC,KAAK,CAAC,qDAAtCC,OAAO,eAAEC,UAAU,eAC1B,eACE,GAAAC,qBAAS,GAAE,CADLC,uBAAuB,YAAvBA,uBAAuB,CAAEC,mCAAmC,YAAnCA,mCAAmC,CAGpE,GAAMC,yBAAwB,CAAG,GAAAC,kBAAW,qDAC1C,UAAOC,YAAoB,CAAK,CAC9BN,UAAU,CAAC,IAAI,CAAC,CAChB,GAAMO,OAAM,MAASL,wBAAuB,CAACI,YAAY,CAAC,CAC1DN,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOO,OAAM,CACf,CAAC,8DACD,CAACL,uBAAuB,CAAC,CAC1B,CAED,GAAMM,qCAAoC,CAAG,GAAAH,kBAAW,sDACtD,UAAOC,YAAoB,CAAK,CAC9BN,UAAU,CAAC,IAAI,CAAC,CAChB,GAAMO,OAAM,MAASJ,oCAAmC,CAACG,YAAY,CAAC,CACtEN,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOO,OAAM,CACf,CAAC,gEACD,CAACJ,mCAAmC,CAAC,CACtC,CAED,MAAO,CACLD,uBAAuB,CAAEE,wBAAwB,CACjDD,mCAAmC,CAAEK,oCAAoC,CACzET,OAAO,CAAPA,OACF,CAAC,CACH"}
1
+ {"version":3,"names":["useFinancialConnectionsSheet","useState","loading","setLoading","useStripe","collectBankAccountToken","collectFinancialConnectionsAccounts","_collectBankAccountToken","useCallback","clientSecret","params","result","_collectFinancialConnectionsAccounts"],"sources":["useFinancialConnectionsSheet.tsx"],"sourcesContent":["import { useState, useCallback } from 'react';\nimport { useStripe } from './useStripe';\nimport type { CollectFinancialConnectionsAccountsParams } from 'src/types/FinancialConnections';\nimport type { CollectBankAccountTokenParams } from 'src/types/PaymentMethod';\n\n/**\n * React hook for accessing functions on the Financial Connections sheet.\n *\n * Retuns the `collectBankAccountToken` and `collectFinancialConnectionsAccounts` functions, and a `loading` boolean that you can use\n * to display loading state (like showing a spinner).\n */\nexport function useFinancialConnectionsSheet() {\n const [loading, setLoading] = useState(false);\n const { collectBankAccountToken, collectFinancialConnectionsAccounts } =\n useStripe();\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string, params?: CollectBankAccountTokenParams) => {\n setLoading(true);\n const result = await collectBankAccountToken(clientSecret, params);\n setLoading(false);\n return result;\n },\n [collectBankAccountToken]\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string,\n params?: CollectFinancialConnectionsAccountsParams\n ) => {\n setLoading(true);\n const result = await collectFinancialConnectionsAccounts(\n clientSecret,\n params\n );\n setLoading(false);\n return result;\n },\n [collectFinancialConnectionsAccounts]\n );\n\n return {\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n loading,\n };\n}\n"],"mappings":"4YAAA,4BACA,uCAUO,QAASA,6BAA4B,EAAG,CAC7C,cAA8B,GAAAC,eAAQ,EAAC,KAAK,CAAC,qDAAtCC,OAAO,eAAEC,UAAU,eAC1B,eACE,GAAAC,qBAAS,GAAE,CADLC,uBAAuB,YAAvBA,uBAAuB,CAAEC,mCAAmC,YAAnCA,mCAAmC,CAGpE,GAAMC,yBAAwB,CAAG,GAAAC,kBAAW,qDAC1C,UAAOC,YAAoB,CAAEC,MAAsC,CAAK,CACtEP,UAAU,CAAC,IAAI,CAAC,CAChB,GAAMQ,OAAM,MAASN,wBAAuB,CAACI,YAAY,CAAEC,MAAM,CAAC,CAClEP,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOQ,OAAM,CACf,CAAC,kEACD,CAACN,uBAAuB,CAAC,CAC1B,CAED,GAAMO,qCAAoC,CAAG,GAAAJ,kBAAW,sDACtD,UACEC,YAAoB,CACpBC,MAAkD,CAC/C,CACHP,UAAU,CAAC,IAAI,CAAC,CAChB,GAAMQ,OAAM,MAASL,oCAAmC,CACtDG,YAAY,CACZC,MAAM,CACP,CACDP,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOQ,OAAM,CACf,CAAC,oEACD,CAACL,mCAAmC,CAAC,CACtC,CAED,MAAO,CACLD,uBAAuB,CAAEE,wBAAwB,CACjDD,mCAAmC,CAAEM,oCAAoC,CACzEV,OAAO,CAAPA,OACF,CAAC,CACH"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=require("react");var _functions=require("../functions");function useStripe(){var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x7,_x8){return _ref6.apply(this,arguments);};}(),[]);var _handleNextActionForSetup=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(setupIntentClientSecret,returnURL){return(0,_functions.handleNextActionForSetup)(setupIntentClientSecret,returnURL);});return function(_x9,_x10){return _ref7.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x11,_x12){return _ref8.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x13){return _ref9.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x14){return _ref10.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(options){return(0,_functions.presentPaymentSheet)(options);});return function(_x15){return _ref11.apply(this,arguments);};}(),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref13=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref13.apply(this,arguments);};}(),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref14=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x17,_x18){return _ref14.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x19,_x20){return _ref15.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref16.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref17.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x25){return _ref18.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x26){return _ref19.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref20=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x27){return _ref20.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isPlatformPaySupported)(params);});return function(_x28){return _ref22.apply(this,arguments);};}(),[]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPaySetupIntent)(clientSecret,params);});return function(_x29,_x30){return _ref23.apply(this,arguments);};}(),[]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPayPayment)(clientSecret,params);});return function(_x31,_x32){return _ref24.apply(this,arguments);};}(),[]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.dismissPlatformPay)();}),[]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayPaymentMethod)(params);});return function(_x33){return _ref26.apply(this,arguments);};}(),[]);var _createPlatformPayToken=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayToken)(params);});return function(_x34){return _ref27.apply(this,arguments);};}(),[]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref28=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.updatePlatformPaySheet)(params);});return function(_x35){return _ref28.apply(this,arguments);};}(),[]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openPlatformPaySetup)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,handleNextActionForSetup:_handleNextActionForSetup,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,dismissPlatformPay:_dismissPlatformPay,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,createPlatformPayToken:_createPlatformPayToken,updatePlatformPaySheet:_updatePlatformPaySheet,openPlatformPaySetup:_openPlatformPaySetup};}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=require("react");var _functions=require("../functions");function useStripe(){var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x7,_x8){return _ref6.apply(this,arguments);};}(),[]);var _handleNextActionForSetup=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(setupIntentClientSecret,returnURL){return(0,_functions.handleNextActionForSetup)(setupIntentClientSecret,returnURL);});return function(_x9,_x10){return _ref7.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x11,_x12){return _ref8.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x13){return _ref9.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x14){return _ref10.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(options){return(0,_functions.presentPaymentSheet)(options);});return function(_x15){return _ref11.apply(this,arguments);};}(),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref13=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref13.apply(this,arguments);};}(),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref14=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x17,_x18){return _ref14.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x19,_x20){return _ref15.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref16.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref17.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x25){return _ref18.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountToken)(clientSecret,params);});return function(_x26,_x27){return _ref19.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref20=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret,params);});return function(_x28,_x29){return _ref20.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isPlatformPaySupported)(params);});return function(_x30){return _ref22.apply(this,arguments);};}(),[]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPaySetupIntent)(clientSecret,params);});return function(_x31,_x32){return _ref23.apply(this,arguments);};}(),[]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPayPayment)(clientSecret,params);});return function(_x33,_x34){return _ref24.apply(this,arguments);};}(),[]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.dismissPlatformPay)();}),[]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayPaymentMethod)(params);});return function(_x35){return _ref26.apply(this,arguments);};}(),[]);var _createPlatformPayToken=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayToken)(params);});return function(_x36){return _ref27.apply(this,arguments);};}(),[]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref28=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.updatePlatformPaySheet)(params);});return function(_x37){return _ref28.apply(this,arguments);};}(),[]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openPlatformPaySetup)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,handleNextActionForSetup:_handleNextActionForSetup,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,dismissPlatformPay:_dismissPlatformPay,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,createPlatformPayToken:_createPlatformPayToken,updatePlatformPaySheet:_updatePlatformPaySheet,openPlatformPaySetup:_openPlatformPaySetup};}
2
2
  //# sourceMappingURL=useStripe.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useStripe","_createPaymentMethod","useCallback","data","options","createPaymentMethod","_createToken","params","createToken","_retrievePaymentIntent","clientSecret","retrievePaymentIntent","_retrieveSetupIntent","retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","confirmPayment","_handleNextAction","returnURL","handleNextAction","_handleNextActionForSetup","setupIntentClientSecret","handleNextActionForSetup","_confirmSetupIntent","confirmSetupIntent","_createTokenForCVCUpdate","cvc","createTokenForCVCUpdate","_initPaymentSheet","initPaymentSheet","_presentPaymentSheet","presentPaymentSheet","_confirmPaymentSheetPayment","confirmPaymentSheetPayment","_handleURLCallback","url","handleURLCallback","_collectBankAccountForPayment","collectBankAccountForPayment","_collectBankAccountForSetup","collectBankAccountForSetup","_verifyMicrodepositsForPayment","verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","verifyMicrodepositsForSetup","_canAddCardToWallet","canAddCardToWallet","_collectBankAccountToken","collectBankAccountToken","_collectFinancialConnectionsAccounts","collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","resetPaymentSheetCustomer","_isPlatformPaySupported","isPlatformPaySupported","_confirmPlatformPaySetupIntent","confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","confirmPlatformPayPayment","_dismissPlatformPay","dismissPlatformPay","_createPlatformPayPaymentMethod","createPlatformPayPaymentMethod","_createPlatformPayToken","createPlatformPayToken","_updatePlatformPaySheet","updatePlatformPaySheet","_openPlatformPaySetup","openPlatformPaySetup"],"sources":["useStripe.tsx"],"sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n PlatformPayError,\n} from '../types';\nimport { useCallback } from 'react';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleNextActionForSetup,\n handleURLCallback,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n dismissPlatformPay,\n createPlatformPayPaymentMethod,\n createPlatformPayToken,\n updatePlatformPaySheet,\n openPlatformPaySetup,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _handleNextActionForSetup = useCallback(\n async (\n setupIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionForSetupResult> => {\n return handleNextActionForSetup(setupIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet = useCallback(\n async (\n options?: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet(options);\n },\n []\n );\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n }): Promise<boolean> => {\n return isPlatformPaySupported(params);\n },\n []\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n return confirmPlatformPaySetupIntent(clientSecret, params);\n },\n []\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmPaymentResult> => {\n return confirmPlatformPayPayment(clientSecret, params);\n },\n []\n );\n\n const _dismissPlatformPay = useCallback(async (): Promise<boolean> => {\n return dismissPlatformPay();\n }, []);\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.PaymentMethodResult> => {\n return createPlatformPayPaymentMethod(params);\n },\n []\n );\n\n const _createPlatformPayToken = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.TokenResult> => {\n return createPlatformPayToken(params);\n },\n []\n );\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }): Promise<{\n error?: StripeError<PlatformPayError>;\n }> => {\n return updatePlatformPaySheet(params);\n },\n []\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n handleNextActionForSetup: _handleNextActionForSetup,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n /**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\n resetPaymentSheetCustomer: _resetPaymentSheetCustomer,\n isPlatformPaySupported: _isPlatformPaySupported,\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n dismissPlatformPay: _dismissPlatformPay,\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n createPlatformPayToken: _createPlatformPayToken,\n updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"],"mappings":"0QA8BA,4BACA,uCAmCO,QAASA,UAAS,EAAG,CAC1B,GAAMC,qBAAoB,CAAG,GAAAC,kBAAW,qDACtC,UACEC,IAAgC,CAEO,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,MAAO,GAAAC,8BAAmB,EAACF,IAAI,CAAEC,OAAO,CAAC,CAC3C,CAAC,8DACD,EAAE,CACH,CAED,GAAME,aAAY,CAAG,GAAAJ,kBAAW,sDAC9B,UAAOK,MAA0B,CAAiC,CAChE,MAAO,GAAAC,sBAAW,EAACD,MAAM,CAAC,CAC5B,CAAC,gEACD,EAAE,CACH,CAED,GAAME,uBAAsB,CAAG,GAAAP,kBAAW,sDACxC,UAAOQ,YAAoB,CAA2C,CACpE,MAAO,GAAAC,gCAAqB,EAACD,YAAY,CAAC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mBAAmB,CACvCG,8BAA8B,CAAED,+BAA+B,CAC/DG,sBAAsB,CAAED,uBAAuB,CAC/CG,sBAAsB,CAAED,uBAAuB,CAC/CG,oBAAoB,CAAED,qBACxB,CAAC,CACH"}
1
+ {"version":3,"names":["useStripe","_createPaymentMethod","useCallback","data","options","createPaymentMethod","_createToken","params","createToken","_retrievePaymentIntent","clientSecret","retrievePaymentIntent","_retrieveSetupIntent","retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","confirmPayment","_handleNextAction","returnURL","handleNextAction","_handleNextActionForSetup","setupIntentClientSecret","handleNextActionForSetup","_confirmSetupIntent","confirmSetupIntent","_createTokenForCVCUpdate","cvc","createTokenForCVCUpdate","_initPaymentSheet","initPaymentSheet","_presentPaymentSheet","presentPaymentSheet","_confirmPaymentSheetPayment","confirmPaymentSheetPayment","_handleURLCallback","url","handleURLCallback","_collectBankAccountForPayment","collectBankAccountForPayment","_collectBankAccountForSetup","collectBankAccountForSetup","_verifyMicrodepositsForPayment","verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","verifyMicrodepositsForSetup","_canAddCardToWallet","canAddCardToWallet","_collectBankAccountToken","collectBankAccountToken","_collectFinancialConnectionsAccounts","collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","resetPaymentSheetCustomer","_isPlatformPaySupported","isPlatformPaySupported","_confirmPlatformPaySetupIntent","confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","confirmPlatformPayPayment","_dismissPlatformPay","dismissPlatformPay","_createPlatformPayPaymentMethod","createPlatformPayPaymentMethod","_createPlatformPayToken","createPlatformPayToken","_updatePlatformPaySheet","updatePlatformPaySheet","_openPlatformPaySetup","openPlatformPaySetup"],"sources":["useStripe.tsx"],"sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n PlatformPayError,\n} from '../types';\nimport { useCallback } from 'react';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleNextActionForSetup,\n handleURLCallback,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n dismissPlatformPay,\n createPlatformPayPaymentMethod,\n createPlatformPayToken,\n updatePlatformPaySheet,\n openPlatformPaySetup,\n} from '../functions';\nimport type { CollectBankAccountTokenParams } from 'src/types/PaymentMethod';\nimport type { CollectFinancialConnectionsAccountsParams } from 'src/types/FinancialConnections';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _handleNextActionForSetup = useCallback(\n async (\n setupIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionForSetupResult> => {\n return handleNextActionForSetup(setupIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet = useCallback(\n async (\n options?: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet(options);\n },\n []\n );\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (\n clientSecret: string,\n params?: CollectBankAccountTokenParams\n ): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret, params);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string,\n params?: CollectFinancialConnectionsAccountsParams\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret, params);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n }): Promise<boolean> => {\n return isPlatformPaySupported(params);\n },\n []\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n return confirmPlatformPaySetupIntent(clientSecret, params);\n },\n []\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmPaymentResult> => {\n return confirmPlatformPayPayment(clientSecret, params);\n },\n []\n );\n\n const _dismissPlatformPay = useCallback(async (): Promise<boolean> => {\n return dismissPlatformPay();\n }, []);\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.PaymentMethodResult> => {\n return createPlatformPayPaymentMethod(params);\n },\n []\n );\n\n const _createPlatformPayToken = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.TokenResult> => {\n return createPlatformPayToken(params);\n },\n []\n );\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }): Promise<{\n error?: StripeError<PlatformPayError>;\n }> => {\n return updatePlatformPaySheet(params);\n },\n []\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n handleNextActionForSetup: _handleNextActionForSetup,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n /**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\n resetPaymentSheetCustomer: _resetPaymentSheetCustomer,\n isPlatformPaySupported: _isPlatformPaySupported,\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n dismissPlatformPay: _dismissPlatformPay,\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n createPlatformPayToken: _createPlatformPayToken,\n updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"],"mappings":"0QA8BA,4BACA,uCAqCO,QAASA,UAAS,EAAG,CAC1B,GAAMC,qBAAoB,CAAG,GAAAC,kBAAW,qDACtC,UACEC,IAAgC,CAEO,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,MAAO,GAAAC,8BAAmB,EAACF,IAAI,CAAEC,OAAO,CAAC,CAC3C,CAAC,8DACD,EAAE,CACH,CAED,GAAME,aAAY,CAAG,GAAAJ,kBAAW,sDAC9B,UAAOK,MAA0B,CAAiC,CAChE,MAAO,GAAAC,sBAAW,EAACD,MAAM,CAAC,CAC5B,CAAC,gEACD,EAAE,CACH,CAED,GAAME,uBAAsB,CAAG,GAAAP,kBAAW,sDACxC,UAAOQ,YAAoB,CAA2C,CACpE,MAAO,GAAAC,gCAAqB,EAACD,YAAY,CAAC,CAC5C,CAAC,gEACD,EAAE,CACH,CAED,GAAME,qBAAoB,CAAG,GAAAV,kBAAW,sDACtC,UAAOQ,YAAoB,CAAyC,CAClE,MAAO,GAAAG,8BAAmB,EAACH,YAAY,CAAC,CAC1C,CAAC,gEACD,EAAE,CACH,CAED,GAAMI,gBAAe,CAAG,GAAAZ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@@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.FinancialConnectionsSheetError=void 0;var FinancialConnectionsSheetError;exports.FinancialConnectionsSheetError=FinancialConnectionsSheetError;(function(FinancialConnectionsSheetError){FinancialConnectionsSheetError["Failed"]="Failed";FinancialConnectionsSheetError["Canceled"]="Canceled";})(FinancialConnectionsSheetError||(exports.FinancialConnectionsSheetError=FinancialConnectionsSheetError={}));
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.FinancialConnectionsSheetError=exports.FinancialConnectionsEventName=exports.FinancialConnectionsEventErrorCode=void 0;var FinancialConnectionsSheetError;exports.FinancialConnectionsSheetError=FinancialConnectionsSheetError;(function(FinancialConnectionsSheetError){FinancialConnectionsSheetError["Failed"]="Failed";FinancialConnectionsSheetError["Canceled"]="Canceled";})(FinancialConnectionsSheetError||(exports.FinancialConnectionsSheetError=FinancialConnectionsSheetError={}));var FinancialConnectionsEventName;exports.FinancialConnectionsEventName=FinancialConnectionsEventName;(function(FinancialConnectionsEventName){FinancialConnectionsEventName["Open"]="open";FinancialConnectionsEventName["ManualEntryInitiated"]="manual_entry_initiated";FinancialConnectionsEventName["ConsentAcquired"]="consent_acquired";FinancialConnectionsEventName["SearchInitiated"]="search_initiated";FinancialConnectionsEventName["InstitutionSelected"]="institution_selected";FinancialConnectionsEventName["InstitutionAuthorized"]="institution_authorized";FinancialConnectionsEventName["AccountsSelected"]="accounts_selected";FinancialConnectionsEventName["Success"]="success";FinancialConnectionsEventName["Error"]="error";FinancialConnectionsEventName["Cancel"]="cancel";FinancialConnectionsEventName["FlowLaunchedInBrowser"]="flow_launched_in_browser";})(FinancialConnectionsEventName||(exports.FinancialConnectionsEventName=FinancialConnectionsEventName={}));var FinancialConnectionsEventErrorCode;exports.FinancialConnectionsEventErrorCode=FinancialConnectionsEventErrorCode;(function(FinancialConnectionsEventErrorCode){FinancialConnectionsEventErrorCode["AccountNumbersUnavailable"]="account_numbers_unavailable";FinancialConnectionsEventErrorCode["AccountsUnavailable"]="accounts_unavailable";FinancialConnectionsEventErrorCode["NoDebitableAccount"]="no_debitable_account";FinancialConnectionsEventErrorCode["AuthorizationFailed"]="authorization_failed";FinancialConnectionsEventErrorCode["InstitutionUnavailablePlanned"]="institution_unavailable_planned";FinancialConnectionsEventErrorCode["InstitutionUnavailableUnplanned"]="institution_unavailable_unplanned";FinancialConnectionsEventErrorCode["InstitutionTimeout"]="institution_timeout";FinancialConnectionsEventErrorCode["UnexpectedError"]="unexpected_error";FinancialConnectionsEventErrorCode["SessionExpired"]="session_expired";FinancialConnectionsEventErrorCode["FailedBotDetection"]="failed_bot_detection";})(FinancialConnectionsEventErrorCode||(exports.FinancialConnectionsEventErrorCode=FinancialConnectionsEventErrorCode={}));
2
2
  //# sourceMappingURL=FinancialConnections.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FinancialConnectionsSheetError"],"sources":["FinancialConnections.ts"],"sourcesContent":["import type { BankAccount } from './Token';\nimport type { StripeError } from './Errors';\n\nexport type SessionResult =\n | {\n /** The updated Financial Connections Session object. */\n session: Session;\n error?: undefined;\n }\n | {\n session?: undefined;\n error: StripeError<FinancialConnectionsSheetError>;\n };\n\nexport type TokenResult =\n | {\n /** The updated Financial Connections Session object. */\n session: Session;\n /** The Stripe token object associated with the bank account. */\n token: BankAccountToken;\n error?: undefined;\n }\n | {\n session?: undefined;\n token?: undefined;\n error: StripeError<FinancialConnectionsSheetError>;\n };\n\nexport type Session = {\n /** A unique ID for this session. */\n id: string;\n /** The client secret for this session. */\n clientSecret: string;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n /** The accounts that were collected as part of this Session. */\n accounts: Array<Account>;\n};\n\nexport type BankAccountToken = {\n /** Bank account details. */\n bankAccount: BankAccount | null;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n /** A unique ID for this token. */\n id: string | null;\n used: boolean;\n type: 'BankAccount';\n /** The UNIX timestamp (in milliseconds) of the date this token was created. */\n created: number | null;\n};\n\nexport type Account = {\n /** A unique ID for this Financial Connections Account. */\n id: string;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n displayName: string | null;\n /** The current status of the account. Either active, inactive, or disconnected. */\n status: AccountStatus;\n institutionName: string;\n last4: string | null;\n /** The UNIX timestamp (in milliseconds) of the date this account was created. */\n created: number;\n /** The balance of this account. */\n balance: Balance | null;\n /** The last balance refresh. Includes the timestamp and the status. */\n balanceRefresh: BalanceRefresh | null;\n /** The category of this account, either cash, credit, investment, or other. */\n category: Category;\n /** The subcategory of this account, either checking, credit_card, line_of_credit, mortgage, savings, or other. */\n subcategory: Subcategory;\n /** Permissions requested for accounts collected during this session. */\n permissions: Array<Permission> | null;\n /** The supported payment method types for this account. */\n supportedPaymentMethodTypes: Array<PaymentMethodType>;\n};\n\nexport type AccountStatus = 'active' | 'inactive' | 'disconnected';\n\nexport type Category = 'cash' | 'credit' | 'investment' | 'other';\n\nexport type PaymentMethodType = 'us_bank_account' | 'link';\n\nexport type Subcategory =\n | 'checking'\n | 'creditCard'\n | 'lineOfCredit'\n | 'mortgage'\n | 'other'\n | 'savings';\n\nexport type Permission =\n | 'balances'\n | 'ownership'\n | 'paymentMethod'\n | 'transactions'\n | 'accountNumbers';\n\nexport type Balance = {\n /** The UNIX timestamp (in milliseconds) of time that the external institution calculated this balance. */\n asOf: number;\n /** The type of this balance, either cash or credit. */\n type: BalanceType;\n /** The funds available to the account holder. Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n cash: { available: Map<String, number> | null };\n /** The credit that has been used by the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n credit: { used: Map<String, number> | null };\n /** The balances owed to (or by) the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n current: Map<String, number>;\n};\n\nexport type BalanceRefresh = {\n status: BalanceRefreshStatus;\n /** The UNIX timestamp (in milliseconds) of the time at which the last refresh attempt was initiated. */\n lastAttemptedAt: number;\n};\n\nexport type BalanceType = 'cash' | 'credit';\n\nexport type BalanceRefreshStatus = 'failed' | 'pending' | 'succeeded';\n\nexport enum FinancialConnectionsSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n"],"mappings":"0GA0HYA,+BAA8B,iFAA9BA,8BAA8B,EAA9BA,8BAA8B,oBAA9BA,8BAA8B,2BAA9BA,8BAA8B,0CAA9BA,8BAA8B"}
1
+ {"version":3,"names":["FinancialConnectionsSheetError","FinancialConnectionsEventName","FinancialConnectionsEventErrorCode"],"sources":["FinancialConnections.ts"],"sourcesContent":["import type { BankAccount } from './Token';\nimport type { StripeError } from './Errors';\n\nexport type CollectFinancialConnectionsAccountsParams = {\n /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */\n onEvent?: (event: FinancialConnectionsEvent) => void;\n};\n\nexport type SessionResult =\n | {\n /** The updated Financial Connections Session object. */\n session: Session;\n error?: undefined;\n }\n | {\n session?: undefined;\n error: StripeError<FinancialConnectionsSheetError>;\n };\n\nexport type TokenResult =\n | {\n /** The updated Financial Connections Session object. */\n session: Session;\n /** The Stripe token object associated with the bank account. */\n token: BankAccountToken;\n error?: undefined;\n }\n | {\n session?: undefined;\n token?: undefined;\n error: StripeError<FinancialConnectionsSheetError>;\n };\n\nexport type Session = {\n /** A unique ID for this session. */\n id: string;\n /** The client secret for this session. */\n clientSecret: string;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n /** The accounts that were collected as part of this Session. */\n accounts: Array<Account>;\n};\n\nexport type BankAccountToken = {\n /** Bank account details. */\n bankAccount: BankAccount | null;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n /** A unique ID for this token. */\n id: string | null;\n used: boolean;\n type: 'BankAccount';\n /** The UNIX timestamp (in milliseconds) of the date this token was created. */\n created: number | null;\n};\n\nexport type Account = {\n /** A unique ID for this Financial Connections Account. */\n id: string;\n /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */\n livemode: boolean;\n displayName: string | null;\n /** The current status of the account. Either active, inactive, or disconnected. */\n status: AccountStatus;\n institutionName: string;\n last4: string | null;\n /** The UNIX timestamp (in milliseconds) of the date this account was created. */\n created: number;\n /** The balance of this account. */\n balance: Balance | null;\n /** The last balance refresh. Includes the timestamp and the status. */\n balanceRefresh: BalanceRefresh | null;\n /** The category of this account, either cash, credit, investment, or other. */\n category: Category;\n /** The subcategory of this account, either checking, credit_card, line_of_credit, mortgage, savings, or other. */\n subcategory: Subcategory;\n /** Permissions requested for accounts collected during this session. */\n permissions: Array<Permission> | null;\n /** The supported payment method types for this account. */\n supportedPaymentMethodTypes: Array<PaymentMethodType>;\n};\n\nexport type AccountStatus = 'active' | 'inactive' | 'disconnected';\n\nexport type Category = 'cash' | 'credit' | 'investment' | 'other';\n\nexport type PaymentMethodType = 'us_bank_account' | 'link';\n\nexport type Subcategory =\n | 'checking'\n | 'creditCard'\n | 'lineOfCredit'\n | 'mortgage'\n | 'other'\n | 'savings';\n\nexport type Permission =\n | 'balances'\n | 'ownership'\n | 'paymentMethod'\n | 'transactions'\n | 'accountNumbers';\n\nexport type Balance = {\n /** The UNIX timestamp (in milliseconds) of time that the external institution calculated this balance. */\n asOf: number;\n /** The type of this balance, either cash or credit. */\n type: BalanceType;\n /** The funds available to the account holder. Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n cash: { available: Map<String, number> | null };\n /** The credit that has been used by the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n credit: { used: Map<String, number> | null };\n /** The balances owed to (or by) the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */\n current: Map<String, number>;\n};\n\nexport type BalanceRefresh = {\n status: BalanceRefreshStatus;\n /** The UNIX timestamp (in milliseconds) of the time at which the last refresh attempt was initiated. */\n lastAttemptedAt: number;\n};\n\nexport type BalanceType = 'cash' | 'credit';\n\nexport type BalanceRefreshStatus = 'failed' | 'pending' | 'succeeded';\n\nexport enum FinancialConnectionsSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport type FinancialConnectionsEvent = {\n /** The event's name. Represents the type of event that has occurred during the Financial Connections process. */\n name: FinancialConnectionsEventName;\n /** Event-associated metadata. Provides further detail related to the occurred event. */\n metadata: FinancialConnectionsEventMetadata;\n};\n\nexport enum FinancialConnectionsEventName {\n /** Invoked when the sheet successfully opens. */\n Open = 'open',\n /** Invoked when the manual entry flow is initiated. */\n ManualEntryInitiated = 'manual_entry_initiated',\n /** Invoked when \"Agree and continue\" is selected on the consent pane. */\n ConsentAcquired = 'consent_acquired',\n /** Invoked when the search bar is selected, the user inputs search terms, and receives an API response. */\n SearchInitiated = 'search_initiated',\n /** Invoked when an institution is selected, either from featured institutions or search results. */\n InstitutionSelected = 'institution_selected',\n /** Invoked when the authorization is successfully completed. */\n InstitutionAuthorized = 'institution_authorized',\n /** Invoked when accounts are selected and \"confirm\" is selected. */\n AccountsSelected = 'accounts_selected',\n /** Invoked when the flow is completed and selected accounts are correctly connected to the payment instrument. */\n Success = 'success',\n /** Invoked when an error is encountered. Refer to error codes for more details. */\n Error = 'error',\n /** Invoked when the flow is cancelled, typically by the user pressing the \"X\" button. */\n Cancel = 'cancel',\n /** Invoked when the modal is launched in an external browser. After this event, no other events will be sent until the completion of the browser session. */\n FlowLaunchedInBrowser = 'flow_launched_in_browser',\n}\n\nexport type FinancialConnectionsEventMetadata = {\n /** A Boolean value that indicates if the user completed the process through the manual entry flow. */\n manualEntry?: boolean;\n /** A String value containing the name of the institution that the user selected. */\n institutionName?: string;\n /** An ErrorCode value representing the type of error that occurred. */\n errorCode?: FinancialConnectionsEventErrorCode;\n};\n\nexport enum FinancialConnectionsEventErrorCode {\n /** The system could not retrieve account numbers for selected accounts. */\n AccountNumbersUnavailable = 'account_numbers_unavailable',\n /** The system could not retrieve accounts for the selected institution. */\n AccountsUnavailable = 'accounts_unavailable',\n /** For payment flows, no debitable account was available at the selected institution. */\n NoDebitableAccount = 'no_debitable_account',\n /** Authorization with the selected institution has failed. */\n AuthorizationFailed = 'authorization_failed',\n /** The selected institution is down for expected maintenance. */\n InstitutionUnavailablePlanned = 'institution_unavailable_planned',\n /** The selected institution is unexpectedly down. */\n InstitutionUnavailableUnplanned = 'institution_unavailable_unplanned',\n /** A timeout occurred while communicating with our partner or downstream institutions. */\n InstitutionTimeout = 'institution_timeout',\n /** An unexpected error occurred, either in an API call or on the client-side. */\n UnexpectedError = 'unexpected_error',\n /** The client secret that powers the session has expired. */\n SessionExpired = 'session_expired',\n /** The hCaptcha challenge failed. */\n FailedBotDetection = 'failed_bot_detection',\n}\n"],"mappings":"2LA+HYA,+BAA8B,iFAA9BA,8BAA8B,EAA9BA,8BAA8B,oBAA9BA,8BAA8B,2BAA9BA,8BAA8B,0CAA9BA,8BAA8B,SAY9BC,8BAA6B,+EAA7BA,6BAA6B,EAA7BA,6BAA6B,gBAA7BA,6BAA6B,kDAA7BA,6BAA6B,uCAA7BA,6BAA6B,uCAA7BA,6BAA6B,+CAA7BA,6BAA6B,mDAA7BA,6BAA6B,yCAA7BA,6BAA6B,sBAA7BA,6BAA6B,kBAA7BA,6BAA6B,oBAA7BA,6BAA6B,wDAA7BA,6BAA6B,yCAA7BA,6BAA6B,SAkC7BC,mCAAkC,yFAAlCA,kCAAkC,EAAlCA,kCAAkC,4DAAlCA,kCAAkC,+CAAlCA,kCAAkC,8CAAlCA,kCAAkC,+CAAlCA,kCAAkC,oEAAlCA,kCAAkC,wEAAlCA,kCAAkC,6CAAlCA,kCAAkC,uCAAlCA,kCAAkC,qCAAlCA,kCAAkC,iDAAlCA,kCAAkC,8CAAlCA,kCAAkC"}
@@ -1 +1 @@
1
- {"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address, BillingDetails } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nimport type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type { BankAcccountHolderType, BankAcccountType } from './Token';\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: CaptureMethod;\n confirmationMethod: CaptureMethod;\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type CaptureMethod = 'Automatic' | 'Manual';\n\nexport type ConfirmParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams\n | RevolutPayParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n\nexport type MandateData = {\n customerAcceptance: {\n online: {\n ipAddress: string;\n userAgent: string;\n };\n };\n};\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n paymentMethodData?: {\n mandateData?: MandateData;\n };\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: BillingDetails;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** 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. */\n shippingDetails?: BillingDetails;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n mandateData?: MandateData;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type RevolutPayParams = {\n paymentMethodType: 'RevolutPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n mandateData?: MandateData;\n };\n};\n"],"mappings":"kFAsEYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
1
+ {"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address, BillingDetails } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nimport type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type { BankAcccountHolderType, BankAcccountType } from './Token';\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: CaptureMethod;\n confirmationMethod: CaptureMethod;\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type CaptureMethod = 'Automatic' | 'Manual';\n\nexport type ConfirmParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams\n | RevolutPayParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n\nexport type MandateData = {\n customerAcceptance: {\n online: {\n ipAddress: string;\n userAgent: string;\n };\n };\n};\n\ntype MetaData = {\n [key: string]: string;\n};\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: {\n testOfflineBank?: boolean;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n paymentMethodData?: {\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: BillingDetails;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** 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. */\n shippingDetails?: BillingDetails;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\nexport type RevolutPayParams = {\n paymentMethodType: 'RevolutPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n mandateData?: MandateData;\n metadata?: MetaData;\n };\n};\n"],"mappings":"kFAsEYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** 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. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n threeDSecureUsage?: ThreeDSecureUsage;\n}\n\nexport interface ThreeDSecureUsage {\n isSupported?: boolean;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\nimport type { FinancialConnectionsEvent } from './FinancialConnections';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** 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. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n threeDSecureUsage?: ThreeDSecureUsage;\n}\n\nexport interface ThreeDSecureUsage {\n isSupported?: boolean;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */\n onEvent?: (event: FinancialConnectionsEvent) => void;\n};\n\nexport type CollectBankAccountTokenParams = {\n /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */\n onEvent?: (event: FinancialConnectionsEvent) => void;\n};\n"],"mappings":""}