@stripe/stripe-react-native 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/android/gradle.properties +2 -2
  4. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +1 -1
  5. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +3 -0
  6. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +9 -15
  7. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +2 -2
  8. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +11 -7
  9. package/ios/Errors.swift +1 -1
  10. package/ios/StripeSdk.swift +23 -7
  11. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  12. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  13. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  14. package/lib/commonjs/components/ApplePayButton.js +1 -1
  15. package/lib/commonjs/components/ApplePayButton.js.map +1 -1
  16. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  17. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  18. package/lib/commonjs/components/CardField.js +1 -1
  19. package/lib/commonjs/components/CardField.js.map +1 -1
  20. package/lib/commonjs/components/CardForm.js +1 -1
  21. package/lib/commonjs/components/CardForm.js.map +1 -1
  22. package/lib/commonjs/components/GooglePayButton.js +1 -1
  23. package/lib/commonjs/components/GooglePayButton.js.map +1 -1
  24. package/lib/commonjs/components/StripeContainer.js +1 -1
  25. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  26. package/lib/commonjs/functions.js.map +1 -1
  27. package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
  28. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  29. package/lib/module/NativeStripeSdk.js.map +1 -1
  30. package/lib/module/components/AddToWalletButton.js +1 -1
  31. package/lib/module/components/AddToWalletButton.js.map +1 -1
  32. package/lib/module/components/ApplePayButton.js +1 -1
  33. package/lib/module/components/ApplePayButton.js.map +1 -1
  34. package/lib/module/components/AuBECSDebitForm.js +1 -1
  35. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  36. package/lib/module/components/CardField.js +1 -1
  37. package/lib/module/components/CardField.js.map +1 -1
  38. package/lib/module/components/CardForm.js +1 -1
  39. package/lib/module/components/CardForm.js.map +1 -1
  40. package/lib/module/components/GooglePayButton.js +1 -1
  41. package/lib/module/components/GooglePayButton.js.map +1 -1
  42. package/lib/module/components/StripeContainer.js +1 -1
  43. package/lib/module/components/StripeContainer.js.map +1 -1
  44. package/lib/module/functions.js.map +1 -1
  45. package/lib/module/hooks/useConfirmPayment.js.map +1 -1
  46. package/lib/module/hooks/useStripe.js.map +1 -1
  47. package/lib/typescript/src/NativeStripeSdk.d.ts +2 -2
  48. package/lib/typescript/src/functions.d.ts +9 -1
  49. package/lib/typescript/src/hooks/useConfirmPayment.d.ts +2 -2
  50. package/lib/typescript/src/hooks/useStripe.d.ts +2 -2
  51. package/package.json +1 -1
  52. package/src/NativeStripeSdk.tsx +3 -2
  53. package/src/functions.ts +9 -1
  54. package/src/hooks/useConfirmPayment.tsx +3 -3
  55. package/src/hooks/useStripe.tsx +3 -2
  56. package/stripe-react-native.podspec +1 -1
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
2
2
  //# sourceMappingURL=StripeContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,gGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,kGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
@@ -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","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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W,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLyD,UAAU,CAAEA,UADP,CAELlD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAdwD,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAG5D,yBAAgB6D,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';\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\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\nexport const handleNextAction = async (\n paymentIntentClientSecret: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret\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 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 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 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","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,8BAqCA,GAAMA,CAAAA,+BAA+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,CAAEA,UADP,CAELlD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAdwD,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAG5D,yBAAgB6D,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';\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 paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param 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 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\nexport const handleNextAction = async (\n paymentIntentClientSecret: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret\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 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 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 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 +1 @@
1
- {"version":3,"sources":["useConfirmPayment.tsx"],"names":["useConfirmPayment","loading","setLoading","confirmPayment","_confirmPayment","paymentIntentClientSecret","data","options","result"],"mappings":"sXAAA,4BAEA,uCAKO,QAASA,CAAAA,iBAAT,EAA6B,CAClC,cAA8B,oBAAS,KAAT,CAA9B,qDAAOC,OAAP,eAAgBC,UAAhB,eACA,eAA2B,2BAA3B,CAAQC,cAAR,YAAQA,cAAR,CAEA,GAAMC,CAAAA,eAAe,CAAG,0EACtB,UACEC,yBADF,CAEEC,IAFF,CAIK,IADHC,CAAAA,OACG,2DADqC,EACrC,CACHL,UAAU,CAAC,IAAD,CAAV,CAEA,GAAMM,CAAAA,MAAM,MAASL,CAAAA,cAAc,CACjCE,yBADiC,CAEjCC,IAFiC,CAGjCC,OAHiC,CAAnC,CAMAL,UAAU,CAAC,KAAD,CAAV,CAEA,MAAOM,CAAAA,MAAP,CACD,CAjBqB,kEAkBtB,CAACL,cAAD,CAlBsB,CAAxB,CAqBA,MAAO,CACLA,cAAc,CAAEC,eADX,CAELH,OAAO,CAAPA,OAFK,CAAP,CAID","sourcesContent":["import { useCallback, useState } from 'react';\nimport type { PaymentMethod } from '../types';\nimport { useStripe } from './useStripe';\n\n/**\n * useConfirmPayment hook\n */\nexport function useConfirmPayment() {\n const [loading, setLoading] = useState(false);\n const { confirmPayment } = useStripe();\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: PaymentMethod.ConfirmParams,\n options: PaymentMethod.ConfirmOptions = {}\n ) => {\n setLoading(true);\n\n const result = await confirmPayment(\n paymentIntentClientSecret,\n data,\n options\n );\n\n setLoading(false);\n\n return result;\n },\n [confirmPayment]\n );\n\n return {\n confirmPayment: _confirmPayment,\n loading,\n };\n}\n"]}
1
+ {"version":3,"sources":["useConfirmPayment.tsx"],"names":["useConfirmPayment","loading","setLoading","confirmPayment","_confirmPayment","paymentIntentClientSecret","data","options","result"],"mappings":"sXAAA,4BAEA,uCAKO,QAASA,CAAAA,iBAAT,EAA6B,CAClC,cAA8B,oBAAS,KAAT,CAA9B,qDAAOC,OAAP,eAAgBC,UAAhB,eACA,eAA2B,2BAA3B,CAAQC,cAAR,YAAQA,cAAR,CAEA,GAAMC,CAAAA,eAAe,CAAG,0EACtB,UACEC,yBADF,CAEEC,IAFF,CAIK,IADHC,CAAAA,OACG,2DADqC,EACrC,CACHL,UAAU,CAAC,IAAD,CAAV,CAEA,GAAMM,CAAAA,MAAM,MAASL,CAAAA,cAAc,CACjCE,yBADiC,CAEjCC,IAFiC,CAGjCC,OAHiC,CAAnC,CAMAL,UAAU,CAAC,KAAD,CAAV,CAEA,MAAOM,CAAAA,MAAP,CACD,CAjBqB,kEAkBtB,CAACL,cAAD,CAlBsB,CAAxB,CAqBA,MAAO,CACLA,cAAc,CAAEC,eADX,CAELH,OAAO,CAAPA,OAFK,CAAP,CAID","sourcesContent":["import { useCallback, useState } from 'react';\nimport type { PaymentIntent } from '../types';\nimport { useStripe } from './useStripe';\n\n/**\n * useConfirmPayment hook\n */\nexport function useConfirmPayment() {\n const [loading, setLoading] = useState(false);\n const { confirmPayment } = useStripe();\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ) => {\n setLoading(true);\n\n const result = await confirmPayment(\n paymentIntentClientSecret,\n data,\n options\n );\n\n setLoading(false);\n\n return result;\n },\n [confirmPayment]\n );\n\n return {\n confirmPayment: _confirmPayment,\n loading,\n };\n}\n"]}
@@ -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","_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":"sWAkCA,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,gEAI3B,EAJ2B,CAA7B,CAOA,GAAME,CAAAA,eAAe,CAAG,2EACtB,UACEC,yBADF,CAEER,IAFF,CAIoC,IADlCC,CAAAA,OACkC,2DADM,EACN,CAClC,MAAO,8BAAeO,yBAAf,CAA0CR,IAA1C,CAAgDC,OAAhD,CAAP,CACD,CAPqB,oEAQtB,EARsB,CAAxB,CAWA,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AAiB,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 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: 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 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","_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,gEAI3B,EAJ2B,CAA7B,CAOA,GAAME,CAAAA,eAAe,CAAG,2EACtB,UACEC,yBADF,CAEER,IAFF,CAIoC,IADlCC,CAAAA,OACkC,2DADM,EACN,CAClC,MAAO,8BAAeO,yBAAf,CAA0CR,IAA1C,CAAgDC,OAAhD,CAAP,CACD,CAPqB,oEAQ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B,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 ): 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 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 +1 @@
1
- {"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCA2GA,GAAQA,CAAAA,SAAR,CAAsBC,0BAAtB,CAAQD,SAAR,C,aAEeA,S","sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\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 ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params: PaymentMethod.ConfirmParams,\n options: PaymentMethod.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};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
1
+ {"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCA4GA,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 ): 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};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,+HAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** 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 */\n androidAssetSource: ImageSourcePropType;\n testID?: 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 /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // Optional, only for Android and only for cards that are in the \"yellow path\" (as defined by Google- https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#resolving_yellow_path). Obtain this value via the `isCardInWallet` method.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,iIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** 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 */\n androidAssetSource: ImageSourcePropType;\n testID?: 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 /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // Optional, only for Android and only for cards that are in the \"yellow path\" (as defined by Google- https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#resolving_yellow_path). Obtain this value via the `isCardInWallet` method.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
2
2
  //# sourceMappingURL=ApplePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,upCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA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ACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
1
+ {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,ypCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,uJAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,yJAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F WARNING: You've enabled `dangerouslyGetFullCardDetails`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F WARNING: You've enabled `dangerouslyGetFullCardDetails`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
2
2
  //# sourceMappingURL=CardField.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"qWACA,qDAOA,yCASA,mC,8sCAOA,GAAMA,CAAAA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EmB,UAJd,CAlBhB,EAwBMhB,KAxBN,gFADF,CA4BD,CArIsB,CAAlB,C","sourcesContent":["import type { CardFieldInput } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[stripe-react-native] ⚠️ WARNING: You've enabled \\`dangerouslyGetFullCardDetails\\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"qWACA,qDAOA,yCASA,mC,gtCAOA,GAAMA,CAAAA,eAAe,CACnB,wCAAmD,WAAnD,CADF,CA8CO,GAAMC,CAAAA,SAAS,CAAG,sBACvB,cAWEC,GAXF,CAYK,IAVDC,CAAAA,YAUC,MAVDA,YAUC,CATDC,OASC,MATDA,OASC,CARDC,MAQC,MARDA,MAQC,CAPDC,S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AZD,CAYG,CAAC3B,QAAD,CAZH,EAcA,MACE,8BAAC,eAAD,wBACE,GAAG,CAAEA,QADP,CAEE,YAAY,CAAEC,mBAFhB,CAGE,aAAa,CAAEoB,cAHjB,CAIE,iBAAiB,CAAExB,iBAAF,OAAEA,iBAAF,CAAuB,IAJ1C,CAKE,WAAW,CAAEC,WAAF,OAAEA,WAAF,CAAiB,IAL9B,CAME,SAAS,CAAE,CACTgC,eAAe,CAAEnC,SAAF,cAAEA,SAAS,CAAEmC,eADnB,CAETC,WAAW,CAAEpC,SAAF,cAAEA,SAAS,CAAEoC,WAFf,CAGTC,WAAW,CAAErC,SAAF,cAAEA,SAAS,CAAEqC,WAHf,CAITC,YAAY,CAAEtC,SAAF,cAAEA,SAAS,CAAEsC,YAJhB,CAKTC,WAAW,CAAEvC,SAAF,cAAEA,SAAS,CAAEuC,WALf,CAMTC,QAAQ,CAAExC,SAAF,cAAEA,SAAS,CAAEwC,QANZ,CAOTC,gBAAgB,CAAEzC,SAAF,cAAEA,SAAS,CAAEyC,gBAPpB,CAQTC,SAAS,CAAE1C,SAAF,cAAEA,SAAS,CAAE0C,SARb,CASTC,cAAc,CAAE3C,SAAF,cAAEA,SAAS,CAAE2C,cATlB,CAUTC,UAAU,CAAE5C,SAAF,cAAEA,SAAS,CAAE4C,UAVd,CANb,CAkBE,YAAY,CAAE,CACZvB,MAAM,CAAEpB,YAAF,cAAEA,YAAY,CAAEoB,MADV,CAEZwB,UAAU,CAAE5C,YAAF,cAAEA,YAAY,CAAE4C,UAFd,CAGZvB,GAAG,CAAErB,YAAF,cAAEA,YAAY,CAAEqB,GAHP,CAIZF,UAAU,CAAEnB,YAAF,cAAEA,YAAY,CAAEmB,UAJd,CAlBhB,EAwBMhB,KAxBN,gFADF,CA4BD,CArIsB,CAAlB,C","sourcesContent":["import type { CardFieldInput } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[stripe-react-native] ⚠️ WARNING: You've enabled \\`dangerouslyGetFullCardDetails\\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F WARNING: You've enabled `dangerouslyGetFullCardDetails`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F WARNING: You've enabled `dangerouslyGetFullCardDetails`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
2
2
  //# sourceMappingURL=CardForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,0qCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,qBAAqB,CAAG,uBAC5B,SAACC,KAAD,CAAuD,CACrD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA0B,CAAG,CACjCC,KAAK,CAAEH,IAAI,CAACG,KADqB,CAEjCC,WAAW,CAAEJ,IAAI,CAACI,WAFe,CAGjCC,UAAU,CAAEL,IAAI,CAACK,UAHgB,CAIjCC,QAAQ,CAAEN,IAAI,CAACM,QAJkB,CAKjCC,KAAK,CAAEP,IAAI,CAACO,KALqB,CAMjCC,OAAO,CAAER,IAAI,CAACQ,OANmB,CAOjCC,UAAU,CAAET,IAAI,CAACS,UAPgB,CAAnC,CAUA,GAAIT,IAAI,CAACU,cAAL,CAAoB,QAApB,GAAiCV,IAAI,CAACU,cAAL,CAAoB,KAApB,CAArC,CAAiE,CAC/DR,IAAI,CAACS,MAAL,CAAcX,IAAI,CAACW,MAAL,EAAe,EAA7B,CACAT,IAAI,CAACU,GAAL,CAAWZ,IAAI,CAACY,GAAL,EAAY,EAAvB,CACA,GAAIC,OAAO,EAAIrB,cAAX,EAA6BQ,IAAI,CAACM,QAAtC,CAA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ACT0B,eAAe,CAAE/B,SAAF,cAAEA,SAAS,CAAE+B,eADnB,CAETC,WAAW,CAAEhC,SAAF,cAAEA,SAAS,CAAEgC,WAFf,CAGTC,WAAW,CAAEjC,SAAF,cAAEA,SAAS,CAAEiC,WAHf,CAITC,YAAY,CAAElC,SAAF,cAAEA,SAAS,CAAEkC,YAJhB,CAKTC,WAAW,CAAEnC,SAAF,cAAEA,SAAS,CAAEmC,WALf,CAMTC,QAAQ,CAAEpC,SAAF,cAAEA,SAAS,CAAEoC,QANZ,CAOTC,gBAAgB,CAAErC,SAAF,cAAEA,SAAS,CAAEqC,gBAPpB,CAQTC,SAAS,CAAEtC,SAAF,cAAEA,SAAS,CAAEsC,SARb,CASTC,cAAc,CAAEvC,SAAF,cAAEA,SAAS,CAAEuC,cATlB,CAUTC,UAAU,CAAExC,SAAF,cAAEA,SAAS,CAAEwC,UAVd,CAHb,CAkBE,YAAY,CAAE,CACZtB,MAAM,CAAEjB,YAAF,cAAEA,YAAY,CAAEiB,MADV,CAEZuB,UAAU,CAAExC,YAAF,cAAEA,YAAY,CAAEwC,UAFd,CAGZtB,GAAG,CAAElB,YAAF,cAAEA,YAAY,CAAEkB,GAHP,CAIZH,UAAU,CAAEf,YAAF,cAAEA,YAAY,CAAEe,UAJd,CAlBhB,CAwBE,aAAa,kBACPd,aADO,OACPA,aADO,CACU,EADV,CAxBf,CA2BE,aAAa,CAAE0B,cA3BjB,EA6BMzB,KA7BN,gFADF,CAiCD,CA3HqB,CAAjB,C","sourcesContent":["import type { CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[stripe-react-native] ⚠️ WARNING: You've enabled \\`dangerouslyGetFullCardDetails\\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,4qCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,qBAAqB,CAAG,uBAC5B,SAACC,KAAD,CAAuD,CACrD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA0B,CAAG,CACjCC,KAAK,CAAEH,IAAI,CAACG,KADqB,CAEjCC,WAAW,CAAEJ,IAAI,CAACI,WAFe,CAGjCC,UAAU,CAAEL,IAAI,CAACK,UAHgB,CAIjCC,QAAQ,CAAEN,IAAI,CAACM,QAJkB,CAKjCC,KAAK,CAAEP,IAAI,CAACO,KALqB,CAMjCC,OAAO,CAAER,IAAI,CAACQ,OANmB,CAOjCC,UAAU,CAAET,IAAI,CAACS,UAPgB,CAAnC,CAU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{ CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[stripe-react-native] ⚠️ WARNING: You've enabled \\`dangerouslyGetFullCardDetails\\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
2
2
  //# sourceMappingURL=GooglePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,4IASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}
1
+ {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,8IASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}