@stripe/stripe-react-native 0.23.2 → 0.24.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 (66) hide show
  1. package/CHANGELOG.md +39 -9
  2. package/android/gradle.properties +2 -2
  3. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +2 -1
  4. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +72 -16
  5. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +19 -2
  6. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +1 -1
  7. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
  8. package/ios/ApplePayButtonManager.m +1 -0
  9. package/ios/ApplePayButtonView.swift +2 -0
  10. package/ios/ApplePayUtils.swift +116 -15
  11. package/ios/ApplePayViewController.swift +13 -0
  12. package/ios/Errors.swift +1 -0
  13. package/ios/StripeSdk+PaymentSheet.swift +166 -0
  14. package/ios/StripeSdk-Bridging-Header.h +1 -0
  15. package/ios/StripeSdk.m +17 -1
  16. package/ios/StripeSdk.swift +67 -134
  17. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  18. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  19. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  20. package/lib/commonjs/functions.js +1 -1
  21. package/lib/commonjs/functions.js.map +1 -1
  22. package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
  23. package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
  24. package/lib/commonjs/hooks/useStripe.js +1 -1
  25. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  26. package/lib/commonjs/types/Errors.js +1 -1
  27. package/lib/commonjs/types/Errors.js.map +1 -1
  28. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  29. package/lib/commonjs/types/PlatformPay.js +1 -1
  30. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  31. package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
  32. package/lib/module/NativeStripeSdk.js.map +1 -1
  33. package/lib/module/components/PlatformPayButton.js +1 -1
  34. package/lib/module/components/PlatformPayButton.js.map +1 -1
  35. package/lib/module/functions.js +1 -1
  36. package/lib/module/functions.js.map +1 -1
  37. package/lib/module/hooks/usePaymentSheet.js +1 -1
  38. package/lib/module/hooks/usePaymentSheet.js.map +1 -1
  39. package/lib/module/hooks/useStripe.js +1 -1
  40. package/lib/module/hooks/useStripe.js.map +1 -1
  41. package/lib/module/types/Errors.js +1 -1
  42. package/lib/module/types/Errors.js.map +1 -1
  43. package/lib/module/types/PaymentSheet.js.map +1 -1
  44. package/lib/module/types/PlatformPay.js +1 -1
  45. package/lib/module/types/PlatformPay.js.map +1 -1
  46. package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
  47. package/lib/typescript/src/NativeStripeSdk.d.ts +3 -1
  48. package/lib/typescript/src/components/PlatformPayButton.d.ts +6 -1
  49. package/lib/typescript/src/functions.d.ts +1 -1
  50. package/lib/typescript/src/hooks/usePaymentSheet.d.ts +1 -1
  51. package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
  52. package/lib/typescript/src/types/Errors.d.ts +2 -1
  53. package/lib/typescript/src/types/PaymentSheet.d.ts +17 -1
  54. package/lib/typescript/src/types/PlatformPay.d.ts +64 -1
  55. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +1 -0
  56. package/package.json +2 -2
  57. package/src/NativeStripeSdk.tsx +13 -1
  58. package/src/components/PlatformPayButton.tsx +31 -3
  59. package/src/functions.ts +34 -21
  60. package/src/hooks/usePaymentSheet.tsx +2 -2
  61. package/src/hooks/useStripe.tsx +8 -4
  62. package/src/types/Errors.ts +1 -0
  63. package/src/types/PaymentSheet.ts +33 -3
  64. package/src/types/PlatformPay.ts +72 -1
  65. package/src/types/components/ApplePayButtonComponent.ts +1 -0
  66. package/stripe-react-native.podspec +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["PaymentSheet.ts"],"sourcesContent":["import type { BillingDetails, AddressDetails } from './Common';\nimport type { CartSummaryItem } from './ApplePay';\n\nexport type SetupParams = ClientSecretParams & {\n /** Your customer-facing business name. On Android, this is required and cannot be an empty string. */\n merchantDisplayName: string;\n /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */\n customerId?: string;\n /** A short-lived token that allows the SDK to access a Customer’s payment methods. */\n customerEphemeralKeySecret?: string;\n /** When set to true, separates out the payment method selection & confirmation steps.\n * If true, you must call `confirmPaymentSheetPayment` on your own. Defaults to false. */\n customFlow?: boolean;\n /** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */\n applePay?: ApplePayParams;\n /** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */\n googlePay?: GooglePayParams;\n /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. */\n style?: 'alwaysLight' | 'alwaysDark' | 'automatic';\n /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */\n returnURL?: string;\n /** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */\n defaultBillingDetails?: BillingDetails;\n /**\n * The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.\n * This is used to display a \"Billing address is same as shipping\" checkbox if `defaultBillingDetails` is not provided.\n * If `name` and `line1` are populated, it's also [attached to the PaymentIntent](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping) during payment.\n */\n defaultShippingDetails?: AddressDetails;\n /** If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.\n *\n * Some payment methods can’t guarantee you will receive funds from your customer at the end of the checkout\n * because they take time to settle (eg. most bank debits, like SEPA or ACH) or require customer action to\n * complete (e.g. OXXO, Konbini, Boleto). If this is set to true, make sure your integration listens to webhooks\n * for notifications on whether a payment has succeeded or not.\n */\n allowsDelayedPaymentMethods?: boolean;\n /** Customizes the appearance of PaymentSheet */\n appearance?: AppearanceParams;\n /** The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents. */\n primaryButtonLabel?: string;\n};\n\nexport type ClientSecretParams =\n | {\n paymentIntentClientSecret: string;\n setupIntentClientSecret?: undefined;\n }\n | {\n setupIntentClientSecret: string;\n paymentIntentClientSecret?: undefined;\n };\n\nexport type ApplePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /**\n * An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent\n * for a recurring payment, you should set this to display the amount you intend to charge. */\n paymentSummaryItems?: CartSummaryItem[];\n // TODO: Uncomment when https://github.com/stripe/stripe-react-native/pull/1164 lands\n // buttonType: ButtonType\n};\n\nexport type GooglePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /** The three-letter ISO 4217 alphabetic currency code, e.g. \"USD\" or \"EUR\". Required in order to support Google Pay when processing a Setup Intent. */\n currencyCode?: string;\n /** Whether or not to use the Google Pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. */\n testEnv?: boolean;\n};\n\n/**\n * Used to customize the appearance of your PaymentSheet\n */\nexport type AppearanceParams = RecursivePartial<{\n /** Describes the appearance of fonts in your PaymentSheet */\n font: FontConfig;\n /** Describes the colors in your PaymentSheet. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | GlobalColorConfig\n | { light: GlobalColorConfig; dark: GlobalColorConfig };\n /** Describes the appearance of shapes in the PaymentSheet, such as buttons, inputs, and tabs. */\n shapes: {\n /** The border radius used for buttons, inputs, and tabs in your PaymentSheet.\n * @default 6.0\n */\n borderRadius: number;\n /** The border width used for inputs and tabs in your PaymentSheet.\n * @default 1.0\n */\n borderWidth: number;\n /** iOS only. The shadow used for buttons, inputs, and tabs in your PaymentSheet */\n shadow: ShadowConfig;\n };\n /** Describes the appearance of the primary \"Pay\" button at the bottom of your Payment Sheet */\n primaryButton: PrimaryButtonConfig;\n}>;\n\nexport type FontConfig = {\n /**\n * The font used for regular text. PaymentSheet will attempt to use medium and bold versions of this font if they exist.\n *\n * On iOS, this should be the \"PostScript name\" found in Font Book after installing the font.\n * On Android, this should be the name of the font file (containing only lowercase alphanumeric characters) in android/app/src/main/res/font\n *\n * @default The OS's system font\n */\n family: string;\n /** The scale factor for all fonts in your PaymentSheet. This value is required to be greater than 0. Font sizes are multiplied by this value before being displayed. For example, setting this to 1.2 increases the size of all text by 20%.\n * @default 1.0\n */\n scale: number;\n};\n\nexport type ShadowConfig = {\n /** The color of the shadow.\n * @default \"#000000\"\n * */\n color: string;\n /** The alpha or opacity of the shadow.\n * @default 0.05\n */\n opacity: number;\n /** The positioning of the shadow relative to the component. For example, a negative x and y will result in a shadow placed below and to the left of the component.\n * @default {x: 0, y: 2}\n */\n offset: { x: number; y: number };\n /** The blur radius of the shadow.\n * @default 4\n */\n blurRadius: number;\n};\n\nexport type GlobalColorConfig = {\n /** A primary color used throughout your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System blue color on iOS, and \"#007AFF\" (light) / \"#0074D4\" (dark) on Android.\n */\n primary: string;\n /** The color used for the background of your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color on iOS, and \"#ffffff\" (light) / \"#2e2e2e\" (dark) on Android.\n */\n background: string;\n /** The color used for the background of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color (light) / System secondary background color (dark) on iOS, and \"#ffffff\" (light) / \"#a9a9a9\" (dark) on Android.\n */\n componentBackground: string;\n /** The color used for the external border of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentBorder: string;\n /** The color used for the internal border (meaning the border is shared with another component) of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentDivider: string;\n /** The color of the header text in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n primaryText: string;\n /** The color of the label text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n secondaryText: string;\n /** The color of the input text in your PaymentSheet components, such as the user's card number or zip code, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default \"#000000\"\n */\n componentText: string;\n /** The color of the placeholder text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#99000000\" (light) / \"#99ffffff\" (dark) on Android.\n */\n placeholderText: string;\n /** The color used for icons in your Payment Sheet, such as the close or back icons, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#99000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n icon: string;\n /** The color used to indicate errors or destructive actions in your Payment Sheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System red color on iOS, and \"#ff0000\" (light) / \"#ff0000\" (dark) on Android.\n */\n error: string;\n};\n\nexport type PrimaryButtonConfig = {\n /** The font family used specifically for the primary button.\n * @default The root `appearance.font.family`\n */\n font: Pick<FontConfig, 'family'>;\n /** The colors used specifically for the primary button. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | PrimaryButtonColorConfig\n | { light: PrimaryButtonColorConfig; dark: PrimaryButtonColorConfig };\n /** Describes the border and shadow of the primary button. */\n shapes: {\n /** The border radius used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderRadius`\n */\n borderRadius: number;\n /** The border width used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderWidth`\n */\n borderWidth: number;\n /** iOS only. The shadow used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.shadow`\n */\n shadow: ShadowConfig;\n };\n};\n\nexport type PrimaryButtonColorConfig = {\n /** The background color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The root `appearance.colors.primary`\n */\n background: string;\n /** The color of the text for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default White or black, depending on the color of the button.\n */\n text: string;\n /** The border color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System quaternary label on iOS, transparent on Android.\n */\n border: string;\n};\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\nexport interface PaymentOption {\n label: string;\n image: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["PaymentSheet.ts"],"sourcesContent":["import type { BillingDetails, AddressDetails } from './Common';\nimport type { CartSummaryItem } from './ApplePay';\nimport type {\n ButtonType,\n RecurringPaymentRequest,\n AutomaticReloadPaymentRequest,\n MultiMerchantRequest,\n} from './PlatformPay';\n\nexport type SetupParams = ClientSecretParams & {\n /** Your customer-facing business name. On Android, this is required and cannot be an empty string. */\n merchantDisplayName: string;\n /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */\n customerId?: string;\n /** A short-lived token that allows the SDK to access a Customer’s payment methods. */\n customerEphemeralKeySecret?: string;\n /** When set to true, separates out the payment method selection & confirmation steps.\n * If true, you must call `confirmPaymentSheetPayment` on your own. Defaults to false. */\n customFlow?: boolean;\n /** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */\n applePay?: ApplePayParams;\n /** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */\n googlePay?: GooglePayParams;\n /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. */\n style?: 'alwaysLight' | 'alwaysDark' | 'automatic';\n /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */\n returnURL?: string;\n /** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */\n defaultBillingDetails?: BillingDetails;\n /**\n * The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.\n * This is used to display a \"Billing address is same as shipping\" checkbox if `defaultBillingDetails` is not provided.\n * If `name` and `line1` are populated, it's also [attached to the PaymentIntent](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping) during payment.\n */\n defaultShippingDetails?: AddressDetails;\n /** If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.\n *\n * Some payment methods can’t guarantee you will receive funds from your customer at the end of the checkout\n * because they take time to settle (eg. most bank debits, like SEPA or ACH) or require customer action to\n * complete (e.g. OXXO, Konbini, Boleto). If this is set to true, make sure your integration listens to webhooks\n * for notifications on whether a payment has succeeded or not.\n */\n allowsDelayedPaymentMethods?: boolean;\n /** Customizes the appearance of PaymentSheet */\n appearance?: AppearanceParams;\n /** The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents. */\n primaryButtonLabel?: string;\n};\n\nexport type ClientSecretParams =\n | {\n paymentIntentClientSecret: string;\n setupIntentClientSecret?: undefined;\n }\n | {\n setupIntentClientSecret: string;\n paymentIntentClientSecret?: undefined;\n };\n\nexport type ApplePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /**\n * An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent\n * for a recurring payment, you should set this to display the amount you intend to charge. */\n cartItems?: CartSummaryItem[];\n /** Sets the text displayed by the call to action button in the Apple Pay sheet. */\n buttonType?: ButtonType;\n /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */\n request?:\n | RecurringPaymentRequest\n | AutomaticReloadPaymentRequest\n | MultiMerchantRequest;\n /** Callback function for setting the order details (retrieved from your server) to give users the\n * ability to track and manage their purchases in Wallet. Stripe calls your implementation after the\n * payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion`\n * function, or else the Apple Pay sheet will hang. */\n setOrderTracking?: (\n completion: (\n orderIdentifier: string,\n orderTypeIdentifier: string,\n authenticationToken: string,\n webServiceUrl: string\n ) => void\n ) => void;\n};\n\nexport type GooglePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /** The three-letter ISO 4217 alphabetic currency code, e.g. \"USD\" or \"EUR\". Required in order to support Google Pay when processing a Setup Intent. */\n currencyCode?: string;\n /** Whether or not to use the Google Pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. */\n testEnv?: boolean;\n};\n\n/**\n * Used to customize the appearance of your PaymentSheet\n */\nexport type AppearanceParams = RecursivePartial<{\n /** Describes the appearance of fonts in your PaymentSheet */\n font: FontConfig;\n /** Describes the colors in your PaymentSheet. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | GlobalColorConfig\n | { light: GlobalColorConfig; dark: GlobalColorConfig };\n /** Describes the appearance of shapes in the PaymentSheet, such as buttons, inputs, and tabs. */\n shapes: {\n /** The border radius used for buttons, inputs, and tabs in your PaymentSheet.\n * @default 6.0\n */\n borderRadius: number;\n /** The border width used for inputs and tabs in your PaymentSheet.\n * @default 1.0\n */\n borderWidth: number;\n /** iOS only. The shadow used for buttons, inputs, and tabs in your PaymentSheet */\n shadow: ShadowConfig;\n };\n /** Describes the appearance of the primary \"Pay\" button at the bottom of your Payment Sheet */\n primaryButton: PrimaryButtonConfig;\n}>;\n\nexport type FontConfig = {\n /**\n * The font used for regular text. PaymentSheet will attempt to use medium and bold versions of this font if they exist.\n *\n * On iOS, this should be the \"PostScript name\" found in Font Book after installing the font.\n * On Android, this should be the name of the font file (containing only lowercase alphanumeric characters) in android/app/src/main/res/font\n *\n * @default The OS's system font\n */\n family: string;\n /** The scale factor for all fonts in your PaymentSheet. This value is required to be greater than 0. Font sizes are multiplied by this value before being displayed. For example, setting this to 1.2 increases the size of all text by 20%.\n * @default 1.0\n */\n scale: number;\n};\n\nexport type ShadowConfig = {\n /** The color of the shadow.\n * @default \"#000000\"\n * */\n color: string;\n /** The alpha or opacity of the shadow.\n * @default 0.05\n */\n opacity: number;\n /** The positioning of the shadow relative to the component. For example, a negative x and y will result in a shadow placed below and to the left of the component.\n * @default {x: 0, y: 2}\n */\n offset: { x: number; y: number };\n /** The blur radius of the shadow.\n * @default 4\n */\n blurRadius: number;\n};\n\nexport type GlobalColorConfig = {\n /** A primary color used throughout your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System blue color on iOS, and \"#007AFF\" (light) / \"#0074D4\" (dark) on Android.\n */\n primary: string;\n /** The color used for the background of your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color on iOS, and \"#ffffff\" (light) / \"#2e2e2e\" (dark) on Android.\n */\n background: string;\n /** The color used for the background of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color (light) / System secondary background color (dark) on iOS, and \"#ffffff\" (light) / \"#a9a9a9\" (dark) on Android.\n */\n componentBackground: string;\n /** The color used for the external border of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentBorder: string;\n /** The color used for the internal border (meaning the border is shared with another component) of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentDivider: string;\n /** The color of the header text in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n primaryText: string;\n /** The color of the label text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n secondaryText: string;\n /** The color of the input text in your PaymentSheet components, such as the user's card number or zip code, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default \"#000000\"\n */\n componentText: string;\n /** The color of the placeholder text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#99000000\" (light) / \"#99ffffff\" (dark) on Android.\n */\n placeholderText: string;\n /** The color used for icons in your Payment Sheet, such as the close or back icons, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#99000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n icon: string;\n /** The color used to indicate errors or destructive actions in your Payment Sheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System red color on iOS, and \"#ff0000\" (light) / \"#ff0000\" (dark) on Android.\n */\n error: string;\n};\n\nexport type PrimaryButtonConfig = {\n /** The font family used specifically for the primary button.\n * @default The root `appearance.font.family`\n */\n font: Pick<FontConfig, 'family'>;\n /** The colors used specifically for the primary button. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | PrimaryButtonColorConfig\n | { light: PrimaryButtonColorConfig; dark: PrimaryButtonColorConfig };\n /** Describes the border and shadow of the primary button. */\n shapes: {\n /** The border radius used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderRadius`\n */\n borderRadius: number;\n /** The border width used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderWidth`\n */\n borderWidth: number;\n /** iOS only. The shadow used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.shadow`\n */\n shadow: ShadowConfig;\n };\n};\n\nexport type PrimaryButtonColorConfig = {\n /** The background color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The root `appearance.colors.primary`\n */\n background: string;\n /** The color of the text for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default White or black, depending on the color of the button.\n */\n text: string;\n /** The border color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System quaternary label on iOS, transparent on Android.\n */\n border: string;\n};\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\nexport interface PaymentOption {\n label: string;\n image: string;\n}\n\nexport type PresentOptions = {\n /** The number of milliseconds (after presenting) before the Payment Sheet closes automatically, at which point\n *`presentPaymentSheet` will resolve with an `error.code` of `PaymentSheetError.Timeout`. The default is no timeout.\n */\n timeout?: number;\n};\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.PaymentType=exports.InvalidShippingField=exports.IntervalUnit=exports.ContactField=exports.ButtonType=exports.ButtonStyle=exports.BillingAddressFormat=exports.ApplePayShippingType=exports.ApplePaySheetErrorType=exports.ApplePayMerchantCapability=void 0;var ApplePaySheetErrorType;exports.ApplePaySheetErrorType=ApplePaySheetErrorType;(function(ApplePaySheetErrorType){ApplePaySheetErrorType["InvalidShippingAddress"]="InvalidShippingAddress";ApplePaySheetErrorType["UnserviceableShippingAddress"]="UnserviceableShippingAddress";ApplePaySheetErrorType["InvalidCouponCode"]="InvalidCouponCode";ApplePaySheetErrorType["ExpiredCouponCode"]="ExpiredCouponCode";})(ApplePaySheetErrorType||(exports.ApplePaySheetErrorType=ApplePaySheetErrorType={}));var ContactField;exports.ContactField=ContactField;(function(ContactField){ContactField["EmailAddress"]="emailAddress";ContactField["Name"]="name";ContactField["PhoneNumber"]="phoneNumber";ContactField["PhoneticName"]="phoneticName";ContactField["PostalAddress"]="postalAddress";})(ContactField||(exports.ContactField=ContactField={}));var InvalidShippingField;exports.InvalidShippingField=InvalidShippingField;(function(InvalidShippingField){InvalidShippingField["Street"]="street";InvalidShippingField["City"]="city";InvalidShippingField["SubAdministrativeArea"]="subAdministrativeArea";InvalidShippingField["State"]="state";InvalidShippingField["PostalCode"]="postalCode";InvalidShippingField["Country"]="country";InvalidShippingField["CountryCode"]="countryCode";InvalidShippingField["SubLocality"]="subLocality";})(InvalidShippingField||(exports.InvalidShippingField=InvalidShippingField={}));var ApplePayMerchantCapability;exports.ApplePayMerchantCapability=ApplePayMerchantCapability;(function(ApplePayMerchantCapability){ApplePayMerchantCapability["Supports3DS"]="supports3DS";ApplePayMerchantCapability["SupportsCredit"]="supportsCredit";ApplePayMerchantCapability["SupportsDebit"]="supportsDebit";})(ApplePayMerchantCapability||(exports.ApplePayMerchantCapability=ApplePayMerchantCapability={}));var ApplePayShippingType;exports.ApplePayShippingType=ApplePayShippingType;(function(ApplePayShippingType){ApplePayShippingType["Shipping"]="shipping";ApplePayShippingType["Delivery"]="delivery";ApplePayShippingType["StorePickup"]="storePickup";ApplePayShippingType["ServicePickup"]="servicePickup";})(ApplePayShippingType||(exports.ApplePayShippingType=ApplePayShippingType={}));var BillingAddressFormat;exports.BillingAddressFormat=BillingAddressFormat;(function(BillingAddressFormat){BillingAddressFormat["Full"]="FULL";BillingAddressFormat["Min"]="MIN";})(BillingAddressFormat||(exports.BillingAddressFormat=BillingAddressFormat={}));var ButtonType;exports.ButtonType=ButtonType;(function(ButtonType){ButtonType[ButtonType["Default"]=0]="Default";ButtonType[ButtonType["Buy"]=1]="Buy";ButtonType[ButtonType["Book"]=6]="Book";ButtonType[ButtonType["Checkout"]=5]="Checkout";ButtonType[ButtonType["Donate"]=4]="Donate";ButtonType[ButtonType["Order"]=11]="Order";ButtonType[ButtonType["Subscribe"]=7]="Subscribe";ButtonType[ButtonType["SetUp"]=2]="SetUp";ButtonType[ButtonType["InStore"]=3]="InStore";ButtonType[ButtonType["Reload"]=8]="Reload";ButtonType[ButtonType["AddMoney"]=9]="AddMoney";ButtonType[ButtonType["TopUp"]=10]="TopUp";ButtonType[ButtonType["Rent"]=12]="Rent";ButtonType[ButtonType["Support"]=13]="Support";ButtonType[ButtonType["Contribute"]=14]="Contribute";ButtonType[ButtonType["Tip"]=15]="Tip";ButtonType[ButtonType["Continue"]=16]="Continue";ButtonType[ButtonType["Pay"]=1000]="Pay";ButtonType[ButtonType["GooglePayMark"]=1001]="GooglePayMark";})(ButtonType||(exports.ButtonType=ButtonType={}));var ButtonStyle;exports.ButtonStyle=ButtonStyle;(function(ButtonStyle){ButtonStyle[ButtonStyle["White"]=0]="White";ButtonStyle[ButtonStyle["WhiteOutline"]=1]="WhiteOutline";ButtonStyle[ButtonStyle["Black"]=2]="Black";ButtonStyle[ButtonStyle["Automatic"]=3]="Automatic";})(ButtonStyle||(exports.ButtonStyle=ButtonStyle={}));var PaymentType;exports.PaymentType=PaymentType;(function(PaymentType){PaymentType["Deferred"]="Deferred";PaymentType["Immediate"]="Immediate";PaymentType["Recurring"]="Recurring";})(PaymentType||(exports.PaymentType=PaymentType={}));var IntervalUnit;exports.IntervalUnit=IntervalUnit;(function(IntervalUnit){IntervalUnit["Minute"]="minute";IntervalUnit["Hour"]="hour";IntervalUnit["Day"]="day";IntervalUnit["Month"]="month";IntervalUnit["Year"]="year";})(IntervalUnit||(exports.IntervalUnit=IntervalUnit={}));
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.PaymentType=exports.PaymentRequestType=exports.InvalidShippingField=exports.IntervalUnit=exports.ContactField=exports.ButtonType=exports.ButtonStyle=exports.BillingAddressFormat=exports.ApplePayShippingType=exports.ApplePaySheetErrorType=exports.ApplePayMerchantCapability=void 0;var ApplePaySheetErrorType;exports.ApplePaySheetErrorType=ApplePaySheetErrorType;(function(ApplePaySheetErrorType){ApplePaySheetErrorType["InvalidShippingAddress"]="InvalidShippingAddress";ApplePaySheetErrorType["UnserviceableShippingAddress"]="UnserviceableShippingAddress";ApplePaySheetErrorType["InvalidCouponCode"]="InvalidCouponCode";ApplePaySheetErrorType["ExpiredCouponCode"]="ExpiredCouponCode";})(ApplePaySheetErrorType||(exports.ApplePaySheetErrorType=ApplePaySheetErrorType={}));var ContactField;exports.ContactField=ContactField;(function(ContactField){ContactField["EmailAddress"]="emailAddress";ContactField["Name"]="name";ContactField["PhoneNumber"]="phoneNumber";ContactField["PhoneticName"]="phoneticName";ContactField["PostalAddress"]="postalAddress";})(ContactField||(exports.ContactField=ContactField={}));var InvalidShippingField;exports.InvalidShippingField=InvalidShippingField;(function(InvalidShippingField){InvalidShippingField["Street"]="street";InvalidShippingField["City"]="city";InvalidShippingField["SubAdministrativeArea"]="subAdministrativeArea";InvalidShippingField["State"]="state";InvalidShippingField["PostalCode"]="postalCode";InvalidShippingField["Country"]="country";InvalidShippingField["CountryCode"]="countryCode";InvalidShippingField["SubLocality"]="subLocality";})(InvalidShippingField||(exports.InvalidShippingField=InvalidShippingField={}));var PaymentRequestType;exports.PaymentRequestType=PaymentRequestType;(function(PaymentRequestType){PaymentRequestType["Recurring"]="Recurring";PaymentRequestType["AutomaticReload"]="AutomaticReload";PaymentRequestType["MultiMerchant"]="MultiMerchant";})(PaymentRequestType||(exports.PaymentRequestType=PaymentRequestType={}));var ApplePayMerchantCapability;exports.ApplePayMerchantCapability=ApplePayMerchantCapability;(function(ApplePayMerchantCapability){ApplePayMerchantCapability["Supports3DS"]="supports3DS";ApplePayMerchantCapability["SupportsCredit"]="supportsCredit";ApplePayMerchantCapability["SupportsDebit"]="supportsDebit";})(ApplePayMerchantCapability||(exports.ApplePayMerchantCapability=ApplePayMerchantCapability={}));var ApplePayShippingType;exports.ApplePayShippingType=ApplePayShippingType;(function(ApplePayShippingType){ApplePayShippingType["Shipping"]="shipping";ApplePayShippingType["Delivery"]="delivery";ApplePayShippingType["StorePickup"]="storePickup";ApplePayShippingType["ServicePickup"]="servicePickup";})(ApplePayShippingType||(exports.ApplePayShippingType=ApplePayShippingType={}));var BillingAddressFormat;exports.BillingAddressFormat=BillingAddressFormat;(function(BillingAddressFormat){BillingAddressFormat["Full"]="FULL";BillingAddressFormat["Min"]="MIN";})(BillingAddressFormat||(exports.BillingAddressFormat=BillingAddressFormat={}));var ButtonType;exports.ButtonType=ButtonType;(function(ButtonType){ButtonType[ButtonType["Default"]=0]="Default";ButtonType[ButtonType["Buy"]=1]="Buy";ButtonType[ButtonType["Book"]=6]="Book";ButtonType[ButtonType["Checkout"]=5]="Checkout";ButtonType[ButtonType["Donate"]=4]="Donate";ButtonType[ButtonType["Order"]=11]="Order";ButtonType[ButtonType["Subscribe"]=7]="Subscribe";ButtonType[ButtonType["SetUp"]=2]="SetUp";ButtonType[ButtonType["InStore"]=3]="InStore";ButtonType[ButtonType["Reload"]=8]="Reload";ButtonType[ButtonType["AddMoney"]=9]="AddMoney";ButtonType[ButtonType["TopUp"]=10]="TopUp";ButtonType[ButtonType["Rent"]=12]="Rent";ButtonType[ButtonType["Support"]=13]="Support";ButtonType[ButtonType["Contribute"]=14]="Contribute";ButtonType[ButtonType["Tip"]=15]="Tip";ButtonType[ButtonType["Continue"]=16]="Continue";ButtonType[ButtonType["Pay"]=1000]="Pay";ButtonType[ButtonType["GooglePayMark"]=1001]="GooglePayMark";})(ButtonType||(exports.ButtonType=ButtonType={}));var ButtonStyle;exports.ButtonStyle=ButtonStyle;(function(ButtonStyle){ButtonStyle[ButtonStyle["White"]=0]="White";ButtonStyle[ButtonStyle["WhiteOutline"]=1]="WhiteOutline";ButtonStyle[ButtonStyle["Black"]=2]="Black";ButtonStyle[ButtonStyle["Automatic"]=3]="Automatic";})(ButtonStyle||(exports.ButtonStyle=ButtonStyle={}));var PaymentType;exports.PaymentType=PaymentType;(function(PaymentType){PaymentType["Deferred"]="Deferred";PaymentType["Immediate"]="Immediate";PaymentType["Recurring"]="Recurring";})(PaymentType||(exports.PaymentType=PaymentType={}));var IntervalUnit;exports.IntervalUnit=IntervalUnit;(function(IntervalUnit){IntervalUnit["Minute"]="minute";IntervalUnit["Hour"]="hour";IntervalUnit["Day"]="day";IntervalUnit["Month"]="month";IntervalUnit["Year"]="year";})(IntervalUnit||(exports.IntervalUnit=IntervalUnit={}));
2
2
  //# sourceMappingURL=PlatformPay.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"sources":["PlatformPay.ts"],"sourcesContent":["import type { Result as Token } from './Token';\nimport type { Result as PaymentMethod } from './PaymentMethod';\nimport type { Result as PaymentIntent } from './PaymentIntent';\nimport type { Result as SetupIntent } from './SetupIntent';\nimport type { StripeError, PlatformPayError } from './Errors';\nimport type { ShippingContact as ApplePayShippingContact } from './ApplePay';\nimport type { IsSupportedParams } from './GooglePay';\n\nexport type ApplePaySheetError =\n | {\n errorType: ApplePaySheetErrorType.InvalidShippingAddress;\n field: InvalidShippingField;\n message?: string;\n }\n | {\n errorType:\n | ApplePaySheetErrorType.UnserviceableShippingAddress\n | ApplePaySheetErrorType.InvalidCouponCode\n | ApplePaySheetErrorType.ExpiredCouponCode;\n message?: string;\n };\n\nexport enum ApplePaySheetErrorType {\n InvalidShippingAddress = 'InvalidShippingAddress',\n UnserviceableShippingAddress = 'UnserviceableShippingAddress',\n InvalidCouponCode = 'InvalidCouponCode',\n ExpiredCouponCode = 'ExpiredCouponCode',\n}\n\nexport enum ContactField {\n EmailAddress = 'emailAddress',\n Name = 'name',\n PhoneNumber = 'phoneNumber',\n PhoneticName = 'phoneticName',\n PostalAddress = 'postalAddress',\n}\n\nexport enum InvalidShippingField {\n Street = 'street',\n City = 'city',\n SubAdministrativeArea = 'subAdministrativeArea',\n State = 'state',\n PostalCode = 'postalCode',\n Country = 'country',\n CountryCode = 'countryCode',\n SubLocality = 'subLocality',\n}\n\nexport type ApplePayBaseParams = {\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: [\"JCB\", \"barcode\", \"chinaUnionPay\"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. */\n additionalEnabledNetworks?: Array<string>;\n /** The list of items that describe a purchase. For example: total, tax, discount, and grand total. */\n cartItems: Array<CartSummaryItem>;\n /** The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.*/\n requiredShippingAddressFields?: Array<ContactField>;\n /** The list of fields that you need for a billing contact in order to process the transaction. */\n requiredBillingContactFields?: Array<ContactField>;\n /** An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. */\n shippingMethods?: Array<ShippingMethod>;\n /** Set the payment capabilities you support. If set, 3DS is required. */\n merchantCapabilities?: Array<ApplePayMerchantCapability>;\n /** An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.*/\n shippingType?: ApplePayShippingType;\n /** A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. */\n supportedCountries?: Array<string>;\n};\n\nexport type ApplePayPaymentMethodParams = {\n /** Set this value to true to display the coupon code field, or pass the 'couponCode' field to autofill with a coupon code. Defaults to false. If true, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n supportsCouponCode?: boolean;\n /** Set this value to autofill with a coupon code. If provided, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n couponCode?: string;\n};\n\nexport enum ApplePayMerchantCapability {\n /** Required. This value must be supplied. */\n Supports3DS = 'supports3DS',\n /** Optional. If present, only transactions that are categorized as credit cards are allowed. */\n SupportsCredit = 'supportsCredit',\n /** Optional. If present, only transactions that are categorized as debit cards are allowed. */\n SupportsDebit = 'supportsDebit',\n}\n\n/** A type that indicates how to ship purchased items. */\nexport enum ApplePayShippingType {\n /** Default. */\n Shipping = 'shipping',\n Delivery = 'delivery',\n StorePickup = 'storePickup',\n ServicePickup = 'servicePickup',\n}\n\nexport type GooglePayBaseParams = {\n /**\n * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK.\n - Does not require the application to be uploaded to the Google Play Store.\n - Does not require a Google Pay Developer Profile.\n - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.\n - The user will see a warning message that the app is not recognized/verified.\n */\n testEnv: boolean;\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** Your merchant name, displayed in the Google Pay sheet. */\n merchantName?: string;\n /** Set to true to request an email address. Defaults to false. */\n isEmailRequired?: boolean;\n /** Set to false if you don't support credit cards. Defaults to true. */\n allowCreditCards?: boolean;\n /** If true, Google Pay is considered \"available\" if the customer's Google Pay wallet has an existing payment method. Defaults to false. */\n existingPaymentMethodRequired?: boolean;\n /** Describes the configuration for billing address collection in the Google Pay sheet. */\n billingAddressConfig?: {\n /** Set to true if billing address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */\n format?: BillingAddressFormat;\n };\n};\n\nexport type GooglePayPaymentMethodParams = {\n /** Total monetary value of the transaction. */\n amount: number;\n /** Describes the configuration for shipping address collection in the Google Pay sheet. */\n shippingAddressConfig?: {\n /** Set to true if shipping address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Set of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. Defaults to all shipping address countries. */\n allowedCountryCodes?: Array<string>;\n };\n};\n\nexport enum BillingAddressFormat {\n /** Collect name, street address, locality, region, country code, and postal code. */\n Full = 'FULL',\n /** Collect name, country code, and postal code (default). */\n Min = 'MIN',\n}\n\nexport type PaymentMethodParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams & GooglePayPaymentMethodParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;\n};\n\nexport type ConfirmParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams;\n};\n\nexport enum ButtonType {\n /** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */\n Default = 0,\n /** A button useful for product purchases. */\n Buy = 1,\n /** A button useful for booking trips, flights, or other experiences. */\n Book = 6,\n /** A button useful for purchase experiences that include other payment buttons that start with “Check out”. */\n Checkout = 5,\n /** A button used by approved nonprofit organization that lets people make donations. */\n Donate = 4,\n /** A button useful for placing orders for such as like meals or flowers. */\n Order = 11,\n /** A button useful for purchasing a subscription such as a gym membership or meal-kit delivery service. */\n Subscribe = 7,\n /** iOS only. A button useful for prompting the user to set up a card. */\n SetUp = 2,\n /** iOS only. A button useful for paying bills or invoices. */\n InStore = 3,\n /** iOS only. A button useful for adding money to a card, account, or payment system.*/\n Reload = 8,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n AddMoney = 9,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n TopUp = 10,\n /** iOS only. A button useful for renting items such as cars or scooters. */\n Rent = 12,\n /** iOS only. A button useful supporting people give money to projects, causes, organizations, and other entities.*/\n Support = 13,\n /** iOS only. A button useful to help people contribute money to projects, causes, organizations, and other entities. */\n Contribute = 14,\n /** iOS only. A button useful useful for letting people tip for goods or services. */\n Tip = 15,\n /** iOS only. A button useful for general purchases. */\n Continue = 16,\n /** Android only. A button useful for general payments. */\n Pay = 1000,\n /** Android only. A plain white button with the Google Pay logo. Use when you show Google Pay as a payment option in your payment flows. */\n GooglePayMark = 1001,\n}\n\n/** iOS only. */\nexport enum ButtonStyle {\n /** A white button with black lettering. */\n White = 0,\n /** A white button with black lettering and a black outline. */\n WhiteOutline = 1,\n /** A black button with white lettering. */\n Black = 2,\n /** Default. A button that automatically changes its appearance when the user switches between Light Mode and Dark Mode. */\n Automatic = 3,\n}\n\n/** iOS only. */\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\n/** iOS only. */\nexport enum PaymentType {\n Deferred = 'Deferred',\n Immediate = 'Immediate',\n Recurring = 'Recurring',\n}\n\n/** iOS only. Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */\nexport type DeferredCartSummaryItem = {\n paymentType: PaymentType.Deferred;\n /** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */\n deferredDate: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n paymentType: PaymentType.Immediate;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/\nexport type RecurringCartSummaryItem = {\n paymentType: PaymentType.Recurring;\n /** The amount of time – in calendar units such as Day, Month, or Year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalUnit: IntervalUnit;\n /** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalCount: number;\n /** The unix timestamp of the start date. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date. Measured in seconds. */\n endDate?: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. */\nexport enum IntervalUnit {\n Minute = 'minute',\n Hour = 'hour',\n Day = 'day',\n Month = 'month',\n Year = 'year',\n}\n\n/** iOS only. */\nexport type ShippingMethod = {\n /** A short, localized description. */\n label: string;\n /** The cost associated with this shipping option. */\n amount: string;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n /** A unique identifier for the shipping method. */\n identifier: string;\n /** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */\n detail?: string;\n /** The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n endDate?: number;\n};\n\n/** iOS only. */\nexport type ShippingContact = ApplePayShippingContact;\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = IsSupportedParams;\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type TokenResult =\n | {\n token: Token;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n"],"mappings":"iUAsBYA,uBAAsB,iEAAtBA,sBAAsB,EAAtBA,sBAAsB,oDAAtBA,sBAAsB,gEAAtBA,sBAAsB,0CAAtBA,sBAAsB,6CAAtBA,sBAAsB,kCAAtBA,sBAAsB,SAOtBC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,gCAAZA,YAAY,gBAAZA,YAAY,8BAAZA,YAAY,gCAAZA,YAAY,qCAAZA,YAAY,wBAAZA,YAAY,SAQZC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,oBAApBA,oBAAoB,gBAApBA,oBAAoB,kDAApBA,oBAAoB,kBAApBA,oBAAoB,4BAApBA,oBAAoB,sBAApBA,oBAAoB,8BAApBA,oBAAoB,iCAApBA,oBAAoB,gCAApBA,oBAAoB,SAyCpBC,2BAA0B,yEAA1BA,0BAA0B,EAA1BA,0BAA0B,8BAA1BA,0BAA0B,oCAA1BA,0BAA0B,qCAA1BA,0BAA0B,sCAA1BA,0BAA0B,SAU1BC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,wBAApBA,oBAAoB,wBAApBA,oBAAoB,8BAApBA,oBAAoB,qCAApBA,oBAAoB,gCAApBA,oBAAoB,SAsDpBC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,gBAApBA,oBAAoB,iBAApBA,oBAAoB,gCAApBA,oBAAoB,SAqBpBC,WAAU,yCAAVA,UAAU,EAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,iBAAVA,UAAU,CAAVA,UAAU,mBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,6BAAVA,UAAU,CAAVA,UAAU,qBAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,0BAAVA,UAAU,CAAVA,UAAU,gCAAVA,UAAU,CAAVA,UAAU,kBAAVA,UAAU,CAAVA,UAAU,4BAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,2CAAVA,UAAU,sBAAVA,UAAU,SA0CVC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,mCAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,gCAAXA,WAAW,uBAAXA,WAAW,SAkBXC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,wBAAXA,WAAW,0BAAXA,WAAW,6BAAXA,WAAW,uBAAXA,WAAW,SAwCXC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,oBAAZA,YAAY,gBAAZA,YAAY,cAAZA,YAAY,kBAAZA,YAAY,mBAAZA,YAAY,wBAAZA,YAAY"}
1
+ {"version":3,"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","PaymentRequestType","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"sources":["PlatformPay.ts"],"sourcesContent":["import type { Result as Token } from './Token';\nimport type { Result as PaymentMethod } from './PaymentMethod';\nimport type { Result as PaymentIntent } from './PaymentIntent';\nimport type { Result as SetupIntent } from './SetupIntent';\nimport type { StripeError, PlatformPayError } from './Errors';\nimport type { ShippingContact as ApplePayShippingContact } from './ApplePay';\nimport type { IsSupportedParams } from './GooglePay';\n\nexport type ApplePaySheetError =\n | {\n errorType: ApplePaySheetErrorType.InvalidShippingAddress;\n field: InvalidShippingField;\n message?: string;\n }\n | {\n errorType:\n | ApplePaySheetErrorType.UnserviceableShippingAddress\n | ApplePaySheetErrorType.InvalidCouponCode\n | ApplePaySheetErrorType.ExpiredCouponCode;\n message?: string;\n };\n\nexport enum ApplePaySheetErrorType {\n InvalidShippingAddress = 'InvalidShippingAddress',\n UnserviceableShippingAddress = 'UnserviceableShippingAddress',\n InvalidCouponCode = 'InvalidCouponCode',\n ExpiredCouponCode = 'ExpiredCouponCode',\n}\n\nexport enum ContactField {\n EmailAddress = 'emailAddress',\n Name = 'name',\n PhoneNumber = 'phoneNumber',\n PhoneticName = 'phoneticName',\n PostalAddress = 'postalAddress',\n}\n\nexport enum InvalidShippingField {\n Street = 'street',\n City = 'city',\n SubAdministrativeArea = 'subAdministrativeArea',\n State = 'state',\n PostalCode = 'postalCode',\n Country = 'country',\n CountryCode = 'countryCode',\n SubLocality = 'subLocality',\n}\n\nexport type ApplePayBaseParams = {\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: [\"JCB\", \"barcode\", \"chinaUnionPay\"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. */\n additionalEnabledNetworks?: Array<string>;\n /** The list of items that describe a purchase. For example: total, tax, discount, and grand total. */\n cartItems: Array<CartSummaryItem>;\n /** The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.*/\n requiredShippingAddressFields?: Array<ContactField>;\n /** The list of fields that you need for a billing contact in order to process the transaction. */\n requiredBillingContactFields?: Array<ContactField>;\n /** An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. */\n shippingMethods?: Array<ShippingMethod>;\n /** Set the payment capabilities you support. If set, 3DS is required. */\n merchantCapabilities?: Array<ApplePayMerchantCapability>;\n /** An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.*/\n shippingType?: ApplePayShippingType;\n /** A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. */\n supportedCountries?: Array<string>;\n};\n\nexport type ApplePayConfirmParams = {\n /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */\n request?:\n | RecurringPaymentRequest\n | AutomaticReloadPaymentRequest\n | MultiMerchantRequest;\n};\n\nexport enum PaymentRequestType {\n Recurring = 'Recurring',\n AutomaticReload = 'AutomaticReload',\n MultiMerchant = 'MultiMerchant',\n}\n\n/** Use this for a recurring payment, typically a subscription. */\nexport type RecurringPaymentRequest = {\n type: PaymentRequestType.Recurring;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** The regular billing cycle for the payment, including start and end dates, an interval, and an interval count. */\n billing: RecurringCartSummaryItem;\n /** Same as the billing property, but use this if the purchase has a trial period. */\n trialBilling?: RecurringCartSummaryItem;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this for an automatic reload or refill payment, such as a store card top-up. */\nexport type AutomaticReloadPaymentRequest = {\n type: PaymentRequestType.AutomaticReload;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** A short, localized description of the item. */\n label: string;\n /** This is the amount that is automatically applied to the account when the account balance drops below the threshold amount. */\n reloadAmount: string;\n /** The balance an account reaches before you apply the automatic reload amount. */\n thresholdAmount: string;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this to indicate payments for multiple merchants. */\nexport type MultiMerchantRequest = {\n type: PaymentRequestType.MultiMerchant;\n merchants: Array<{\n /** The Apple Pay merchant identifier. */\n merchantIdentifier: string;\n /** An external identifier for the merchant. */\n externalIdentifier: string;\n /** The merchant’s display name that the Apple Pay server associates with the payment token. */\n merchantName: string;\n /** The merchant’s top-level domain that the Apple Pay server associates with the payment token. */\n merchantDomain?: string;\n /** The amount to authorize for the payment token. */\n amount: string;\n }>;\n};\n\nexport type ApplePayPaymentMethodParams = {\n /** Set this value to true to display the coupon code field, or pass the 'couponCode' field to autofill with a coupon code. Defaults to false. If true, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n supportsCouponCode?: boolean;\n /** Set this value to autofill with a coupon code. If provided, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n couponCode?: string;\n};\n\nexport enum ApplePayMerchantCapability {\n /** Required. This value must be supplied. */\n Supports3DS = 'supports3DS',\n /** Optional. If present, only transactions that are categorized as credit cards are allowed. */\n SupportsCredit = 'supportsCredit',\n /** Optional. If present, only transactions that are categorized as debit cards are allowed. */\n SupportsDebit = 'supportsDebit',\n}\n\n/** A type that indicates how to ship purchased items. */\nexport enum ApplePayShippingType {\n /** Default. */\n Shipping = 'shipping',\n Delivery = 'delivery',\n StorePickup = 'storePickup',\n ServicePickup = 'servicePickup',\n}\n\nexport type GooglePayBaseParams = {\n /**\n * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK.\n - Does not require the application to be uploaded to the Google Play Store.\n - Does not require a Google Pay Developer Profile.\n - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.\n - The user will see a warning message that the app is not recognized/verified.\n */\n testEnv: boolean;\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** Your merchant name, displayed in the Google Pay sheet. */\n merchantName?: string;\n /** Set to true to request an email address. Defaults to false. */\n isEmailRequired?: boolean;\n /** Set to false if you don't support credit cards. Defaults to true. */\n allowCreditCards?: boolean;\n /** If true, Google Pay is considered \"available\" if the customer's Google Pay wallet has an existing payment method. Defaults to false. */\n existingPaymentMethodRequired?: boolean;\n /** Describes the configuration for billing address collection in the Google Pay sheet. */\n billingAddressConfig?: {\n /** Set to true if billing address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */\n format?: BillingAddressFormat;\n };\n};\n\nexport type GooglePayPaymentMethodParams = {\n /** Total monetary value of the transaction. */\n amount: number;\n /** Describes the configuration for shipping address collection in the Google Pay sheet. */\n shippingAddressConfig?: {\n /** Set to true if shipping address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Set of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. Defaults to all shipping address countries. */\n allowedCountryCodes?: Array<string>;\n };\n};\n\nexport enum BillingAddressFormat {\n /** Collect name, street address, locality, region, country code, and postal code. */\n Full = 'FULL',\n /** Collect name, country code, and postal code (default). */\n Min = 'MIN',\n}\n\nexport type PaymentMethodParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams & GooglePayPaymentMethodParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;\n};\n\nexport type ConfirmParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams & ApplePayConfirmParams;\n};\n\nexport enum ButtonType {\n /** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */\n Default = 0,\n /** A button useful for product purchases. */\n Buy = 1,\n /** A button useful for booking trips, flights, or other experiences. */\n Book = 6,\n /** A button useful for purchase experiences that include other payment buttons that start with “Check out”. */\n Checkout = 5,\n /** A button used by approved nonprofit organization that lets people make donations. */\n Donate = 4,\n /** A button useful for placing orders for such as like meals or flowers. */\n Order = 11,\n /** A button useful for purchasing a subscription such as a gym membership or meal-kit delivery service. */\n Subscribe = 7,\n /** iOS only. A button useful for prompting the user to set up a card. */\n SetUp = 2,\n /** iOS only. A button useful for paying bills or invoices. */\n InStore = 3,\n /** iOS only. A button useful for adding money to a card, account, or payment system.*/\n Reload = 8,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n AddMoney = 9,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n TopUp = 10,\n /** iOS only. A button useful for renting items such as cars or scooters. */\n Rent = 12,\n /** iOS only. A button useful supporting people give money to projects, causes, organizations, and other entities.*/\n Support = 13,\n /** iOS only. A button useful to help people contribute money to projects, causes, organizations, and other entities. */\n Contribute = 14,\n /** iOS only. A button useful useful for letting people tip for goods or services. */\n Tip = 15,\n /** iOS only. A button useful for general purchases. */\n Continue = 16,\n /** Android only. A button useful for general payments. */\n Pay = 1000,\n /** Android only. A plain white button with the Google Pay logo. Use when you show Google Pay as a payment option in your payment flows. */\n GooglePayMark = 1001,\n}\n\n/** iOS only. */\nexport enum ButtonStyle {\n /** A white button with black lettering. */\n White = 0,\n /** A white button with black lettering and a black outline. */\n WhiteOutline = 1,\n /** A black button with white lettering. */\n Black = 2,\n /** Default. A button that automatically changes its appearance when the user switches between Light Mode and Dark Mode. */\n Automatic = 3,\n}\n\n/** iOS only. */\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\n/** iOS only. */\nexport enum PaymentType {\n Deferred = 'Deferred',\n Immediate = 'Immediate',\n Recurring = 'Recurring',\n}\n\n/** iOS only. Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */\nexport type DeferredCartSummaryItem = {\n paymentType: PaymentType.Deferred;\n /** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */\n deferredDate: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n paymentType: PaymentType.Immediate;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/\nexport type RecurringCartSummaryItem = {\n paymentType: PaymentType.Recurring;\n /** The amount of time – in calendar units such as Day, Month, or Year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalUnit: IntervalUnit;\n /** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalCount: number;\n /** The unix timestamp of the start date. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date. Measured in seconds. */\n endDate?: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. */\nexport enum IntervalUnit {\n Minute = 'minute',\n Hour = 'hour',\n Day = 'day',\n Month = 'month',\n Year = 'year',\n}\n\n/** iOS only. */\nexport type ShippingMethod = {\n /** A short, localized description. */\n label: string;\n /** The cost associated with this shipping option. */\n amount: string;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n /** A unique identifier for the shipping method. */\n identifier: string;\n /** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */\n detail?: string;\n /** The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n endDate?: number;\n};\n\n/** iOS only. */\nexport type ShippingContact = ApplePayShippingContact;\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = IsSupportedParams;\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type TokenResult =\n | {\n token: Token;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n"],"mappings":"4VAsBYA,uBAAsB,iEAAtBA,sBAAsB,EAAtBA,sBAAsB,oDAAtBA,sBAAsB,gEAAtBA,sBAAsB,0CAAtBA,sBAAsB,6CAAtBA,sBAAsB,kCAAtBA,sBAAsB,SAOtBC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,gCAAZA,YAAY,gBAAZA,YAAY,8BAAZA,YAAY,gCAAZA,YAAY,qCAAZA,YAAY,wBAAZA,YAAY,SAQZC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,oBAApBA,oBAAoB,gBAApBA,oBAAoB,kDAApBA,oBAAoB,kBAApBA,oBAAoB,4BAApBA,oBAAoB,sBAApBA,oBAAoB,8BAApBA,oBAAoB,iCAApBA,oBAAoB,gCAApBA,oBAAoB,SA0CpBC,mBAAkB,yDAAlBA,kBAAkB,EAAlBA,kBAAkB,0BAAlBA,kBAAkB,sCAAlBA,kBAAkB,qCAAlBA,kBAAkB,8BAAlBA,kBAAkB,SAsElBC,2BAA0B,yEAA1BA,0BAA0B,EAA1BA,0BAA0B,8BAA1BA,0BAA0B,oCAA1BA,0BAA0B,qCAA1BA,0BAA0B,sCAA1BA,0BAA0B,SAU1BC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,wBAApBA,oBAAoB,wBAApBA,oBAAoB,8BAApBA,oBAAoB,qCAApBA,oBAAoB,gCAApBA,oBAAoB,SAsDpBC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,gBAApBA,oBAAoB,iBAApBA,oBAAoB,gCAApBA,oBAAoB,SAqBpBC,WAAU,yCAAVA,UAAU,EAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,iBAAVA,UAAU,CAAVA,UAAU,mBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,6BAAVA,UAAU,CAAVA,UAAU,qBAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,0BAAVA,UAAU,CAAVA,UAAU,gCAAVA,UAAU,CAAVA,UAAU,kBAAVA,UAAU,CAAVA,UAAU,4BAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,2CAAVA,UAAU,sBAAVA,UAAU,SA0CVC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,mCAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,gCAAXA,WAAW,uBAAXA,WAAW,SAkBXC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,wBAAXA,WAAW,0BAAXA,WAAW,6BAAXA,WAAW,uBAAXA,WAAW,SAwCXC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,oBAAZA,YAAY,gBAAZA,YAAY,cAAZA,YAAY,kBAAZA,YAAY,mBAAZA,YAAY,wBAAZA,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ApplePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';\nimport type { ShippingMethod, ShippingContact } from '../PlatformPay';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n disabled?: boolean;\n type?: number;\n buttonStyle?: number;\n borderRadius?: number;\n onPressAction?(): void;\n onShippingMethodSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => void;\n onShippingContactSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => void;\n onCouponCodeEnteredAction?: (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => void;\n}\n\nexport type Type =\n | 'plain'\n | 'buy'\n | 'setUp'\n | 'inStore'\n | 'donate'\n | 'checkout'\n | 'book'\n | 'subscribe'\n | 'reload'\n | 'addMoney'\n | 'topUp'\n | 'order'\n | 'rent'\n | 'support'\n | 'contribute'\n | 'tip'\n | 'continue';\n\nexport type Style = 'white' | 'whiteOutline' | 'black' | 'automatic';\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["ApplePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';\nimport type { ShippingMethod, ShippingContact } from '../PlatformPay';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n disabled?: boolean;\n type?: number;\n buttonStyle?: number;\n borderRadius?: number;\n onPressAction?(): void;\n onShippingMethodSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => void;\n onShippingContactSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => void;\n onCouponCodeEnteredAction?: (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => void;\n onOrderTrackingAction?: () => void;\n}\n\nexport type Type =\n | 'plain'\n | 'buy'\n | 'setUp'\n | 'inStore'\n | 'donate'\n | 'checkout'\n | 'book'\n | 'subscribe'\n | 'reload'\n | 'addMoney'\n | 'topUp'\n | 'order'\n | 'rent'\n | 'support'\n | 'contribute'\n | 'tip'\n | 'continue';\n\nexport type Style = 'white' | 'whiteOutline' | 'black' | 'automatic';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PlatformPay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n presentPaymentSheet(): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n isPlatformPaySupported(params: {\n googlePay?: GooglePay.IsSupportedParams;\n }): Promise<boolean>;\n createPlatformPayPaymentMethod(\n params: PlatformPay.PaymentMethodParams,\n usesDeprecatedTokenFlow: boolean\n ): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;\n dismissPlatformPay(): Promise<boolean>;\n updatePlatformPaySheet(\n summaryItems: Array<ApplePay.CartSummaryItem>,\n shippingMethods: Array<ApplePay.ShippingMethod>,\n errors: Array<PlatformPay.ApplePaySheetError>\n ): Promise<void>;\n confirmPlatformPay(\n clientSecret: string,\n params: PlatformPay.ConfirmParams,\n isPaymentIntent: boolean\n ): Promise<\n PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult\n >;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"],"mappings":"gFAAA,yCAmIA,GAAQA,UAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,aAErBA,SAAS"}
1
+ {"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PlatformPay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n initPaymentSheetWithOrderTracking(\n params: PaymentSheet.SetupParams,\n callback?: () => void\n ): Promise<InitPaymentSheetResult>;\n presentPaymentSheet(\n options: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n isPlatformPaySupported(params: {\n googlePay?: GooglePay.IsSupportedParams;\n }): Promise<boolean>;\n createPlatformPayPaymentMethod(\n params: PlatformPay.PaymentMethodParams,\n usesDeprecatedTokenFlow: boolean\n ): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;\n dismissPlatformPay(): Promise<boolean>;\n updatePlatformPaySheet(\n summaryItems: Array<ApplePay.CartSummaryItem>,\n shippingMethods: Array<ApplePay.ShippingMethod>,\n errors: Array<PlatformPay.ApplePaySheetError>\n ): Promise<void>;\n confirmPlatformPay(\n clientSecret: string,\n params: PlatformPay.ConfirmParams,\n isPaymentIntent: boolean\n ): Promise<\n PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult\n >;\n configureOrderTracking(\n orderTypeIdentifier: string,\n orderIdentifier: string,\n webServiceUrl: string,\n authenticationToken: string\n ): Promise<void>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"],"mappings":"gFAAA,yCA+IA,GAAQA,UAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,aAErBA,SAAS"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;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 _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:disabled?styles.disabled:styles.notDisabled,__self:this,__source:{fileName:_jsxFileName,lineNumber:123,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:130,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:141,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.3},notDisabled:{flex:0}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;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 _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:144,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:151,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
2
2
  //# sourceMappingURL=PlatformPayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PlatformPayButton","type","ButtonType","Default","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","props","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","styles","notDisabled","Platform","OS","StyleSheet","create","flex","opacity"],"sources":["PlatformPayButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n TouchableOpacity,\n StyleSheet,\n Platform,\n NativeSyntheticEvent,\n} from 'react-native';\nimport {\n ButtonType,\n ButtonStyle,\n ShippingMethod,\n ShippingContact,\n} from '../types/PlatformPay';\nimport GooglePayButtonNative from './GooglePayButtonNative';\nimport ApplePayButtonNative from './ApplePayButtonNative';\n\n/**\n * PlatformPayButton Component Props\n */\nexport interface Props extends AccessibilityProps {\n /** Sets the text displayed by the button. */\n type?: ButtonType;\n /** iOS only. Sets the coloring of the button. */\n appearance?: ButtonStyle;\n /** iOS only. Sets the border radius of the button. */\n borderRadius?: number;\n /** Function called whenever the button is pressed. */\n onPress(): void;\n /** Set to `true` to disable the button from being pressed & apply a slight opacity to indicate that it is unpressable. Defaults to false. */\n disabled?: boolean;\n /**\n * This callback is triggered whenever the user selects a shipping method in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingMethod` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingMethodSelected?: (event: {\n shippingMethod: ShippingMethod;\n }) => void;\n /**\n * This callback is triggered whenever the user selects a shipping contact in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingContact` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingContactSelected?: (event: {\n shippingContact: ShippingContact;\n }) => void;\n /**\n * This callback is triggered whenever the user inputs a coupon code in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `couponCode` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onCouponCodeEntered?: (event: { couponCode: string }) => void;\n testID?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * PlatformPayButton Component. Display the platform-specific native wallet pay button: Apple Pay on iOS, and Google Pay on Android.\n *\n * @example\n * ```ts\n * <PlatformPayButton\n * onPress={pay}\n * type={PlatformPay.ButtonType.Subscribe}\n * appearance={PlatformPay.ButtonStyle.WhiteOutline}\n * borderRadius={4}\n * disabled={!isApplePaySupported}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function PlatformPayButton({\n type = ButtonType.Default,\n appearance = ButtonStyle.Automatic,\n onPress,\n disabled,\n borderRadius,\n onShippingMethodSelected,\n onShippingContactSelected,\n onCouponCodeEntered,\n ...props\n}: Props) {\n const shippingMethodCallback = onShippingMethodSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => {\n onShippingMethodSelected && onShippingMethodSelected(value.nativeEvent);\n }\n : undefined;\n\n const shippingContactCallback = onShippingContactSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => {\n onShippingContactSelected(value.nativeEvent);\n }\n : undefined;\n\n const couponCodeCallback = onCouponCodeEntered\n ? (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => {\n onCouponCodeEntered && onCouponCodeEntered(value.nativeEvent);\n }\n : undefined;\n\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={disabled ? 0.3 : 1}\n onPress={onPress}\n style={disabled ? styles.disabled : styles.notDisabled}\n >\n {Platform.OS === 'ios' ? (\n <ApplePayButtonNative\n type={type}\n buttonStyle={appearance}\n borderRadius={borderRadius}\n disabled={disabled}\n onShippingMethodSelectedAction={shippingMethodCallback}\n onShippingContactSelectedAction={shippingContactCallback}\n onCouponCodeEnteredAction={couponCodeCallback}\n {...props}\n />\n ) : (\n <GooglePayButtonNative type={type} {...props} />\n )}\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n flex: 0,\n opacity: 0.3,\n },\n notDisabled: {\n flex: 0,\n },\n});\n"],"mappings":"wXAAA,oDACA,yCASA,iDAMA,sFACA,oFAA0D,6PA+DnD,QAASA,kBAAiB,MAUvB,oBATRC,IAAI,CAAJA,IAAI,oBAAGC,uBAAU,CAACC,OAAO,gCACzBC,UAAU,CAAVA,UAAU,0BAAGC,wBAAW,CAACC,SAAS,iBAClCC,OAAO,MAAPA,OAAO,CACPC,QAAQ,MAARA,QAAQ,CACRC,YAAY,MAAZA,YAAY,CACZC,wBAAwB,MAAxBA,wBAAwB,CACxBC,yBAAyB,MAAzBA,yBAAyB,CACzBC,mBAAmB,MAAnBA,mBAAmB,CAChBC,KAAK,uDAER,GAAMC,uBAAsB,CAAGJ,wBAAwB,CACnD,SACEK,KAEE,CACC,CACHL,wBAAwB,EAAIA,wBAAwB,CAACK,KAAK,CAACC,WAAW,CAAC,CACzE,CAAC,CACDC,SAAS,CAEb,GAAMC,wBAAuB,CAAGP,yBAAyB,CACrD,SACEI,KAEE,CACC,CACHJ,yBAAyB,CAACI,KAAK,CAACC,WAAW,CAAC,CAC9C,CAAC,CACDC,SAAS,CAEb,GAAME,mBAAkB,CAAGP,mBAAmB,CAC1C,SACEG,KAEE,CACC,CACHH,mBAAmB,EAAIA,mBAAmB,CAACG,KAAK,CAACC,WAAW,CAAC,CAC/D,CAAC,CACDC,SAAS,CAEb,MACE,8BAAC,6BAAgB,EACf,QAAQ,CAAET,QAAS,CACnB,aAAa,CAAEA,QAAQ,CAAG,GAAG,CAAG,CAAE,CAClC,OAAO,CAAED,OAAQ,CACjB,KAAK,CAAEC,QAAQ,CAAGY,MAAM,CAACZ,QAAQ,CAAGY,MAAM,CAACC,WAAY,6EAEtDC,qBAAQ,CAACC,EAAE,GAAK,KAAK,CACpB,6BAAC,6BAAoB,wBACnB,IAAI,CAAEtB,IAAK,CACX,WAAW,CAAEG,UAAW,CACxB,YAAY,CAAEK,YAAa,CAC3B,QAAQ,CAAED,QAAS,CACnB,8BAA8B,CAAEM,sBAAuB,CACvD,+BAA+B,CAAEI,uBAAwB,CACzD,yBAAyB,CAAEC,kBAAmB,EAC1CN,KAAK,+EACT,CAEF,6BAAC,8BAAqB,wBAAC,IAAI,CAAEZ,IAAK,EAAKY,KAAK,+EAC7C,CACgB,CAEvB,CAEA,GAAMO,OAAM,CAAGI,uBAAU,CAACC,MAAM,CAAC,CAC/BjB,QAAQ,CAAE,CACRkB,IAAI,CAAE,CAAC,CACPC,OAAO,CAAE,GACX,CAAC,CACDN,WAAW,CAAE,CACXK,IAAI,CAAE,CACR,CACF,CAAC,CAAC"}
1
+ {"version":3,"names":["PlatformPayButton","type","ButtonType","Default","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style","props","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","orderTrackingCallback","NativeStripeSdk","configureOrderTracking","styles","notDisabled","Platform","OS","nativeButtonStyle","StyleSheet","create","flex","opacity"],"sources":["PlatformPayButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n TouchableOpacity,\n StyleSheet,\n Platform,\n NativeSyntheticEvent,\n} from 'react-native';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n ButtonType,\n ButtonStyle,\n ShippingMethod,\n ShippingContact,\n} from '../types/PlatformPay';\nimport GooglePayButtonNative from './GooglePayButtonNative';\nimport ApplePayButtonNative from './ApplePayButtonNative';\n\n/**\n * PlatformPayButton Component Props\n */\nexport interface Props extends AccessibilityProps {\n /** Sets the text displayed by the button. */\n type?: ButtonType;\n /** iOS only. Sets the coloring of the button. */\n appearance?: ButtonStyle;\n /** iOS only. Sets the border radius of the button. */\n borderRadius?: number;\n /** Function called whenever the button is pressed. */\n onPress(): void;\n /** Set to `true` to disable the button from being pressed & apply a slight opacity to indicate that it is unpressable. Defaults to false. */\n disabled?: boolean;\n /**\n * This callback is triggered whenever the user selects a shipping method in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingMethod` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingMethodSelected?: (event: {\n shippingMethod: ShippingMethod;\n }) => void;\n /**\n * This callback is triggered whenever the user selects a shipping contact in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingContact` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingContactSelected?: (event: {\n shippingContact: ShippingContact;\n }) => void;\n /**\n * This callback is triggered whenever the user inputs a coupon code in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `couponCode` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onCouponCodeEntered?: (event: { couponCode: string }) => void;\n /** Callback function for setting the order details (retrieved from your server) to give users the\n * ability to track and manage their purchases in Wallet. Stripe calls your implementation after the\n * payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion`\n * function, or else the Apple Pay sheet will hang.*/\n setOrderTracking?: (\n completion: (\n orderIdentifier: string,\n orderTypeIdentifier: string,\n authenticationToken: string,\n webServiceUrl: string\n ) => void\n ) => void;\n testID?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * PlatformPayButton Component. Display the platform-specific native wallet pay button: Apple Pay on iOS, and Google Pay on Android.\n *\n * @example\n * ```ts\n * <PlatformPayButton\n * onPress={pay}\n * type={PlatformPay.ButtonType.Subscribe}\n * appearance={PlatformPay.ButtonStyle.WhiteOutline}\n * borderRadius={4}\n * disabled={!isApplePaySupported}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function PlatformPayButton({\n type = ButtonType.Default,\n appearance = ButtonStyle.Automatic,\n onPress,\n disabled,\n borderRadius,\n onShippingMethodSelected,\n onShippingContactSelected,\n onCouponCodeEntered,\n setOrderTracking,\n style,\n ...props\n}: Props) {\n const shippingMethodCallback = onShippingMethodSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => {\n onShippingMethodSelected && onShippingMethodSelected(value.nativeEvent);\n }\n : undefined;\n\n const shippingContactCallback = onShippingContactSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => {\n onShippingContactSelected(value.nativeEvent);\n }\n : undefined;\n\n const couponCodeCallback = onCouponCodeEntered\n ? (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => {\n onCouponCodeEntered && onCouponCodeEntered(value.nativeEvent);\n }\n : undefined;\n\n const orderTrackingCallback = setOrderTracking\n ? () => {\n setOrderTracking(NativeStripeSdk.configureOrderTracking);\n }\n : undefined;\n\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={disabled ? 0.3 : 1}\n onPress={onPress}\n style={[disabled ? styles.disabled : styles.notDisabled, style]}\n >\n {Platform.OS === 'ios' ? (\n <ApplePayButtonNative\n type={type}\n buttonStyle={appearance}\n borderRadius={borderRadius}\n disabled={disabled}\n onShippingMethodSelectedAction={shippingMethodCallback}\n onShippingContactSelectedAction={shippingContactCallback}\n onCouponCodeEnteredAction={couponCodeCallback}\n onOrderTrackingAction={orderTrackingCallback}\n style={styles.nativeButtonStyle}\n {...props}\n />\n ) : (\n <GooglePayButtonNative\n type={type}\n style={styles.nativeButtonStyle}\n {...props}\n />\n )}\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n flex: 0,\n opacity: 0.4,\n },\n notDisabled: {\n flex: 0,\n },\n nativeButtonStyle: { flex: 1 },\n});\n"],"mappings":"wXAAA,oDACA,yCASA,2EACA,iDAMA,sFACA,oFAA0D,wRA2EnD,QAASA,kBAAiB,MAYvB,oBAXRC,IAAI,CAAJA,IAAI,oBAAGC,uBAAU,CAACC,OAAO,gCACzBC,UAAU,CAAVA,UAAU,0BAAGC,wBAAW,CAACC,SAAS,iBAClCC,OAAO,MAAPA,OAAO,CACPC,QAAQ,MAARA,QAAQ,CACRC,YAAY,MAAZA,YAAY,CACZC,wBAAwB,MAAxBA,wBAAwB,CACxBC,yBAAyB,MAAzBA,yBAAyB,CACzBC,mBAAmB,MAAnBA,mBAAmB,CACnBC,gBAAgB,MAAhBA,gBAAgB,CAChBC,KAAK,MAALA,KAAK,CACFC,KAAK,uDAER,GAAMC,uBAAsB,CAAGN,wBAAwB,CACnD,SACEO,KAEE,CACC,CACHP,wBAAwB,EAAIA,wBAAwB,CAACO,KAAK,CAACC,WAAW,CAAC,CACzE,CAAC,CACDC,SAAS,CAEb,GAAMC,wBAAuB,CAAGT,yBAAyB,CACrD,SACEM,KAEE,CACC,CACHN,yBAAyB,CAACM,KAAK,CAACC,WAAW,CAAC,CAC9C,CAAC,CACDC,SAAS,CAEb,GAAME,mBAAkB,CAAGT,mBAAmB,CAC1C,SACEK,KAEE,CACC,CACHL,mBAAmB,EAAIA,mBAAmB,CAACK,KAAK,CAACC,WAAW,CAAC,CAC/D,CAAC,CACDC,SAAS,CAEb,GAAMG,sBAAqB,CAAGT,gBAAgB,CAC1C,UAAM,CACJA,gBAAgB,CAACU,wBAAe,CAACC,sBAAsB,CAAC,CAC1D,CAAC,CACDL,SAAS,CAEb,MACE,8BAAC,6BAAgB,EACf,QAAQ,CAAEX,QAAS,CACnB,aAAa,CAAEA,QAAQ,CAAG,GAAG,CAAG,CAAE,CAClC,OAAO,CAAED,OAAQ,CACjB,KAAK,CAAE,CAACC,QAAQ,CAAGiB,MAAM,CAACjB,QAAQ,CAAGiB,MAAM,CAACC,WAAW,CAAEZ,KAAK,CAAE,6EAE/Da,qBAAQ,CAACC,EAAE,GAAK,KAAK,CACpB,6BAAC,6BAAoB,wBACnB,IAAI,CAAE3B,IAAK,CACX,WAAW,CAAEG,UAAW,CACxB,YAAY,CAAEK,YAAa,CAC3B,QAAQ,CAAED,QAAS,CACnB,8BAA8B,CAAEQ,sBAAuB,CACvD,+BAA+B,CAAEI,uBAAwB,CACzD,yBAAyB,CAAEC,kBAAmB,CAC9C,qBAAqB,CAAEC,qBAAsB,CAC7C,KAAK,CAAEG,MAAM,CAACI,iBAAkB,EAC5Bd,KAAK,+EACT,CAEF,6BAAC,8BAAqB,wBACpB,IAAI,CAAEd,IAAK,CACX,KAAK,CAAEwB,MAAM,CAACI,iBAAkB,EAC5Bd,KAAK,+EAEZ,CACgB,CAEvB,CAEA,GAAMU,OAAM,CAAGK,uBAAU,CAACC,MAAM,CAAC,CAC/BvB,QAAQ,CAAE,CACRwB,IAAI,CAAE,CAAC,CACPC,OAAO,CAAE,GACX,CAAC,CACDP,WAAW,CAAE,CACXM,IAAI,CAAE,CACR,CAAC,CACDH,iBAAiB,CAAE,CAAEG,IAAI,CAAE,CAAE,CAC/B,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updatePlatformPaySheet=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openPlatformPaySetup=exports.openApplePaySetup=exports.isPlatformPaySupported=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.dismissPlatformPay=exports.createTokenForCVCUpdate=exports.createToken=exports.createPlatformPayToken=exports.createPlatformPayPaymentMethod=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPlatformPaySetupIntent=exports.confirmPlatformPayPayment=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.initPaymentSheet(params),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.presentPaymentSheet(),paymentOption=_yield$NativeStripeSd10.paymentOption,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var resetPaymentSheetCustomer=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(){return yield _NativeStripeSdk.default.resetPaymentSheetCustomer();});return function resetPaymentSheetCustomer(){return _ref22.apply(this,arguments);};}();exports.resetPaymentSheetCustomer=resetPaymentSheetCustomer;var isGooglePaySupported=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref23.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref24.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref25.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd14.error,paymentMethod=_yield$NativeStripeSd14.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref26.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref27.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref28=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref29=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref29.paymentIntent,error=_ref29.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref28.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref31=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref31.setupIntent,error=_ref31.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref30.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd16.session,token=_yield$NativeStripeSd16.token,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref32.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd17.session,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref33.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd18.canAddCard,details=_yield$NativeStripeSd18.details,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref34.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd19=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd19.isInWallet,token=_yield$NativeStripeSd19.token,error=_yield$NativeStripeSd19.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref35.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;var isPlatformPaySupported=function(){var _ref36=(0,_asyncToGenerator2.default)(function*(params){return yield _NativeStripeSdk.default.isPlatformPaySupported(params!=null?params:{});});return function isPlatformPaySupported(_x33){return _ref36.apply(this,arguments);};}();exports.isPlatformPaySupported=isPlatformPaySupported;var confirmPlatformPaySetupIntent=function(){var _ref37=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref38=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,false),error=_ref38.error,setupIntent=_ref38.setupIntent;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmPlatformPaySetupIntent(_x34,_x35){return _ref37.apply(this,arguments);};}();exports.confirmPlatformPaySetupIntent=confirmPlatformPaySetupIntent;var confirmPlatformPayPayment=function(){var _ref39=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref40=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,true),error=_ref40.error,paymentIntent=_ref40.paymentIntent;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPlatformPayPayment(_x36,_x37){return _ref39.apply(this,arguments);};}();exports.confirmPlatformPayPayment=confirmPlatformPayPayment;var dismissPlatformPay=function(){var _ref41=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS!=='ios'){return false;}try{var didDismiss=yield _NativeStripeSdk.default.dismissPlatformPay();return didDismiss;}catch(error){return false;}});return function dismissPlatformPay(){return _ref41.apply(this,arguments);};}();exports.dismissPlatformPay=dismissPlatformPay;var createPlatformPayPaymentMethod=function(){var _ref42=(0,_asyncToGenerator2.default)(function*(params){try{var _ref43=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,false),error=_ref43.error,paymentMethod=_ref43.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPlatformPayPaymentMethod(_x38){return _ref42.apply(this,arguments);};}();exports.createPlatformPayPaymentMethod=createPlatformPayPaymentMethod;var createPlatformPayToken=function(){var _ref44=(0,_asyncToGenerator2.default)(function*(params){try{var _ref45=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,true),error=_ref45.error,token=_ref45.token;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createPlatformPayToken(_x39){return _ref44.apply(this,arguments);};}();exports.createPlatformPayToken=createPlatformPayToken;var updatePlatformPaySheet=function(){var _ref46=(0,_asyncToGenerator2.default)(function*(params){if(_reactNative.Platform.OS!=='ios'){return{};}try{yield _NativeStripeSdk.default.updatePlatformPaySheet(params.applePay.cartItems,params.applePay.shippingMethods,params.applePay.errors);return{};}catch(error){return{error:error};}});return function updatePlatformPaySheet(_x40){return _ref46.apply(this,arguments);};}();exports.updatePlatformPaySheet=updatePlatformPaySheet;var openPlatformPaySetup=function(){var _ref47=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='ios'){yield _NativeStripeSdk.default.openApplePaySetup();}});return function openPlatformPaySetup(){return _ref47.apply(this,arguments);};}();exports.openPlatformPaySetup=openPlatformPaySetup;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updatePlatformPaySheet=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openPlatformPaySetup=exports.openApplePaySetup=exports.isPlatformPaySupported=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.dismissPlatformPay=exports.createTokenForCVCUpdate=exports.createToken=exports.createPlatformPayToken=exports.createPlatformPayPaymentMethod=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPlatformPaySetupIntent=exports.confirmPlatformPayPayment=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){var _params$applePay;var result;var setOrderTracking=params==null?void 0:(_params$applePay=params.applePay)==null?void 0:_params$applePay.setOrderTracking;try{if(setOrderTracking&&_reactNative.Platform.OS==='ios'){result=yield _NativeStripeSdk.default.initPaymentSheetWithOrderTracking(params,function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);});}else{result=yield _NativeStripeSdk.default.initPaymentSheet(params);}if(result.error){return{error:result.error};}return{paymentOption:result.paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.presentPaymentSheet(options),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var resetPaymentSheetCustomer=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(){return yield _NativeStripeSdk.default.resetPaymentSheetCustomer();});return function resetPaymentSheetCustomer(){return _ref22.apply(this,arguments);};}();exports.resetPaymentSheetCustomer=resetPaymentSheetCustomer;var isGooglePaySupported=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref23.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref24.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref25.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd13.error,paymentMethod=_yield$NativeStripeSd13.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref26.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd14.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref27.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref28=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref29=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref29.paymentIntent,error=_ref29.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref28.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref31=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref31.setupIntent,error=_ref31.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref30.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd15.session,token=_yield$NativeStripeSd15.token,error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref32.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd16.session,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref33.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd17.canAddCard,details=_yield$NativeStripeSd17.details,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref34.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd18.isInWallet,token=_yield$NativeStripeSd18.token,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref35.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;var isPlatformPaySupported=function(){var _ref36=(0,_asyncToGenerator2.default)(function*(params){return yield _NativeStripeSdk.default.isPlatformPaySupported(params!=null?params:{});});return function isPlatformPaySupported(_x33){return _ref36.apply(this,arguments);};}();exports.isPlatformPaySupported=isPlatformPaySupported;var confirmPlatformPaySetupIntent=function(){var _ref37=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref38=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,false),error=_ref38.error,setupIntent=_ref38.setupIntent;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmPlatformPaySetupIntent(_x34,_x35){return _ref37.apply(this,arguments);};}();exports.confirmPlatformPaySetupIntent=confirmPlatformPaySetupIntent;var confirmPlatformPayPayment=function(){var _ref39=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref40=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,true),error=_ref40.error,paymentIntent=_ref40.paymentIntent;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPlatformPayPayment(_x36,_x37){return _ref39.apply(this,arguments);};}();exports.confirmPlatformPayPayment=confirmPlatformPayPayment;var dismissPlatformPay=function(){var _ref41=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS!=='ios'){return false;}try{var didDismiss=yield _NativeStripeSdk.default.dismissPlatformPay();return didDismiss;}catch(error){return false;}});return function dismissPlatformPay(){return _ref41.apply(this,arguments);};}();exports.dismissPlatformPay=dismissPlatformPay;var createPlatformPayPaymentMethod=function(){var _ref42=(0,_asyncToGenerator2.default)(function*(params){try{var _ref43=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,false),error=_ref43.error,paymentMethod=_ref43.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPlatformPayPaymentMethod(_x38){return _ref42.apply(this,arguments);};}();exports.createPlatformPayPaymentMethod=createPlatformPayPaymentMethod;var createPlatformPayToken=function(){var _ref44=(0,_asyncToGenerator2.default)(function*(params){try{var _ref45=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,true),error=_ref45.error,token=_ref45.token;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createPlatformPayToken(_x39){return _ref44.apply(this,arguments);};}();exports.createPlatformPayToken=createPlatformPayToken;var updatePlatformPaySheet=function(){var _ref46=(0,_asyncToGenerator2.default)(function*(params){if(_reactNative.Platform.OS!=='ios'){return{};}try{yield _NativeStripeSdk.default.updatePlatformPaySheet(params.applePay.cartItems,params.applePay.shippingMethods,params.applePay.errors);return{};}catch(error){return{error:error};}});return function updatePlatformPaySheet(_x40){return _ref46.apply(this,arguments);};}();exports.updatePlatformPaySheet=updatePlatformPaySheet;var openPlatformPaySetup=function(){var _ref47=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='ios'){yield _NativeStripeSdk.default.openApplePaySetup();}});return function openPlatformPaySetup(){return _ref47.apply(this,arguments);};}();exports.openPlatformPaySetup=openPlatformPaySetup;
2
2
  //# sourceMappingURL=functions.js.map