@stripe/stripe-react-native 0.13.1 → 0.14.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 +27 -11
- package/android/.DS_Store +0 -0
- 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 +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/.gitignore +3 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/modules/android.iml +18 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +52 -0
- package/android/build.gradle +11 -0
- package/android/local.properties +8 -0
- package/android/src/.DS_Store +0 -0
- package/android/src/androidTest/.DS_Store +0 -0
- package/android/src/androidTest/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxyTest.kt +35 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/Mappers.kt +16 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +6 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +41 -2
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +0 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +19 -7
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +45 -38
- package/ios/.DS_Store +0 -0
- package/ios/CardFieldView.swift +11 -8
- package/ios/StripeSdk.m +5 -0
- package/ios/StripeSdk.swift +21 -10
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +52 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +22 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
- package/ios/Tests/PushProvisioningTests.swift +49 -0
- package/ios/pushprovisioning/AddToWalletButtonView.swift +1 -5
- package/ios/pushprovisioning/PushProvisioningUtils.swift +64 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/ApplePayButton.js +1 -1
- package/lib/commonjs/components/ApplePayButton.js.map +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/components/CardField.js +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/components/GooglePayButton.js +1 -1
- package/lib/commonjs/components/GooglePayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.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/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/ApplePayButton.js +1 -1
- package/lib/module/components/ApplePayButton.js.map +1 -1
- package/lib/module/components/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/GooglePayButton.js +1 -1
- package/lib/module/components/GooglePayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.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/index.js.map +1 -1
- package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +1 -2
- package/lib/typescript/src/NativeStripeSdk.d.ts +2 -1
- package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
- package/lib/typescript/src/functions.d.ts +2 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +2 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +2 -1
- package/lib/typescript/src/types/index.d.ts +20 -0
- package/package.json +6 -4
- package/src/NativeStripeSdk.tsx +5 -0
- package/src/components/AddToWalletButton.tsx +1 -1
- package/src/functions.ts +25 -0
- package/src/hooks/useStripe.tsx +13 -0
- package/src/types/PaymentSheet.ts +2 -1
- package/src/types/index.ts +27 -0
- package/stripe-react-native.podspec +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isiOS","NativeStripeSdk","isSupported","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup"],"mappings":"mVA+BA,4BACA,mCACA,2EACA,uCA8BO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,CACd,QAAeC,CAAAA,oBAAf,8JAEIC,cAFJ,2FAEoBC,yBAAgBJ,mBAAhB,EAFpB,0CACQK,WADR,aAGEJ,oBAAoB,CAACI,WAAD,CAApB,CAHF,qEAMAH,oBAAoB,GACrB,CARD,CAQG,EARH,EAUA,GAAMI,CAAAA,oBAAoB,CAAG,uBAC3B,iBACEC,IADF,oJAEEC,OAFF,kDAEyC,EAFzC,kCAIS,mCAAoBD,IAApB,CAA0BC,OAA1B,CAJT,wEAD2B,CAO3B,EAP2B,CAA7B,CAUA,GAAMC,CAAAA,YAAY,CAAG,uBACnB,kBAAOC,MAAP,yJACS,2BAAYA,MAAZ,CADT,wEADmB,CAIn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,CAAG,uBACrC,mBACEzB,YADF,CAEEF,MAFF,8JAIS,6CAA8BE,YAA9B,CAA4CF,MAA5C,CAJT,yEADqC,CAOrC,EAPqC,CAAvC,CAUA,GAAM4B,CAAAA,4BAA4B,CAAG,uBACnC,mBACE1B,YADF,CAEEF,MAFF,8JAIS,2CAA4BE,YAA5B,CAA0CF,MAA1C,CAJT,yEADmC,CAOnC,EAPmC,CAArC,CAUA,MAAO,CACL6B,qBAAqB,CAAE5B,sBADlB,CAEL6B,mBAAmB,CAAE3B,oBAFhB,CAGL4B,cAAc,CAAE3B,eAHX,CAIL4B,mBAAmB,CAAEpC,oBAJhB,CAKLqC,gBAAgB,CAAEtB,iBALb,CAMLrB,mBAAmB,CAAEA,mBANhB,CAOL4C,eAAe,CAAE5B,gBAPZ,CAQL6B,sBAAsB,CAAEzB,uBARnB,CASL0B,kBAAkB,CAAExB,mBATf,CAULyB,uBAAuB,CAAExB,wBAVpB,CAWLyB,0BAA0B,CAAE/B,2BAXvB,CAYLgC,iBAAiB,CAAErB,kBAZd,CAaLsB,0BAA0B,CAAEvB,2BAbvB,CAcLwB,mBAAmB,CAAEzB,oBAdhB,CAeL0B,gBAAgB,CAAE3B,iBAfb,CAgBL4B,WAAW,CAAE5C,YAhBR,CAiBL6C,oBAAoB,CAAExB,qBAjBjB,CAkBLyB,aAAa,CAAExB,cAlBV,CAmBLyB,gBAAgB,CAAExB,iBAnBb,CAoBLyB,4BAA4B,CAAExB,6BApBzB,CAqBLyB,iBAAiB,CAAExB,kBArBd,CAsBLyB,4BAA4B,CAAExB,6BAtBzB,CAuBLyB,0BAA0B,CAAExB,2BAvBvB,CAwBLyB,6BAA6B,CAAExB,8BAxB1B,CAyBLyB,2BAA2B,CAAExB,4BAzBxB,CAAP,CA2BD","sourcesContent":["import type {\n PaymentMethod,\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} 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} 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: PaymentMethod.ConfirmParams,\n options: PaymentMethod.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 ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret);\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 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 };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isiOS","NativeStripeSdk","isSupported","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","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"],"mappings":"mVAiCA,4BACA,mCACA,2EACA,uCA+BO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,CACd,QAAeC,CAAAA,oBAAf,8JAEIC,cAFJ,2FAEoBC,yBAAgBJ,mBAAhB,EAFpB,0CACQK,WADR,aAGEJ,oBAAoB,CAACI,WAAD,CAApB,CAHF,qEAMAH,oBAAoB,GACrB,CARD,CAQG,EARH,EAUA,GAAMI,CAAAA,oBAAoB,CAAG,uBAC3B,iBACEC,IADF,oJAEEC,OAFF,kDAEyC,EAFzC,kCAIS,mCAAoBD,IAApB,CAA0BC,OAA1B,CAJT,wEAD2B,CAO3B,EAP2B,CAA7B,CAUA,GAAMC,CAAAA,YAAY,CAAG,uBACnB,kBAAOC,MAAP,yJACS,2BAAYA,MAAZ,CADT,wEADmB,CAInB,EAJmB,CAArB,CAOA,GAAMC,CAAAA,sBAAsB,CAAG,uBAC7B,kBAAOC,YAAP,yJACS,qCAAsBA,YAAtB,CADT,wEAD6B,CAI7B,EAJ6B,CAA/B,CAOA,GAAMC,CAAAA,oBAAoB,CAAG,uBAC3B,kBAAOD,YAAP,yJACS,mCAAoBA,YAApB,CADT,wEAD2B,CAI3B,EAJ2B,CAA7B,CAOA,GAAME,CAAAA,eAAe,CAAG,uBACt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AmB,CAAG,uBAC1B,mBACE7B,MADF,8JAGS,kCAAmBA,MAAnB,CAHT,yEAD0B,CAM1B,EAN0B,CAA5B,CASA,MAAO,CACL8B,qBAAqB,CAAE7B,sBADlB,CAEL8B,mBAAmB,CAAE5B,oBAFhB,CAGL6B,cAAc,CAAE5B,eAHX,CAIL6B,mBAAmB,CAAErC,oBAJhB,CAKLsC,gBAAgB,CAAEvB,iBALb,CAMLrB,mBAAmB,CAAEA,mBANhB,CAOL6C,eAAe,CAAE7B,gBAPZ,CAQL8B,sBAAsB,CAAE1B,uBARnB,CASL2B,kBAAkB,CAAEzB,mBATf,CAUL0B,uBAAuB,CAAEzB,wBAVpB,CAWL0B,0BAA0B,CAAEhC,2BAXvB,CAYLiC,iBAAiB,CAAEtB,kBAZd,CAaLuB,0BAA0B,CAAExB,2BAbvB,CAcLyB,mBAAmB,CAAE1B,oBAdhB,CAeL2B,gBAAgB,CAAE5B,iBAfb,CAgBL6B,WAAW,CAAE7C,YAhBR,CAiBL8C,oBAAoB,CAAEzB,qBAjBjB,CAkBL0B,aAAa,CAAEzB,cAlBV,CAmBL0B,gBAAgB,CAAEzB,iBAnBb,CAoBL0B,4BAA4B,CAAEzB,6BApBzB,CAqBL0B,iBAAiB,CAAEzB,kBArBd,CAsBL0B,4BAA4B,CAAEzB,6BAtBzB,CAuBL0B,0BAA0B,CAAEzB,2BAvBvB,CAwBL0B,6BAA6B,CAAEzB,8BAxB1B,CAyBL0B,2BAA2B,CAAEzB,4BAzBxB,CA0BL0B,kBAAkB,CAAEzB,mBA1Bf,CAAP,CA4BD","sourcesContent":["import type {\n PaymentMethod,\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} 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} 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: PaymentMethod.ConfirmParams,\n options: PaymentMethod.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 ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret);\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 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 };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"m0BAeA,4D,0BACA,sE,oCACA,sE,oCACA,oE,kCACA,kE,gCACA,oE,kCACA,8D,4BACA,qG,wDACA,uG,0DACA,mF,sCACA,+E,kCACA,sD,oBAiBA,iVACA,gC","sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n GooglePay,\n ApplePayButtonComponent,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n};\n\nexport * from './Errors';\nexport { Address, BillingDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult =\n | {\n paymentOption: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type GooglePayCardToken = {\n id: string;\n cardLastFour: string;\n network: number;\n serviceProvider: number;\n issuer: string;\n status:\n | 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION'\n | 'TOKEN_STATE_PENDING'\n | 'TOKEN_STATE_SUSPENDED'\n | 'TOKEN_STATE_ACTIVE'\n | 'TOKEN_STATE_FELICA_PENDING_PROVISIONING'\n | 'TOKEN_STATE_UNTOKENIZED';\n};\n\nexport type IsCardInWalletResult =\n | {\n isInWallet: boolean;\n token?: GooglePayCardToken;\n error?: undefined;\n }\n | {\n isInWallet?: undefined;\n token?: undefined;\n error: StripeError<GooglePayError>;\n };\n"]}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"m0BAeA,4D,0BACA,sE,oCACA,sE,oCACA,oE,kCACA,kE,gCACA,oE,kCACA,8D,4BACA,qG,wDACA,uG,0DACA,mF,sCACA,+E,kCACA,sD,oBAiBA,iVACA,gC","sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n GooglePay,\n ApplePayButtonComponent,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n};\n\nexport * from './Errors';\nexport { Address, BillingDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult =\n | {\n paymentOption: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type GooglePayCardToken = {\n id: string;\n cardLastFour: string;\n network: number;\n serviceProvider: number;\n issuer: string;\n status:\n | 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION'\n | 'TOKEN_STATE_PENDING'\n | 'TOKEN_STATE_SUSPENDED'\n | 'TOKEN_STATE_ACTIVE'\n | 'TOKEN_STATE_FELICA_PENDING_PROVISIONING'\n | 'TOKEN_STATE_UNTOKENIZED';\n};\n\nexport type IsCardInWalletResult =\n | {\n isInWallet: boolean;\n token?: GooglePayCardToken;\n error?: undefined;\n }\n | {\n isInWallet?: undefined;\n token?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type CanAddCardToWalletParams = {\n /** The `primary_account_identifier` value from the issued card. Can be an empty string. */\n primaryAccountIdentifier: string | null;\n /** Last 4 digits of the card number. */\n cardLastFour: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n};\n\nexport type CanAddCardToWalletResult =\n | {\n canAddCard: boolean;\n details?: {\n token?: GooglePayCardToken;\n status?:\n | 'MISSING_CONFIGURATION'\n | 'UNSUPPORTED_DEVICE'\n | 'CARD_ALREADY_EXISTS';\n };\n error?: undefined;\n }\n | {\n canAddCard?: undefined;\n details?: undefined;\n error: StripeError<GooglePayError>;\n };\n"]}
|
|
@@ -5,8 +5,7 @@ declare class BasicPaymentScreen {
|
|
|
5
5
|
iban?: string;
|
|
6
6
|
buttonText?: string;
|
|
7
7
|
}): void;
|
|
8
|
-
authorize({
|
|
9
|
-
elementType?: string | undefined;
|
|
8
|
+
authorize({ pause }?: {
|
|
10
9
|
pause?: number | undefined;
|
|
11
10
|
}): void;
|
|
12
11
|
checkStatus(status?: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentMethod, ApplePay, PaymentSheet, SetupIntent, InitialiseParams, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, ApplePayResult, CreateTokenResult, GooglePayInitResult, PayWithGooglePayResult, CreateGooglePayPaymentMethodResult, GooglePay, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, IsCardInWalletResult } from './types';
|
|
1
|
+
import type { PaymentMethod, ApplePay, PaymentSheet, SetupIntent, InitialiseParams, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, ApplePayResult, CreateTokenResult, GooglePayInitResult, PayWithGooglePayResult, CreateGooglePayPaymentMethodResult, GooglePay, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult } from './types';
|
|
2
2
|
declare type NativeStripeSdkType = {
|
|
3
3
|
initialise(params: InitialiseParams): Promise<void>;
|
|
4
4
|
createPaymentMethod(params: PaymentMethod.CreateParams, options: PaymentMethod.CreateOptions): Promise<CreatePaymentMethodResult>;
|
|
@@ -33,6 +33,7 @@ declare type NativeStripeSdkType = {
|
|
|
33
33
|
ISSUING: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
+
canAddCardToWallet(params: CanAddCardToWalletParams): Promise<CanAddCardToWalletResult>;
|
|
36
37
|
isCardInWallet(params: {
|
|
37
38
|
cardLastFour: string;
|
|
38
39
|
}): Promise<IsCardInWalletResult>;
|
|
@@ -10,7 +10,7 @@ export interface Props extends AccessibilityProps {
|
|
|
10
10
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
11
11
|
androidAssetSource: ImageSourcePropType;
|
|
12
12
|
testID?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
14
14
|
testEnv?: boolean;
|
|
15
15
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
16
16
|
cardDetails: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplePay, ApplePayError, ApplePayResult, ConfirmPaymentResult, ConfirmPaymentSheetPaymentResult, SetupIntent, PaymentIntent, ConfirmSetupIntentResult, CreatePaymentMethodResult, CreateTokenForCVCUpdateResult, CreateTokenResult, GooglePayInitResult, HandleNextActionResult, InitPaymentSheetResult, PaymentMethod, PaymentSheet, PayWithGooglePayResult, PresentPaymentSheetResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, StripeError, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForPaymentResult, CollectBankAccountForSetupResult, IsCardInWalletResult } from './types';
|
|
1
|
+
import { ApplePay, ApplePayError, ApplePayResult, ConfirmPaymentResult, ConfirmPaymentSheetPaymentResult, SetupIntent, PaymentIntent, ConfirmSetupIntentResult, CreatePaymentMethodResult, CreateTokenForCVCUpdateResult, CreateTokenResult, GooglePayInitResult, HandleNextActionResult, InitPaymentSheetResult, PaymentMethod, PaymentSheet, PayWithGooglePayResult, PresentPaymentSheetResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, StripeError, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForPaymentResult, CollectBankAccountForSetupResult, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult } from './types';
|
|
2
2
|
export declare const createPaymentMethod: (params: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>;
|
|
3
3
|
export declare const createToken: (params: Token.CreateParams) => Promise<CreateTokenResult>;
|
|
4
4
|
export declare const retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>;
|
|
@@ -31,6 +31,7 @@ export declare const createGooglePayPaymentMethod: (params: GooglePay.CreatePaym
|
|
|
31
31
|
export declare const openApplePaySetup: () => Promise<OpenApplePaySetupResult>;
|
|
32
32
|
export declare const collectBankAccountForPayment: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForPaymentResult>;
|
|
33
33
|
export declare const collectBankAccountForSetup: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForSetupResult>;
|
|
34
|
+
export declare const canAddCardToWallet: (params: CanAddCardToWalletParams) => Promise<CanAddCardToWalletResult>;
|
|
34
35
|
export declare const isCardInWallet: (params: {
|
|
35
36
|
cardLastFour: string;
|
|
36
37
|
}) => Promise<IsCardInWalletResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentMethod, ApplePay, PaymentSheet, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, ApplePayResult, ApplePayError, StripeError, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, SetupIntent, CreateTokenResult, PayWithGooglePayResult, GooglePayInitResult, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForSetupResult, CollectBankAccountForPaymentResult } from '../types';
|
|
1
|
+
import type { PaymentMethod, ApplePay, PaymentSheet, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, ApplePayResult, ApplePayError, StripeError, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, SetupIntent, CreateTokenResult, PayWithGooglePayResult, GooglePayInitResult, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForSetupResult, CollectBankAccountForPaymentResult, CanAddCardToWalletParams, CanAddCardToWalletResult } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* useStripe hook
|
|
4
4
|
*/
|
|
@@ -35,4 +35,5 @@ export declare function useStripe(): {
|
|
|
35
35
|
collectBankAccountForSetup: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForSetupResult>;
|
|
36
36
|
verifyMicrodepositsForPayment: (clientSecret: string, params: VerifyMicrodepositsParams) => Promise<VerifyMicrodepositsForPaymentResult>;
|
|
37
37
|
verifyMicrodepositsForSetup: (clientSecret: string, params: VerifyMicrodepositsParams) => Promise<VerifyMicrodepositsForSetupResult>;
|
|
38
|
+
canAddCardToWallet: (params: CanAddCardToWalletParams) => Promise<CanAddCardToWalletResult>;
|
|
38
39
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { BillingDetails } from './Common';
|
|
2
2
|
export declare type SetupParams = ClientSecretParams & GooglePayParams & ApplePayParams & {
|
|
3
|
+
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
|
|
4
|
+
merchantDisplayName: string;
|
|
3
5
|
customerId?: string;
|
|
4
6
|
customerEphemeralKeySecret?: string;
|
|
5
7
|
customFlow?: boolean;
|
|
6
|
-
merchantDisplayName?: string;
|
|
7
8
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
8
9
|
returnURL?: string;
|
|
9
10
|
defaultBillingDetails?: BillingDetails;
|
|
@@ -191,3 +191,23 @@ export declare type IsCardInWalletResult = {
|
|
|
191
191
|
token?: undefined;
|
|
192
192
|
error: StripeError<GooglePayError>;
|
|
193
193
|
};
|
|
194
|
+
export declare type CanAddCardToWalletParams = {
|
|
195
|
+
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
196
|
+
primaryAccountIdentifier: string | null;
|
|
197
|
+
/** Last 4 digits of the card number. */
|
|
198
|
+
cardLastFour: string;
|
|
199
|
+
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
200
|
+
testEnv?: boolean;
|
|
201
|
+
};
|
|
202
|
+
export declare type CanAddCardToWalletResult = {
|
|
203
|
+
canAddCard: boolean;
|
|
204
|
+
details?: {
|
|
205
|
+
token?: GooglePayCardToken;
|
|
206
|
+
status?: 'MISSING_CONFIGURATION' | 'UNSUPPORTED_DEVICE' | 'CARD_ALREADY_EXISTS';
|
|
207
|
+
};
|
|
208
|
+
error?: undefined;
|
|
209
|
+
} | {
|
|
210
|
+
canAddCard?: undefined;
|
|
211
|
+
details?: undefined;
|
|
212
|
+
error: StripeError<GooglePayError>;
|
|
213
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"test": "jest",
|
|
23
23
|
"typescript": "tsc --noEmit",
|
|
24
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-
|
|
24
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
|
|
25
25
|
"prepare": "bob build",
|
|
26
26
|
"release": "./scripts/publish",
|
|
27
27
|
"example": "yarn --cwd example",
|
|
@@ -31,8 +31,10 @@
|
|
|
31
31
|
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none",
|
|
32
32
|
"run-example-ios": "cd example;ENVFILE=.env.ci react-native run-ios --configuration Release --simulator \"iPhone 13 (15.2)\"",
|
|
33
33
|
"run-example-android": "cd example;ENVFILE=.env.ci react-native run-android --variant=release",
|
|
34
|
-
"test:ios": "mkdir -p .tmp/screenshots && node ./run-appium-tests.js ios",
|
|
35
|
-
"test:android": "mkdir -p .tmp/screenshots && node ./run-appium-tests.js android"
|
|
34
|
+
"test:e2e:ios": "mkdir -p .tmp/screenshots && node ./run-appium-tests.js ios",
|
|
35
|
+
"test:e2e:android": "mkdir -p .tmp/screenshots && node ./run-appium-tests.js android",
|
|
36
|
+
"test:unit:ios": "xcodebuild test -workspace example/ios/StripeSdkExample.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' -scheme UnitTests",
|
|
37
|
+
"test:unit:android": "cd example/android && ./gradlew connectedAndroidTest"
|
|
36
38
|
},
|
|
37
39
|
"keywords": [
|
|
38
40
|
"react-native",
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -25,6 +25,8 @@ import type {
|
|
|
25
25
|
Token,
|
|
26
26
|
VerifyMicrodepositsParams,
|
|
27
27
|
IsCardInWalletResult,
|
|
28
|
+
CanAddCardToWalletParams,
|
|
29
|
+
CanAddCardToWalletResult,
|
|
28
30
|
} from './types';
|
|
29
31
|
|
|
30
32
|
type NativeStripeSdkType = {
|
|
@@ -88,6 +90,9 @@ type NativeStripeSdkType = {
|
|
|
88
90
|
params: PaymentMethod.CollectBankAccountParams
|
|
89
91
|
): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;
|
|
90
92
|
getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };
|
|
93
|
+
canAddCardToWallet(
|
|
94
|
+
params: CanAddCardToWalletParams
|
|
95
|
+
): Promise<CanAddCardToWalletResult>;
|
|
91
96
|
isCardInWallet(params: {
|
|
92
97
|
cardLastFour: string;
|
|
93
98
|
}): Promise<IsCardInWalletResult>;
|
|
@@ -27,7 +27,7 @@ export interface Props extends AccessibilityProps {
|
|
|
27
27
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
28
28
|
androidAssetSource: ImageSourcePropType;
|
|
29
29
|
testID?: string;
|
|
30
|
-
/**
|
|
30
|
+
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
31
31
|
testEnv?: boolean;
|
|
32
32
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
33
33
|
cardDetails: {
|
package/src/functions.ts
CHANGED
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
CollectBankAccountForPaymentResult,
|
|
34
34
|
CollectBankAccountForSetupResult,
|
|
35
35
|
IsCardInWalletResult,
|
|
36
|
+
CanAddCardToWalletParams,
|
|
37
|
+
CanAddCardToWalletResult,
|
|
36
38
|
} from './types';
|
|
37
39
|
|
|
38
40
|
const APPLE_PAY_NOT_SUPPORTED_MESSAGE =
|
|
@@ -565,6 +567,29 @@ export const collectBankAccountForSetup = async (
|
|
|
565
567
|
}
|
|
566
568
|
};
|
|
567
569
|
|
|
570
|
+
export const canAddCardToWallet = async (
|
|
571
|
+
params: CanAddCardToWalletParams
|
|
572
|
+
): Promise<CanAddCardToWalletResult> => {
|
|
573
|
+
try {
|
|
574
|
+
const { canAddCard, details, error } =
|
|
575
|
+
await NativeStripeSdk.canAddCardToWallet(params);
|
|
576
|
+
|
|
577
|
+
if (error) {
|
|
578
|
+
return {
|
|
579
|
+
error,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
return {
|
|
583
|
+
canAddCard: canAddCard as boolean,
|
|
584
|
+
details: details,
|
|
585
|
+
};
|
|
586
|
+
} catch (error: any) {
|
|
587
|
+
return {
|
|
588
|
+
error: createError(error),
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
|
|
568
593
|
export const isCardInWallet = async (params: {
|
|
569
594
|
cardLastFour: string;
|
|
570
595
|
}): Promise<IsCardInWalletResult> => {
|
package/src/hooks/useStripe.tsx
CHANGED
|
@@ -28,6 +28,8 @@ import type {
|
|
|
28
28
|
VerifyMicrodepositsForSetupResult,
|
|
29
29
|
CollectBankAccountForSetupResult,
|
|
30
30
|
CollectBankAccountForPaymentResult,
|
|
31
|
+
CanAddCardToWalletParams,
|
|
32
|
+
CanAddCardToWalletResult,
|
|
31
33
|
} from '../types';
|
|
32
34
|
import { useCallback, useEffect, useState } from 'react';
|
|
33
35
|
import { isiOS } from '../helpers';
|
|
@@ -57,6 +59,7 @@ import {
|
|
|
57
59
|
collectBankAccountForSetup,
|
|
58
60
|
verifyMicrodepositsForPayment,
|
|
59
61
|
verifyMicrodepositsForSetup,
|
|
62
|
+
canAddCardToWallet,
|
|
60
63
|
} from '../functions';
|
|
61
64
|
|
|
62
65
|
/**
|
|
@@ -278,6 +281,15 @@ export function useStripe() {
|
|
|
278
281
|
[]
|
|
279
282
|
);
|
|
280
283
|
|
|
284
|
+
const _canAddCardToWallet = useCallback(
|
|
285
|
+
async (
|
|
286
|
+
params: CanAddCardToWalletParams
|
|
287
|
+
): Promise<CanAddCardToWalletResult> => {
|
|
288
|
+
return canAddCardToWallet(params);
|
|
289
|
+
},
|
|
290
|
+
[]
|
|
291
|
+
);
|
|
292
|
+
|
|
281
293
|
return {
|
|
282
294
|
retrievePaymentIntent: _retrievePaymentIntent,
|
|
283
295
|
retrieveSetupIntent: _retrieveSetupIntent,
|
|
@@ -304,5 +316,6 @@ export function useStripe() {
|
|
|
304
316
|
collectBankAccountForSetup: _collectBankAccountForSetup,
|
|
305
317
|
verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,
|
|
306
318
|
verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,
|
|
319
|
+
canAddCardToWallet: _canAddCardToWallet,
|
|
307
320
|
};
|
|
308
321
|
}
|
|
@@ -3,10 +3,11 @@ import type { BillingDetails } from './Common';
|
|
|
3
3
|
export type SetupParams = ClientSecretParams &
|
|
4
4
|
GooglePayParams &
|
|
5
5
|
ApplePayParams & {
|
|
6
|
+
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
|
|
7
|
+
merchantDisplayName: string;
|
|
6
8
|
customerId?: string;
|
|
7
9
|
customerEphemeralKeySecret?: string;
|
|
8
10
|
customFlow?: boolean;
|
|
9
|
-
merchantDisplayName?: string;
|
|
10
11
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
11
12
|
returnURL?: string;
|
|
12
13
|
defaultBillingDetails?: BillingDetails;
|
package/src/types/index.ts
CHANGED
|
@@ -295,3 +295,30 @@ export type IsCardInWalletResult =
|
|
|
295
295
|
token?: undefined;
|
|
296
296
|
error: StripeError<GooglePayError>;
|
|
297
297
|
};
|
|
298
|
+
|
|
299
|
+
export type CanAddCardToWalletParams = {
|
|
300
|
+
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
301
|
+
primaryAccountIdentifier: string | null;
|
|
302
|
+
/** Last 4 digits of the card number. */
|
|
303
|
+
cardLastFour: string;
|
|
304
|
+
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
305
|
+
testEnv?: boolean;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
export type CanAddCardToWalletResult =
|
|
309
|
+
| {
|
|
310
|
+
canAddCard: boolean;
|
|
311
|
+
details?: {
|
|
312
|
+
token?: GooglePayCardToken;
|
|
313
|
+
status?:
|
|
314
|
+
| 'MISSING_CONFIGURATION'
|
|
315
|
+
| 'UNSUPPORTED_DEVICE'
|
|
316
|
+
| 'CARD_ALREADY_EXISTS';
|
|
317
|
+
};
|
|
318
|
+
error?: undefined;
|
|
319
|
+
}
|
|
320
|
+
| {
|
|
321
|
+
canAddCard?: undefined;
|
|
322
|
+
details?: undefined;
|
|
323
|
+
error: StripeError<GooglePayError>;
|
|
324
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
-
stripe_version = '~> 22.
|
|
4
|
+
stripe_version = '~> 22.5.1'
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
7
|
s.name = 'stripe-react-native'
|
|
@@ -15,6 +15,11 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { git: 'https://github.com/stripe/stripe-react-native.git', tag: s.version.to_s }
|
|
16
16
|
|
|
17
17
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
18
|
+
s.exclude_files = 'ios/Tests/'
|
|
19
|
+
|
|
20
|
+
s.test_spec 'Tests' do |test_spec|
|
|
21
|
+
test_spec.source_files = 'ios/Tests/**/*.{m,swift}'
|
|
22
|
+
end
|
|
18
23
|
|
|
19
24
|
s.dependency 'React-Core'
|
|
20
25
|
s.dependency 'Stripe', stripe_version
|