@stripe/stripe-react-native 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -5
- package/README.md +2 -2
- package/android/build.gradle +1 -2
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +6 -3
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +22 -7
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +7 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/ios/ApplePayUtils.swift +1 -1
- package/ios/CardFieldView.swift +3 -3
- package/ios/FinancialConnections.swift +23 -22
- package/ios/Mappers.swift +10 -2
- package/ios/PaymentMethodFactory.swift +6 -7
- package/ios/PaymentSheetAppearance.swift +5 -5
- package/ios/StripeSdk.m +5 -0
- package/ios/StripeSdk.swift +68 -26
- package/jest/mock.js +2 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +1 -0
- package/lib/typescript/src/functions.d.ts +6 -0
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts +6 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +6 -0
- package/lib/typescript/src/types/FinancialConnections.d.ts +2 -2
- package/lib/typescript/src/types/PaymentMethod.d.ts +2 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -0
- package/package.json +1 -1
- package/src/NativeStripeSdk.tsx +1 -0
- package/src/functions.ts +9 -0
- package/src/hooks/usePaymentSheet.tsx +14 -0
- package/src/hooks/useStripe.tsx +11 -0
- package/src/types/FinancialConnections.ts +4 -4
- package/src/types/PaymentMethod.ts +2 -0
- package/src/types/PaymentSheet.ts +19 -0
- package/stripe-react-native.podspec +6 -2
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -18
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -22
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts"],"mappings":"sWAmCA,4BACA,mCACA,2EACA,uCAiCO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,SACCC,CAAAA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AAmC,CAAE3B,oCA5BhC,CAAP,CA8BD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\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 _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\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 _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 =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\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 _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\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 return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer"],"mappings":"sWAmCA,4BACA,mCACA,2EACA,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,kBArBd,CAsBL6B,4BAA4B,CAAE5B,6BAtBzB,CAuBL6B,0BAA0B,CAAE5B,2BAvBvB,CAwBL6B,6BAA6B,CAAE5B,8BAxB1B,CAyBL6B,2BAA2B,CAAE5B,4BAzBxB,CA0BL6B,kBAAkB,CAAE5B,mBA1Bf,CA2BL6B,uBAAuB,CAAE5B,wBA3BpB,CA4BL6B,mCAAmC,CAAE5B,oCA5BhC,CAkCL6B,yBAAyB,CAAE5B,0BAlCtB,CAAP,CAoCD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\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 _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\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 _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 =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\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 _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\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 return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\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 };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FinancialConnections.ts"],"names":["FinancialConnectionsSheetError"],"mappings":"0GA0HYA,CAAAA,8B,iFAAAA,8B,EAAAA,8B,oBAAAA,8B,2BAAAA,8B,0CAAAA,8B","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 | '
|
|
1
|
+
{"version":3,"sources":["FinancialConnections.ts"],"names":["FinancialConnectionsSheetError"],"mappings":"0GA0HYA,CAAAA,8B,iFAAAA,8B,EAAAA,8B,oBAAAA,8B,2BAAAA,8B,0CAAAA,8B","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,
|
|
1
|
+
{"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCA8GA,GAAQA,CAAAA,SAAR,CAAsBC,0BAAtB,CAAQD,SAAR,C,aAEeA,S","sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n presentPaymentSheet(): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
|
package/lib/module/functions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openApplePaySetup=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.createTokenForCVCUpdate=exports.createToken=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.initPaymentSheet(params),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.presentPaymentSheet(),paymentOption=_yield$NativeStripeSd10.paymentOption,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var isGooglePaySupported=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref22.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref23.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref24.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd14.error,paymentMethod=_yield$NativeStripeSd14.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref25.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref26.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref28=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref28.paymentIntent,error=_ref28.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref27.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref29=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref30=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref30.setupIntent,error=_ref30.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref29.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd16.session,token=_yield$NativeStripeSd16.token,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref31.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd17.session,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref32.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd18.canAddCard,details=_yield$NativeStripeSd18.details,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref33.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd19=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd19.isInWallet,token=_yield$NativeStripeSd19.token,error=_yield$NativeStripeSd19.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref34.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openApplePaySetup=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.createTokenForCVCUpdate=exports.createToken=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.initPaymentSheet(params),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.presentPaymentSheet(),paymentOption=_yield$NativeStripeSd10.paymentOption,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var resetPaymentSheetCustomer=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(){return yield _NativeStripeSdk.default.resetPaymentSheetCustomer();});return function resetPaymentSheetCustomer(){return _ref22.apply(this,arguments);};}();exports.resetPaymentSheetCustomer=resetPaymentSheetCustomer;var isGooglePaySupported=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref23.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref24.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref25.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd14.error,paymentMethod=_yield$NativeStripeSd14.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref26.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref27.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref28=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref29=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref29.paymentIntent,error=_ref29.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref28.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref31=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref31.setupIntent,error=_ref31.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref30.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd16.session,token=_yield$NativeStripeSd16.token,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref32.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd17.session,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref33.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd18.canAddCard,details=_yield$NativeStripeSd18.details,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref34.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd19=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd19.isInWallet,token=_yield$NativeStripeSd19.token,error=_yield$NativeStripeSd19.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref35.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;
|
|
2
2
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants"],"mappings":"+lCAAA,kCACA,sCACA,0EACA,8BAoCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAAG,UACjCC,MADiC,CAGM,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,GAAI,CACF,+BAAuCC,0BAAgBH,mBAAhB,CACrCC,MADqC,CAErCC,OAFqC,CAAvC,CAAQE,aAAR,uBAAQA,aAAR,CAAuBC,KAAvB,uBAAuBA,KAAvB,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLD,aAAa,CAAEA,aADV,CAAP,CAGD,CAAC,MAAOC,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CAtB+B,iBAAnBL,CAAAA,mBAAmB,4CAAzB,C,gDAwBA,GAAMM,CAAAA,WAAW,qDAAG,UACzBL,MADyB,CAEM,qBAC/B,GACEA,MAAM,CAACM,IAAP,GAAgB,aAAhB,EACA,kBAAAN,MAAM,CAACO,OAAP,+BAAgBC,WAAhB,MAAkC,IADlC,EAEA,CAACR,MAAM,CAACS,aAHV,CAIE,CACA,MAAO,CACLL,KAAK,CAAEM,4BADF,CAAP,CAGD,CAED,GAAI,CACF,gCAA+BR,0BAAgBG,WAAhB,CAA4BL,MAA5B,CAA/B,CAAQW,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CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLyD,UAAU,CAAEA,UADP,CAELC,OAAO,CAAEA,OAFJ,CAAP,CAID,CAAC,MAAO1D,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CArB8B,iBAAlBwD,CAAAA,kBAAkB,gDAAxB,C,8CAuBA,GAAMG,CAAAA,cAAc,sDAAG,UAAO/D,MAAP,CAEO,CACnC,GAAI,CACF,iCAA2CE,0BAAgB6D,cAAhB,CACzC/D,MADyC,CAA3C,CAAQgE,UAAR,yBAAQA,UAAR,CAAoBrD,KAApB,yBAAoBA,KAApB,CAA2BP,KAA3B,yBAA2BA,KAA3B,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACL4D,UAAU,CAAEA,UADP,CAELrD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAd2D,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAG/D,yBAAgBgE,YAAhB,EAAlB,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\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\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\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\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\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\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\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\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\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\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 openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\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\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\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"]}
|
|
1
|
+
{"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants"],"mappings":"ioCAAA,kCACA,sCACA,0EACA,8BAoCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAA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AhB,CACzChE,MADyC,CAA3C,CAAQiE,UAAR,yBAAQA,UAAR,CAAoBtD,KAApB,yBAAoBA,KAApB,CAA2BP,KAA3B,yBAA2BA,KAA3B,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACL6D,UAAU,CAAEA,UADP,CAELtD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAd4D,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAGhE,yBAAgBiE,YAAhB,EAAlB,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\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\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\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\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\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\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\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\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 isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\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 openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\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\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\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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePaymentSheet=usePaymentSheet;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 usePaymentSheet(){var _useStripe=(0,_useStripe2.useStripe)(),initPaymentSheetNative=_useStripe.initPaymentSheet,presentPaymentSheetNative=_useStripe.presentPaymentSheet,confirmPaymentSheetPaymentNative=_useStripe.confirmPaymentSheetPayment;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var initPaymentSheet=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield initPaymentSheetNative(params);setLoading(false);return result;});return function initPaymentSheet(_x){return _ref.apply(this,arguments);};}();var presentPaymentSheet=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield presentPaymentSheetNative();setLoading(false);return result;});return function presentPaymentSheet(){return _ref2.apply(this,arguments);};}();var confirmPaymentSheetPayment=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield confirmPaymentSheetPaymentNative();setLoading(false);return result;});return function confirmPaymentSheetPayment(){return _ref3.apply(this,arguments);};}();return{loading:loading,initPaymentSheet:initPaymentSheet,presentPaymentSheet:presentPaymentSheet,confirmPaymentSheetPayment:confirmPaymentSheetPayment};}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePaymentSheet=usePaymentSheet;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 usePaymentSheet(){var _useStripe=(0,_useStripe2.useStripe)(),initPaymentSheetNative=_useStripe.initPaymentSheet,presentPaymentSheetNative=_useStripe.presentPaymentSheet,confirmPaymentSheetPaymentNative=_useStripe.confirmPaymentSheetPayment,resetPaymentSheetCustomerNative=_useStripe.resetPaymentSheetCustomer;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var initPaymentSheet=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield initPaymentSheetNative(params);setLoading(false);return result;});return function initPaymentSheet(_x){return _ref.apply(this,arguments);};}();var presentPaymentSheet=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield presentPaymentSheetNative();setLoading(false);return result;});return function presentPaymentSheet(){return _ref2.apply(this,arguments);};}();var confirmPaymentSheetPayment=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield confirmPaymentSheetPaymentNative();setLoading(false);return result;});return function confirmPaymentSheetPayment(){return _ref3.apply(this,arguments);};}();var resetPaymentSheetCustomer=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield resetPaymentSheetCustomerNative();setLoading(false);return result;});return function resetPaymentSheetCustomer(){return _ref4.apply(this,arguments);};}();return{loading:loading,initPaymentSheet:initPaymentSheet,presentPaymentSheet:presentPaymentSheet,confirmPaymentSheetPayment:confirmPaymentSheetPayment,resetPaymentSheetCustomer:resetPaymentSheetCustomer};}
|
|
2
2
|
//# sourceMappingURL=usePaymentSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePaymentSheet.tsx"],"names":["usePaymentSheet","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","loading","setLoading","params","result"],"mappings":"kXACA,4BACA,uCAKO,QAASA,CAAAA,eAAT,EAA2B,CAChC,
|
|
1
|
+
{"version":3,"sources":["usePaymentSheet.tsx"],"names":["usePaymentSheet","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","resetPaymentSheetCustomerNative","resetPaymentSheetCustomer","loading","setLoading","params","result"],"mappings":"kXACA,4BACA,uCAKO,QAASA,CAAAA,eAAT,EAA2B,CAChC,eAKI,2BALJ,CACoBC,sBADpB,YACEC,gBADF,CAEuBC,yBAFvB,YAEEC,mBAFF,CAG8BC,gCAH9B,YAGEC,0BAHF,CAI6BC,+BAJ7B,YAIEC,yBAJF,CAMA,cAA8B,oBAAS,KAAT,CAA9B,qDAAOC,OAAP,eAAgBC,UAAhB,eAEA,GAAMR,CAAAA,gBAAgB,oDAAG,UAAOS,MAAP,CAA4C,CACnED,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASX,CAAAA,sBAAsB,CAACU,MAAD,CAA3C,CACAD,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CALqB,iBAAhBV,CAAAA,gBAAgB,4CAAtB,CAOA,GAAME,CAAAA,mBAAmB,qDAAG,WAAY,CACtCM,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAAST,CAAAA,yBAAyB,EAA9C,CACAO,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CALwB,iBAAnBR,CAAAA,mBAAmB,2CAAzB,CAOA,GAAME,CAAAA,0BAA0B,qDAAG,WAAY,CAC7CI,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASP,CAAAA,gCAAgC,EAArD,CACAK,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CAL+B,iBAA1BN,CAAAA,0BAA0B,2CAAhC,CAOA,GAAME,CAAAA,yBAAyB,qDAAG,WAAY,CAC5CE,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASL,CAAAA,+BAA+B,EAApD,CACAG,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CAL8B,iBAAzBJ,CAAAA,yBAAyB,2CAA/B,CAOA,MAAO,CACLC,OAAO,CAAPA,OADK,CAELP,gBAAgB,CAAhBA,gBAFK,CAGLE,mBAAmB,CAAnBA,mBAHK,CAILE,0BAA0B,CAA1BA,0BAJK,CAULE,yBAAyB,CAAzBA,yBAVK,CAAP,CAYD","sourcesContent":["import type { PaymentSheet } from '../types';\nimport { useState } from 'react';\nimport { useStripe } from './useStripe';\n\n/**\n * usePaymentSheet hook\n */\nexport function usePaymentSheet() {\n const {\n initPaymentSheet: initPaymentSheetNative,\n presentPaymentSheet: presentPaymentSheetNative,\n confirmPaymentSheetPayment: confirmPaymentSheetPaymentNative,\n resetPaymentSheetCustomer: resetPaymentSheetCustomerNative,\n } = useStripe();\n const [loading, setLoading] = useState(false);\n\n const initPaymentSheet = async (params: PaymentSheet.SetupParams) => {\n setLoading(true);\n const result = await initPaymentSheetNative(params);\n setLoading(false);\n return result;\n };\n\n const presentPaymentSheet = async () => {\n setLoading(true);\n const result = await presentPaymentSheetNative();\n setLoading(false);\n return result;\n };\n\n const confirmPaymentSheetPayment = async () => {\n setLoading(true);\n const result = await confirmPaymentSheetPaymentNative();\n setLoading(false);\n return result;\n };\n\n const resetPaymentSheetCustomer = async () => {\n setLoading(true);\n const result = await resetPaymentSheetCustomerNative();\n setLoading(false);\n return result;\n };\n\n return {\n loading,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\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,\n };\n}\n"]}
|
|
@@ -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 _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);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 _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(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(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts};}
|
|
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 _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);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 _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(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(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer};}
|
|
2
2
|
//# sourceMappingURL=useStripe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts"],"mappings":"sWAmCA,4BACA,mCACA,2EACA,uCAiCO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,SACCC,CAAAA,oBADD,6IACd,WAAsC,CACpC,GAAMC,CAAAA,WAAW,CACfC,sBAAgBC,0BAAgBL,mBAAhB,EAAhB,CADF,CAEAC,oBAAoB,CAACE,WAAD,CAApB,CACD,CALa,sDAOdD,oBAAoB,GACrB,CARD,CAQG,EARH,EAUA,GAAMI,CAAAA,oBAAoB,CAAG,0EAC3B,UACEC,IADF,CAGyC,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,MAAO,mCAAoBD,IAApB,CAA0BC,OAA1B,CAAP,CACD,CAN0B,8DAO3B,EAP2B,CAA7B,CAUA,GAAMC,CAAAA,YAAY,CAAG,2EACnB,UAAOC,MAAP,CAAkE,CAChE,MAAO,2BAAYA,MAAZ,CAAP,CACD,CAHkB,gEAInB,EAJmB,CAArB,CAOA,GAAMC,CAAAA,sBAAsB,CAAG,2EAC7B,UAAOC,YAAP,CAAsE,CACpE,MAAO,qCAAsBA,YAAtB,CAAP,CACD,CAH4B,gEAI7B,EAJ6B,CAA/B,CAOA,GAAMC,CAAAA,oBAAoB,CAAG,2EAC3B,UAAOD,YAAP,CAAoE,CAClE,MAAO,mCAAoBA,YAApB,CAAP,CACD,CAH0B,gEAI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2BAbvB,CAcL2B,mBAAmB,CAAE5B,oBAdhB,CAeL6B,gBAAgB,CAAE9B,iBAfb,CAgBL+B,WAAW,CAAEhD,YAhBR,CAiBLiD,oBAAoB,CAAE3B,qBAjBjB,CAkBL4B,aAAa,CAAE3B,cAlBV,CAmBL4B,gBAAgB,CAAE3B,iBAnBb,CAoBL4B,4BAA4B,CAAE3B,6BApBzB,CAqBL4B,iBAAiB,CAAE3B,kBArBd,CAsBL4B,4BAA4B,CAAE3B,6BAtBzB,CAuBL4B,0BAA0B,CAAE3B,2BAvBvB,CAwBL4B,6BAA6B,CAAE3B,8BAxB1B,CAyBL4B,2BAA2B,CAAE3B,4BAzBxB,CA0BL4B,kBAAkB,CAAE3B,mBA1Bf,CA2BL4B,uBAAuB,CAAE3B,wBA3BpB,CA4BL4B,mCAAmC,CAAE3B,oCA5BhC,CAAP,CA8BD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\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 _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\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 _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 =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\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 _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\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 return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer"],"mappings":"sWAmCA,4BACA,mCACA,2EACA,uCAkCO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,SACCC,CAAAA,oBADD,6IACd,WAAsC,CACpC,GAAMC,CAAAA,WAAW,CACfC,sBAAgBC,0BAAgBL,mBAAhB,EAAhB,CADF,CAEAC,oBAAoB,CAACE,WAAD,CAApB,CACD,CALa,sDAOdD,oBAAoB,GACrB,CARD,CAQG,EARH,EAUA,GAAMI,CAAAA,oBAAoB,CAAG,0EAC3B,UACEC,IADF,CAGyC,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,MAAO,mCAAoBD,IAApB,CAA0BC,OAA1B,CAAP,CACD,CAN0B,8DAO3B,EAP2B,CAA7B,CAUA,GAAMC,CAAAA,YAAY,CAAG,2EACnB,UAAOC,MAAP,CAAkE,CAChE,MAAO,2BAAYA,MAAZ,CAAP,CACD,CAHkB,gEAInB,EAJmB,CAArB,CAOA,GAAMC,CAAAA,sBAAsB,CAAG,2EAC7B,UAAOC,YAAP,CAAsE,CACpE,MAAO,qCAAsBA,YAAtB,CAAP,CACD,CAH4B,gEAI7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mB,CAAEA,mBANhB,CAOLiD,eAAe,CAAEjC,gBAPZ,CAQLkC,sBAAsB,CAAE9B,uBARnB,CASL+B,kBAAkB,CAAE5B,mBATf,CAUL6B,uBAAuB,CAAE5B,wBAVpB,CAWL6B,0BAA0B,CAAEpC,2BAXvB,CAYLqC,iBAAiB,CAAEzB,kBAZd,CAaL0B,0BAA0B,CAAE3B,2BAbvB,CAcL4B,mBAAmB,CAAE7B,oBAdhB,CAeL8B,gBAAgB,CAAE/B,iBAfb,CAgBLgC,WAAW,CAAEjD,YAhBR,CAiBLkD,oBAAoB,CAAE5B,qBAjBjB,CAkBL6B,aAAa,CAAE5B,cAlBV,CAmBL6B,gBAAgB,CAAE5B,iBAnBb,CAoBL6B,4BAA4B,CAAE5B,6BApBzB,CAqBL6B,iBAAiB,CAAE5B,kBArBd,CAsBL6B,4BAA4B,CAAE5B,6BAtBzB,CAuBL6B,0BAA0B,CAAE5B,2BAvBvB,CAwBL6B,6BAA6B,CAAE5B,8BAxB1B,CAyBL6B,2BAA2B,CAAE5B,4BAzBxB,CA0BL6B,kBAAkB,CAAE5B,mBA1Bf,CA2BL6B,uBAAuB,CAAE5B,wBA3BpB,CA4BL6B,mCAAmC,CAAE5B,oCA5BhC,CAkCL6B,yBAAyB,CAAE5B,0BAlCtB,CAAP,CAoCD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\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 _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\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 _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 =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\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 _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\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 return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\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 };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FinancialConnections.ts"],"names":["FinancialConnectionsSheetError"],"mappings":"0GA0HYA,CAAAA,8B,iFAAAA,8B,EAAAA,8B,oBAAAA,8B,2BAAAA,8B,0CAAAA,8B","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 | '
|
|
1
|
+
{"version":3,"sources":["FinancialConnections.ts"],"names":["FinancialConnectionsSheetError"],"mappings":"0GA0HYA,CAAAA,8B,iFAAAA,8B,EAAAA,8B,oBAAAA,8B,2BAAAA,8B,0CAAAA,8B","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"]}
|
|
@@ -39,6 +39,7 @@ declare type NativeStripeSdkType = {
|
|
|
39
39
|
}): Promise<IsCardInWalletResult>;
|
|
40
40
|
collectBankAccountToken(clientSecret: string): Promise<FinancialConnections.TokenResult>;
|
|
41
41
|
collectFinancialConnectionsAccounts(clientSecret: string): Promise<FinancialConnections.SessionResult>;
|
|
42
|
+
resetPaymentSheetCustomer(): Promise<null>;
|
|
42
43
|
};
|
|
43
44
|
declare const _default: NativeStripeSdkType;
|
|
44
45
|
export default _default;
|
|
@@ -38,6 +38,12 @@ export declare const verifyMicrodepositsForSetup: (clientSecret: string, params:
|
|
|
38
38
|
export declare const initPaymentSheet: (params: PaymentSheet.SetupParams) => Promise<InitPaymentSheetResult>;
|
|
39
39
|
export declare const presentPaymentSheet: () => Promise<PresentPaymentSheetResult>;
|
|
40
40
|
export declare const confirmPaymentSheetPayment: () => Promise<ConfirmPaymentSheetPaymentResult>;
|
|
41
|
+
/**
|
|
42
|
+
* You must call this method when the user logs out from your app. This will ensure that
|
|
43
|
+
* any persisted authentication state in the PaymentSheet, such as authentication cookies,
|
|
44
|
+
* is also cleared during logout.
|
|
45
|
+
*/
|
|
46
|
+
export declare const resetPaymentSheetCustomer: () => Promise<null>;
|
|
41
47
|
export declare const isGooglePaySupported: (params?: GooglePay.IsSupportedParams | undefined) => Promise<boolean>;
|
|
42
48
|
export declare const initGooglePay: (params: GooglePay.InitParams) => Promise<GooglePayInitResult>;
|
|
43
49
|
export declare const presentGooglePay: (params: GooglePay.PresentParams) => Promise<PayWithGooglePayResult>;
|