@stripe/stripe-react-native 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -68
- package/README.md +2 -2
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +0 -5
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +11 -27
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +35 -8
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +131 -6
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +42 -7
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +8 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +14 -1
- package/ios/ApplePayButtonView.swift +4 -18
- package/ios/ApplePayViewController.swift +1 -28
- package/ios/Mappers.swift +1 -0
- package/ios/StripeSdk+PaymentSheet.swift +100 -10
- package/ios/StripeSdk.m +22 -29
- package/ios/StripeSdk.swift +59 -85
- package/jest/mock.js +4 -6
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/ApplePayButtonNative.js.map +1 -1
- package/lib/commonjs/components/GooglePayButtonNative.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +1 -1
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/ApplePay.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/PushProvisioning.js.map +1 -1
- package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/ApplePayButtonNative.js.map +1 -1
- package/lib/module/components/GooglePayButtonNative.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/useFinancialConnectionsSheet.js +1 -1
- package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/ApplePay.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/PushProvisioning.js.map +1 -1
- package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +5 -15
- package/lib/typescript/src/components/ApplePayButtonNative.d.ts +1 -1
- package/lib/typescript/src/components/GooglePayButtonNative.d.ts +1 -1
- package/lib/typescript/src/functions.d.ts +15 -27
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +3 -18
- package/lib/typescript/src/index.d.ts +0 -7
- package/lib/typescript/src/types/ApplePay.d.ts +0 -52
- package/lib/typescript/src/types/PaymentIntent.d.ts +3 -2
- package/lib/typescript/src/types/PaymentSheet.d.ts +48 -2
- package/lib/typescript/src/types/PlatformPay.d.ts +34 -4
- package/lib/typescript/src/types/PushProvisioning.d.ts +9 -1
- package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +0 -1
- package/lib/typescript/src/types/index.d.ts +8 -4
- package/package.json +1 -1
- package/src/NativeStripeSdk.tsx +11 -31
- package/src/components/ApplePayButtonNative.tsx +1 -1
- package/src/components/GooglePayButtonNative.tsx +1 -1
- package/src/functions.ts +87 -197
- package/src/hooks/useFinancialConnectionsSheet.tsx +19 -13
- package/src/hooks/usePaymentSheet.tsx +25 -18
- package/src/hooks/useStripe.tsx +14 -108
- package/src/index.tsx +0 -7
- package/src/types/ApplePay.ts +0 -71
- package/src/types/PaymentIntent.ts +4 -2
- package/src/types/PaymentSheet.ts +86 -2
- package/src/types/PlatformPay.ts +35 -4
- package/src/types/PushProvisioning.ts +9 -1
- package/src/types/components/GooglePayButtonComponent.ts +0 -1
- package/src/types/index.ts +10 -6
- package/stripe-react-native.podspec +1 -1
- package/lib/commonjs/components/ApplePayButton.js +0 -2
- package/lib/commonjs/components/ApplePayButton.js.map +0 -1
- package/lib/commonjs/components/GooglePayButton.js +0 -2
- package/lib/commonjs/components/GooglePayButton.js.map +0 -1
- package/lib/commonjs/hooks/useApplePay.js +0 -2
- package/lib/commonjs/hooks/useApplePay.js.map +0 -1
- package/lib/commonjs/hooks/useGooglePay.js +0 -2
- package/lib/commonjs/hooks/useGooglePay.js.map +0 -1
- package/lib/commonjs/types/GooglePay.js +0 -2
- package/lib/commonjs/types/GooglePay.js.map +0 -1
- package/lib/module/components/ApplePayButton.js +0 -2
- package/lib/module/components/ApplePayButton.js.map +0 -1
- package/lib/module/components/GooglePayButton.js +0 -2
- package/lib/module/components/GooglePayButton.js.map +0 -1
- package/lib/module/hooks/useApplePay.js +0 -2
- package/lib/module/hooks/useApplePay.js.map +0 -1
- package/lib/module/hooks/useGooglePay.js +0 -2
- package/lib/module/hooks/useGooglePay.js.map +0 -1
- package/lib/module/types/GooglePay.js +0 -2
- package/lib/module/types/GooglePay.js.map +0 -1
- package/lib/typescript/src/components/ApplePayButton.d.ts +0 -31
- package/lib/typescript/src/components/GooglePayButton.d.ts +0 -26
- package/lib/typescript/src/hooks/useApplePay.d.ts +0 -54
- package/lib/typescript/src/hooks/useGooglePay.d.ts +0 -11
- package/lib/typescript/src/types/GooglePay.d.ts +0 -47
- package/src/components/ApplePayButton.tsx +0 -108
- package/src/components/GooglePayButton.tsx +0 -58
- package/src/hooks/useApplePay.tsx +0 -161
- package/src/hooks/useGooglePay.tsx +0 -72
- package/src/types/GooglePay.ts +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CollectionMode","AddressCollectionMode"],"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 /** Configuration for how billing details are collected during checkout. */\n billingDetailsCollectionConfiguration?: BillingDetailsCollectionConfiguration;\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\nexport type BillingDetailsCollectionConfiguration = {\n /** How to collect the name field. Defaults to `CollectionMode.automatic`. */\n name?: CollectionMode;\n /** How to collect the phone field. Defaults to `CollectionMode.automatic`. */\n phone?: CollectionMode;\n /** How to collect the email field. Defaults to `CollectionMode.automatic`. */\n email?: CollectionMode;\n /** How to collect the billing address. Defaults to `CollectionMode.automatic`. */\n address?: AddressCollectionMode;\n /** Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. If `false` (the default), those values will only be used to prefill the corresponding fields in the form. */\n attachDefaultsToPaymentMethod?: Boolean;\n};\n\nexport enum CollectionMode {\n /** The field may or may not be collected depending on the Payment Method's requirements. */\n AUTOMATIC = 'automatic',\n /** The field will never be collected. If this field is required by the Payment Method, you must provide it as part of `defaultBillingDetails`. */\n NEVER = 'never',\n /** The field will always be collected, even if it isn't required for the Payment Method. */\n ALWAYS = 'always',\n}\n\nexport enum AddressCollectionMode {\n /** Only the fields required by the Payment Method will be collected, which may be none. */\n AUTOMATIC = 'automatic',\n /** Billing address will never be collected. If the Payment Method requires a billing address, you must provide it as part of `defaultBillingDetails`. */\n NEVER = 'never',\n /** Collect the full billing address, regardless of the Payment Method's requirements. */\n FULL = 'full',\n}\n"],"mappings":"wHAwRYA,eAAc,iDAAdA,cAAc,EAAdA,cAAc,0BAAdA,cAAc,kBAAdA,cAAc,uBAAdA,cAAc,0BAAdA,cAAc,SASdC,sBAAqB,+DAArBA,qBAAqB,EAArBA,qBAAqB,0BAArBA,qBAAqB,kBAArBA,qBAAqB,mBAArBA,qBAAqB,iCAArBA,qBAAqB"}
|
|
1
|
+
{"version":3,"names":["CollectionMode","AddressCollectionMode","CaptureMethod"],"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';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Result } from './PaymentMethod';\nimport type { StripeError } from './Errors';\n\nexport type SetupParams = IntentParams & {\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 /** Configuration for how billing details are collected during checkout. */\n billingDetailsCollectionConfiguration?: BillingDetailsCollectionConfiguration;\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 IntentParams =\n | {\n paymentIntentClientSecret: string;\n setupIntentClientSecret?: undefined;\n intentConfiguration?: never;\n }\n | {\n setupIntentClientSecret: string;\n paymentIntentClientSecret?: undefined;\n intentConfiguration?: never;\n }\n | {\n setupIntentClientSecret?: never;\n paymentIntentClientSecret?: never;\n intentConfiguration: IntentConfiguration;\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\nexport type BillingDetailsCollectionConfiguration = {\n /** How to collect the name field. Defaults to `CollectionMode.automatic`. */\n name?: CollectionMode;\n /** How to collect the phone field. Defaults to `CollectionMode.automatic`. */\n phone?: CollectionMode;\n /** How to collect the email field. Defaults to `CollectionMode.automatic`. */\n email?: CollectionMode;\n /** How to collect the billing address. Defaults to `CollectionMode.automatic`. */\n address?: AddressCollectionMode;\n /** Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. If `false` (the default), those values will only be used to prefill the corresponding fields in the form. */\n attachDefaultsToPaymentMethod?: Boolean;\n};\n\nexport enum CollectionMode {\n /** The field may or may not be collected depending on the Payment Method's requirements. */\n AUTOMATIC = 'automatic',\n /** The field will never be collected. If this field is required by the Payment Method, you must provide it as part of `defaultBillingDetails`. */\n NEVER = 'never',\n /** The field will always be collected, even if it isn't required for the Payment Method. */\n ALWAYS = 'always',\n}\n\nexport enum AddressCollectionMode {\n /** Only the fields required by the Payment Method will be collected, which may be none. */\n AUTOMATIC = 'automatic',\n /** Billing address will never be collected. If the Payment Method requires a billing address, you must provide it as part of `defaultBillingDetails`. */\n NEVER = 'never',\n /** Collect the full billing address, regardless of the Payment Method's requirements. */\n FULL = 'full',\n}\n\nexport type IntentCreationError = StripeError<'Failed'>;\n\nexport type IntentCreationCallbackParams =\n | {\n clientSecret: string;\n error?: never;\n }\n | {\n clientSecret?: never;\n error: IntentCreationError;\n };\n\nexport type IntentConfiguration = {\n /*\n Called when the customer confirms payment. Your implementation should create a PaymentIntent or SetupIntent on your server and call the `intentCreationCallback` with its client secret or an error if one occurred.\n - Note: You must create the PaymentIntent or SetupIntent with the same values used as the `IntentConfiguration` e.g. the same amount, currency, etc.\n - Parameters:\n - paymentMethod: The PaymentMethod representing the customer's payment details.\n - shouldSavePaymentMethod: This is `true` if the customer selected the \"Save this payment method for future use\" checkbox. Set `setup_future_usage` on the PaymentIntent to `off_session` if this is `true`.\n - intentCreationCallback: Call this with the `client_secret` of the PaymentIntent or SetupIntent created by your server or the error that occurred. If you're using customFlow: false (default), the error's localizedMessage will be displayed to the customer in the sheet. If you're using customFlow: true, the `confirm` method fails with the error.\n */\n confirmHandler: (\n paymentMethod: Result,\n shouldSavePaymentMethod: boolean,\n intentCreationCallback: (result: IntentCreationCallbackParams) => void\n ) => void;\n /* Information about the payment (PaymentIntent) or setup (SetupIntent).*/\n mode: Mode;\n /* A list of payment method types to display to the customer. If undefined or empty, we dynamically determine the payment methods using your Stripe Dashboard settings. */\n paymentMethodTypes?: Array<string>;\n};\n\nexport type Mode = PaymentMode | SetupMode;\n\n/**\n * Controls when the funds will be captured. Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method\n */\nexport enum CaptureMethod {\n /** (Default) Stripe automatically captures funds when the customer authorizes the payment. */\n Automatic = 'Automatic',\n /** Place a hold on the funds when the customer authorizes the payment, but don’t capture the funds until later. (Not all payment methods support this.) */\n Manual = 'Manual',\n /** Asynchronously capture funds when the customer authorizes the payment.\n - Note: Recommended over `CaptureMethod.Automatic` due to improved latency, but may require additional integration changes.\n - Seealso: https://stripe.com/docs/payments/payment-intents/asynchronous-capture-automatic-async */\n AutomaticAsync = 'AutomaticAsync',\n}\n\n/* Use this if your integration creates a PaymentIntent */\nexport type PaymentMode = {\n /* Amount intended to be collected in the smallest currency unit (e.g. 100 cents to charge $1.00). Shown in Apple Pay, Google Pay, Buy now pay later UIs, the Pay button, and influences available payment methods.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-amount */\n amount: number;\n /* Three-letter ISO currency code. Filters out payment methods based on supported currency.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-currency */\n currencyCode: string;\n /* Indicates that you intend to make future payments.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage */\n setupFutureUsage?: FutureUsage;\n /* Controls when the funds will be captured.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method */\n captureMethod?: CaptureMethod;\n};\n\n/* Use this if your integration creates a SetupIntent */\nexport type SetupMode = {\n /* Three-letter ISO currency code. Filters out payment methods based on supported currency.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-currency */\n currencyCode?: string;\n /* Indicates that you intend to make future payments.\n Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage */\n setupFutureUsage: FutureUsage;\n};\n"],"mappings":"8IAkSYA,eAAc,iDAAdA,cAAc,EAAdA,cAAc,0BAAdA,cAAc,kBAAdA,cAAc,uBAAdA,cAAc,0BAAdA,cAAc,SASdC,sBAAqB,+DAArBA,qBAAqB,EAArBA,qBAAqB,0BAArBA,qBAAqB,kBAArBA,qBAAqB,mBAArBA,qBAAqB,iCAArBA,qBAAqB,SA8CrBC,cAAa,+CAAbA,aAAa,EAAbA,aAAa,0BAAbA,aAAa,oBAAbA,aAAa,uCAAbA,aAAa,yBAAbA,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
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 you include ContactField.PostalAddress in this array, 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
|
+
{"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';\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 you include ContactField.PostalAddress in this array, 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\ninterface PostalAddress {\n city?: string;\n country?: string;\n postalCode?: string;\n state?: string;\n street?: string;\n isoCountryCode?: string;\n subAdministrativeArea?: string;\n subLocality?: string;\n}\n\ninterface ContactName {\n familyName?: string;\n namePrefix?: string;\n nameSuffix?: string;\n givenName?: string;\n middleName?: string;\n nickname?: string;\n}\n\n/** iOS only. */\nexport interface ShippingContact {\n emailAddress?: string;\n name: ContactName;\n phoneNumber?: string;\n postalAddress: PostalAddress;\n}\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = {\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. Defaults to false. */\n testEnv?: boolean;\n /**\n * If `true`, Google Pay is considered ready if the customer's Google Pay wallet\n * has an existing payment method. Defaults to false.\n */\n existingPaymentMethodRequired?: boolean;\n};\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":"4VAoBYA,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":["GooglePayCardTokenStatus","CanAddCardToWalletStatus"],"sources":["PushProvisioning.ts"],"sourcesContent":["import type { StripeError, GooglePayError } from './Errors';\n\nexport type GooglePayCardToken = {\n id: string;\n
|
|
1
|
+
{"version":3,"names":["GooglePayCardTokenStatus","CanAddCardToWalletStatus"],"sources":["PushProvisioning.ts"],"sourcesContent":["import type { StripeError, GooglePayError } from './Errors';\n\nexport type GooglePayCardToken = {\n /** The token reference ID. */\n id: string;\n /** Last four digits of the FPAN */\n fpanLastFour: string;\n /** Last four digits of the DPAN */\n dpanLastFour: string;\n network: number;\n serviceProvider: number;\n /** The name of the issuer. */\n issuer: string;\n /** The GooglePayCardTokenStatus. */\n status: GooglePayCardTokenStatus;\n /** Deprecated. Use fpanLastFour or dpanLastFour. */\n cardLastFour: string;\n};\n\nexport enum GooglePayCardTokenStatus {\n /** */\n TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION = 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION',\n /** */\n TOKEN_STATE_PENDING = 'TOKEN_STATE_PENDING',\n /** */\n TOKEN_STATE_SUSPENDED = 'TOKEN_STATE_SUSPENDED',\n /** */\n TOKEN_STATE_ACTIVE = 'TOKEN_STATE_ACTIVE',\n /** */\n TOKEN_STATE_FELICA_PENDING_PROVISIONING = 'TOKEN_STATE_FELICA_PENDING_PROVISIONING',\n /** */\n TOKEN_STATE_UNTOKENIZED = 'TOKEN_STATE_UNTOKENIZED',\n}\n\nexport type IsCardInWalletResult =\n | {\n isInWallet: boolean;\n token?: GooglePayCardToken;\n error?: undefined;\n }\n | {\n isInWallet?: undefined;\n token?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type CanAddCardToWalletParams = {\n /** The `primary_account_identifier` value from the issued card. Can be an empty string. */\n primaryAccountIdentifier: string | null;\n /** Last 4 digits of the card number. Required for Android. */\n cardLastFour: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */\n hasPairedAppleWatch?: boolean;\n /** Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. */\n supportsTapToPay?: boolean;\n};\n\nexport type CanAddCardToWalletResult =\n | {\n canAddCard: boolean;\n details?: {\n token?: GooglePayCardToken;\n status?: CanAddCardToWalletStatus;\n };\n error?: undefined;\n }\n | {\n canAddCard?: undefined;\n details?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport enum CanAddCardToWalletStatus {\n /** You are missing configuration required for Push Provisioning. Make sure you've completed all steps at https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native. */\n MISSING_CONFIGURATION = 'MISSING_CONFIGURATION',\n /** This device doesn't support adding a card to the native wallet. */\n UNSUPPORTED_DEVICE = 'UNSUPPORTED_DEVICE',\n /** This card already exists on this device and any paired devices. */\n CARD_ALREADY_EXISTS = 'CARD_ALREADY_EXISTS',\n /** This card already exists on this device, but not on the paired device. */\n CARD_EXISTS_ON_CURRENT_DEVICE = 'CARD_EXISTS_ON_CURRENT_DEVICE',\n /** This card already exists on the paired device, but not on this device. */\n CARD_EXISTS_ON_PAIRED_DEVICE = 'CARD_EXISTS_ON_PAIRED_DEVICE',\n}\n"],"mappings":"qIAmBYA,yBAAwB,qEAAxBA,wBAAwB,EAAxBA,wBAAwB,sFAAxBA,wBAAwB,8CAAxBA,wBAAwB,kDAAxBA,wBAAwB,4CAAxBA,wBAAwB,sFAAxBA,wBAAwB,yDAAxBA,wBAAwB,oCAAxBA,wBAAwB,SAuDxBC,yBAAwB,qEAAxBA,wBAAwB,EAAxBA,wBAAwB,kDAAxBA,wBAAwB,4CAAxBA,wBAAwB,8CAAxBA,wBAAwB,kEAAxBA,wBAAwB,mEAAxBA,wBAAwB,oCAAxBA,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GooglePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n type?: number;\n
|
|
1
|
+
{"version":3,"names":[],"sources":["GooglePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n type?: number;\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,PlatformPay:true};exports.Token=exports.ThreeDSecure=exports.SetupIntent=exports.PlatformPay=exports.PaymentSheet=exports.PaymentMethod=exports.PaymentIntent=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=exports.AuBECSDebitFormComponent=exports.ApplePay=void 0;var ApplePay=_interopRequireWildcard(require("./ApplePay"));exports.ApplePay=ApplePay;var PaymentIntent=_interopRequireWildcard(require("./PaymentIntent"));exports.PaymentIntent=PaymentIntent;var PaymentMethod=_interopRequireWildcard(require("./PaymentMethod"));exports.PaymentMethod=PaymentMethod;var PaymentSheet=_interopRequireWildcard(require("./PaymentSheet"));exports.PaymentSheet=PaymentSheet;var SetupIntent=_interopRequireWildcard(require("./SetupIntent"));exports.SetupIntent=SetupIntent;var ThreeDSecure=_interopRequireWildcard(require("./ThreeDSecure"));exports.ThreeDSecure=ThreeDSecure;var AuBECSDebitFormComponent=_interopRequireWildcard(require("./components/AuBECSDebitFormComponent"));exports.AuBECSDebitFormComponent=AuBECSDebitFormComponent;var CardFieldInput=_interopRequireWildcard(require("./components/CardFieldInput"));exports.CardFieldInput=CardFieldInput;var CardFormView=_interopRequireWildcard(require("./components/CardFormView"));exports.CardFormView=CardFormView;var Token=_interopRequireWildcard(require("./Token"));exports.Token=Token;var FinancialConnections=_interopRequireWildcard(require("./FinancialConnections"));exports.FinancialConnections=FinancialConnections;var PlatformPay=_interopRequireWildcard(require("./PlatformPay"));exports.PlatformPay=PlatformPay;var _PushProvisioning=require("./PushProvisioning");Object.keys(_PushProvisioning).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PushProvisioning[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PushProvisioning[key];}});});var _Errors=require("./Errors");Object.keys(_Errors).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Errors[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Errors[key];}});});function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport type { Address, BillingDetails, AddressDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type HandleNextActionForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"6jBAeA,4DAAuC,0BACvC,sEAAiD,oCACjD,sEAAiD,oCACjD,oEAA+C,kCAC/C,kEAA6C,gCAC7C,oEAA+C,kCAC/C,uGAAkF,0DAClF,mFAA8D,sCAC9D,+EAA0D,kCAC1D,sDAAiC,oBACjC,oFAA+D,kDAC/D,kEAA6C,gCAiB7C,mYACA,iVAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n
|
|
1
|
+
{"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n PlatformPay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n CreateTokenResult,\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 handleNextActionForSetup(\n setupIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionForSetupResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\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 intentCreationCallback(\n result: PaymentSheet.IntentCreationCallbackParams\n ): void;\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 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?: PlatformPay.IsGooglePaySupportedParams;\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<PlatformPay.CartSummaryItem>,\n shippingMethods: Array<PlatformPay.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,yCA2HA,GAAQA,UAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,aAErBA,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApplePayButtonNative","requireNativeComponent"],"sources":["ApplePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type
|
|
1
|
+
{"version":3,"names":["ApplePayButtonNative","requireNativeComponent"],"sources":["ApplePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type * as ApplePayButtonComponent from '../types/components/ApplePayButtonComponent';\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\nexport default ApplePayButtonNative;\n"],"mappings":"gFAAA,yCAEA,GAAMA,qBAAoB,CACxB,GAAAC,mCAAsB,EAAsC,gBAAgB,CAAC,CAAC,aACjED,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GooglePayButtonNative","requireNativeComponent"],"sources":["GooglePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type
|
|
1
|
+
{"version":3,"names":["GooglePayButtonNative","requireNativeComponent"],"sources":["GooglePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type * as GooglePayButtonComponent from '../types/components/GooglePayButtonComponent';\nconst GooglePayButtonNative =\n requireNativeComponent<GooglePayButtonComponent.NativeProps>(\n 'GooglePayButton'\n );\nexport default GooglePayButtonNative;\n"],"mappings":"gFAAA,yCAEA,GAAMA,sBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBAAiB,CAClB,CAAC,aACWD,qBAAqB"}
|
package/lib/module/functions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.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;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updatePlatformPaySheet=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.openPlatformPaySetup=exports.isPlatformPaySupported=exports.isCardInWallet=exports.initPaymentSheet=exports.handleURLCallback=exports.handleNextActionForSetup=exports.handleNextAction=exports.dismissPlatformPay=exports.createTokenForCVCUpdate=exports.createToken=exports.createPlatformPayToken=exports.createPlatformPayPaymentMethod=exports.createPaymentMethod=exports.confirmSetupIntent=exports.confirmPlatformPaySetupIntent=exports.confirmPlatformPayPayment=exports.confirmPaymentSheetPayment=exports.confirmPayment=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 _reactNative=require("react-native");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 handleNextAction=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref7=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref7.paymentIntent,error=_ref7.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x7,_x8){return _ref6.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var handleNextActionForSetup=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(setupIntentClientSecret,returnURL){try{var _ref9=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextActionForSetup(setupIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextActionForSetup(setupIntentClientSecret),setupIntent=_ref9.setupIntent,error=_ref9.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextActionForSetup(_x9,_x10){return _ref8.apply(this,arguments);};}();exports.handleNextActionForSetup=handleNextActionForSetup;var confirmSetupIntent=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd6.setupIntent,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x11,_x12){return _ref10.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd7.tokenId,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x13){return _ref11.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleURLCallback(url):false;return stripeHandled;});return function handleURLCallback(_x14){return _ref12.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref14=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref14.paymentIntent,error=_ref14.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x15,_x16){return _ref13.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref16.setupIntent,error=_ref16.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x17,_x18){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var eventEmitter=new _reactNative.NativeEventEmitter(_reactNative.NativeModules.StripeSdk);var confirmHandlerCallback=null;var orderTrackingCallbackListener=null;var initPaymentSheet=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){var _params$intentConfigu,_params$applePay;var result;var confirmHandler=params==null?void 0:(_params$intentConfigu=params.intentConfiguration)==null?void 0:_params$intentConfigu.confirmHandler;if(confirmHandler){var _confirmHandlerCallba;(_confirmHandlerCallba=confirmHandlerCallback)==null?void 0:_confirmHandlerCallba.remove();confirmHandlerCallback=eventEmitter.addListener('onConfirmHandlerCallback',function(_ref18){var paymentMethod=_ref18.paymentMethod,shouldSavePaymentMethod=_ref18.shouldSavePaymentMethod;confirmHandler(paymentMethod,shouldSavePaymentMethod,_NativeStripeSdk.default.intentCreationCallback);});}var orderTrackingCallback=params==null?void 0:(_params$applePay=params.applePay)==null?void 0:_params$applePay.setOrderTracking;if(orderTrackingCallback){var _orderTrackingCallbac;(_orderTrackingCallbac=orderTrackingCallbackListener)==null?void 0:_orderTrackingCallbac.remove();orderTrackingCallbackListener=eventEmitter.addListener('onOrderTrackingCallback',function(){orderTrackingCallback(_NativeStripeSdk.default.configureOrderTracking);});}try{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(_x19){return _ref17.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.presentPaymentSheet(options),paymentOption=_yield$NativeStripeSd8.paymentOption,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref19.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref20.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var resetPaymentSheetCustomer=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){return yield _NativeStripeSdk.default.resetPaymentSheetCustomer();});return function resetPaymentSheetCustomer(){return _ref21.apply(this,arguments);};}();exports.resetPaymentSheetCustomer=resetPaymentSheetCustomer;var collectBankAccountForPayment=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref23=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref23.paymentIntent,error=_ref23.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x20,_x21){return _ref22.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref25=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref25.setupIntent,error=_ref25.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x22,_x23){return _ref24.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd10.session,token=_yield$NativeStripeSd10.token,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x24){return _ref26.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd11.session,error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x25){return _ref27.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref28=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd12.canAddCard,details=_yield$NativeStripeSd12.details,error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x26){return _ref28.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref29=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd13.isInWallet,token=_yield$NativeStripeSd13.token,error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x27){return _ref29.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;var isPlatformPaySupported=function(){var _ref30=(0,_asyncToGenerator2.default)(function*(params){return yield _NativeStripeSdk.default.isPlatformPaySupported(params!=null?params:{});});return function isPlatformPaySupported(_x28){return _ref30.apply(this,arguments);};}();exports.isPlatformPaySupported=isPlatformPaySupported;var confirmPlatformPaySetupIntent=function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref32=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,false),error=_ref32.error,setupIntent=_ref32.setupIntent;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmPlatformPaySetupIntent(_x29,_x30){return _ref31.apply(this,arguments);};}();exports.confirmPlatformPaySetupIntent=confirmPlatformPaySetupIntent;var confirmPlatformPayPayment=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref34=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,true),error=_ref34.error,paymentIntent=_ref34.paymentIntent;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPlatformPayPayment(_x31,_x32){return _ref33.apply(this,arguments);};}();exports.confirmPlatformPayPayment=confirmPlatformPayPayment;var dismissPlatformPay=function(){var _ref35=(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 _ref35.apply(this,arguments);};}();exports.dismissPlatformPay=dismissPlatformPay;var createPlatformPayPaymentMethod=function(){var _ref36=(0,_asyncToGenerator2.default)(function*(params){try{var _ref37=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,false),error=_ref37.error,paymentMethod=_ref37.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPlatformPayPaymentMethod(_x33){return _ref36.apply(this,arguments);};}();exports.createPlatformPayPaymentMethod=createPlatformPayPaymentMethod;var createPlatformPayToken=function(){var _ref38=(0,_asyncToGenerator2.default)(function*(params){try{var _ref39=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,true),error=_ref39.error,token=_ref39.token;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createPlatformPayToken(_x34){return _ref38.apply(this,arguments);};}();exports.createPlatformPayToken=createPlatformPayToken;var updatePlatformPaySheet=function(){var _ref40=(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(_x35){return _ref40.apply(this,arguments);};}();exports.updatePlatformPaySheet=updatePlatformPaySheet;var openPlatformPaySetup=function(){var _ref41=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='ios'){yield _NativeStripeSdk.default.openApplePaySetup();}});return function openPlatformPaySetup(){return _ref41.apply(this,arguments);};}();exports.openPlatformPaySetup=openPlatformPaySetup;
|
|
2
2
|
//# sourceMappingURL=functions.js.map
|