@stripe/stripe-react-native 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +26 -16
  4. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +30 -1
  5. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +5 -0
  6. package/android/src/main/res/drawable/googlepay_button_background_shape.xml +4 -10
  7. package/android/src/main/res/drawable-hdpi/googlepay_button_background_image.9.png +0 -0
  8. package/android/src/main/res/drawable-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  9. package/android/src/main/res/drawable-mdpi/googlepay_button_background_image.9.png +0 -0
  10. package/android/src/main/res/drawable-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  11. package/android/src/main/res/drawable-v21/googlepay_button_background.xml +7 -0
  12. package/android/src/main/res/drawable-v21/googlepay_button_no_shadow_background.xml +7 -0
  13. package/android/src/main/res/drawable-xhdpi/googlepay_button_background_image.9.png +0 -0
  14. package/android/src/main/res/drawable-xhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  15. package/android/src/main/res/drawable-xxhdpi/googlepay_button_background_image.9.png +0 -0
  16. package/android/src/main/res/drawable-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  17. package/android/src/main/res/drawable-xxxhdpi/googlepay_button_background_image.9.png +0 -0
  18. package/android/src/main/res/drawable-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  19. package/ios/Mappers.swift +8 -3
  20. package/ios/PaymentMethodFactory.swift +24 -0
  21. package/ios/StripeSdk+PaymentSheet.swift +35 -0
  22. package/ios/StripeSdk.swift +2 -5
  23. package/lib/commonjs/types/ApplePay.js.map +1 -1
  24. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  25. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  26. package/lib/commonjs/types/PaymentSheet.js +1 -1
  27. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  28. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  29. package/lib/module/types/ApplePay.js.map +1 -1
  30. package/lib/module/types/PaymentIntent.js.map +1 -1
  31. package/lib/module/types/PaymentMethod.js.map +1 -1
  32. package/lib/module/types/PaymentSheet.js +1 -1
  33. package/lib/module/types/PaymentSheet.js.map +1 -1
  34. package/lib/module/types/SetupIntent.js.map +1 -1
  35. package/lib/typescript/src/functions.d.ts +1 -1
  36. package/lib/typescript/src/hooks/useConfirmPayment.d.ts +1 -1
  37. package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
  38. package/lib/typescript/src/types/ApplePay.d.ts +1 -1
  39. package/lib/typescript/src/types/PaymentIntent.d.ts +190 -2
  40. package/lib/typescript/src/types/PaymentMethod.d.ts +11 -1
  41. package/lib/typescript/src/types/PaymentSheet.d.ts +30 -0
  42. package/lib/typescript/src/types/SetupIntent.d.ts +3 -3
  43. package/package.json +2 -1
  44. package/src/types/ApplePay.ts +1 -1
  45. package/src/types/PaymentIntent.ts +227 -3
  46. package/src/types/PaymentMethod.ts +14 -1
  47. package/src/types/PaymentSheet.ts +33 -0
  48. package/src/types/SetupIntent.ts +7 -20
  49. package/stripe-react-native.podspec +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type { LastPaymentError } from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams =\n | PaymentMethod.CardParams\n | PaymentMethod.IdealParams\n | PaymentMethod.OxxoParams\n | PaymentMethod.P24Params\n | PaymentMethod.AlipayParams\n | PaymentMethod.GiropayParams\n | PaymentMethod.SepaParams\n | PaymentMethod.EpsParams\n | PaymentMethod.AuBecsDebitParams\n | PaymentMethod.SofortParams\n | PaymentMethod.GrabPayParams\n | PaymentMethod.FPXParams\n | PaymentMethod.AfterpayClearpayParams\n | PaymentMethod.KlarnaParams\n | PaymentMethod.BancontactParams\n | PaymentMethod.USBankAccountParams;\n// TODO: Change the above back to PaymentMethod.CreateParams when PayPal is supported through SetupIntents\n\nexport type ConfirmOptions = {};\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAiDYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
1
+ {"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {\n LastPaymentError,\n ConfirmParams as PaymentIntentConfirmParams,\n ConfirmOptions as PaymentIntentConfirmOptions,\n} from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentIntentConfirmParams;\n\nexport type ConfirmOptions = PaymentIntentConfirmOptions;\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAoCYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ApplePay.ts"],"sourcesContent":["export type ContactFieldsType =\n | 'emailAddress'\n | 'name'\n | 'phoneNumber'\n | 'phoneticName'\n | 'postalAddress';\n\nexport type AddressFields =\n | 'street'\n | 'city'\n | 'subAdministrativeArea'\n | 'state'\n | 'postalCode'\n | 'country'\n | 'countryCode'\n | 'subLocality';\n\nexport interface 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\nexport interface ShippingContact {\n emailAddress?: string;\n name: ContactName;\n phoneNumber?: number;\n postalAddress: PostalAddress;\n}\n\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\nexport type CartSummaryItemType = 'Deferred' | 'Immediate' | 'Recurring';\n\n/** 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: '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/** Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n 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/** 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: '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: 'minute' | 'hour' | 'day' | 'month' | 'year';\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\nexport interface PresentParams {\n cartItems: CartSummaryItem[];\n country: string;\n currency: string;\n requiredShippingAddressFields?: ContactFieldsType[];\n requiredBillingContactFields?: ContactFieldsType[];\n shippingMethods?: ShippingMethod[];\n jcbEnabled?: boolean;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["ApplePay.ts"],"sourcesContent":["export type ContactFieldsType =\n | 'emailAddress'\n | 'name'\n | 'phoneNumber'\n | 'phoneticName'\n | 'postalAddress';\n\nexport type AddressFields =\n | 'street'\n | 'city'\n | 'subAdministrativeArea'\n | 'state'\n | 'postalCode'\n | 'country'\n | 'countryCode'\n | 'subLocality';\n\nexport interface 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\nexport interface ShippingContact {\n emailAddress?: string;\n name: ContactName;\n phoneNumber?: string;\n postalAddress: PostalAddress;\n}\n\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\nexport type CartSummaryItemType = 'Deferred' | 'Immediate' | 'Recurring';\n\n/** 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: '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/** Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n 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/** 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: '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: 'minute' | 'hour' | 'day' | 'month' | 'year';\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\nexport interface PresentParams {\n cartItems: CartSummaryItem[];\n country: string;\n currency: string;\n requiredShippingAddressFields?: ContactFieldsType[];\n requiredBillingContactFields?: ContactFieldsType[];\n shippingMethods?: ShippingMethod[];\n jcbEnabled?: boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\n\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: 'Automatic' | 'Manual';\n confirmationMethod: 'Automatic' | 'Manual';\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentMethod.CreateParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFA8CYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
1
+ {"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address, BillingDetails } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nimport type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type { BankAcccountHolderType, BankAcccountType } from './Token';\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: 'Automatic' | 'Manual';\n confirmationMethod: 'Automatic' | 'Manual';\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n\nexport type MandateData = {\n customerAcceptance: {\n online: {\n ipAddress: string;\n userAgent: string;\n };\n };\n};\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n paymentMethodData?: {\n mandateData?: MandateData;\n };\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: BillingDetails;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: BillingDetails;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n mandateData?: MandateData;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n mandateData?: MandateData;\n };\n};\n"],"mappings":"kFAmEYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n threeDSecureUsage?: ThreeDSecureUsage;\n}\n\nexport interface ThreeDSecureUsage {\n isSupported?: boolean;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.CollectionMode=exports.AddressCollectionMode=void 0;var CollectionMode;exports.CollectionMode=CollectionMode;(function(CollectionMode){CollectionMode["AUTOMATIC"]="automatic";CollectionMode["NEVER"]="never";CollectionMode["ALWAYS"]="always";})(CollectionMode||(exports.CollectionMode=CollectionMode={}));var AddressCollectionMode;exports.AddressCollectionMode=AddressCollectionMode;(function(AddressCollectionMode){AddressCollectionMode["AUTOMATIC"]="automatic";AddressCollectionMode["NEVER"]="never";AddressCollectionMode["FULL"]="full";})(AddressCollectionMode||(exports.AddressCollectionMode=AddressCollectionMode={}));
2
2
  //# sourceMappingURL=PaymentSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["PaymentSheet.ts"],"sourcesContent":["import type { BillingDetails, AddressDetails } from './Common';\nimport type { CartSummaryItem } from './ApplePay';\nimport type {\n ButtonType,\n RecurringPaymentRequest,\n AutomaticReloadPaymentRequest,\n MultiMerchantRequest,\n} from './PlatformPay';\n\nexport type SetupParams = ClientSecretParams & {\n /** Your customer-facing business name. On Android, this is required and cannot be an empty string. */\n merchantDisplayName: string;\n /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */\n customerId?: string;\n /** A short-lived token that allows the SDK to access a Customer’s payment methods. */\n customerEphemeralKeySecret?: string;\n /** When set to true, separates out the payment method selection & confirmation steps.\n * If true, you must call `confirmPaymentSheetPayment` on your own. Defaults to false. */\n customFlow?: boolean;\n /** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */\n applePay?: ApplePayParams;\n /** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */\n googlePay?: GooglePayParams;\n /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. */\n style?: 'alwaysLight' | 'alwaysDark' | 'automatic';\n /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */\n returnURL?: string;\n /** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */\n defaultBillingDetails?: BillingDetails;\n /**\n * The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.\n * This is used to display a \"Billing address is same as shipping\" checkbox if `defaultBillingDetails` is not provided.\n * If `name` and `line1` are populated, it's also [attached to the PaymentIntent](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping) during payment.\n */\n defaultShippingDetails?: AddressDetails;\n /** If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.\n *\n * Some payment methods can’t guarantee you will receive funds from your customer at the end of the checkout\n * because they take time to settle (eg. most bank debits, like SEPA or ACH) or require customer action to\n * complete (e.g. OXXO, Konbini, Boleto). If this is set to true, make sure your integration listens to webhooks\n * for notifications on whether a payment has succeeded or not.\n */\n allowsDelayedPaymentMethods?: boolean;\n /** Customizes the appearance of PaymentSheet */\n appearance?: AppearanceParams;\n /** The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents. */\n primaryButtonLabel?: string;\n};\n\nexport type ClientSecretParams =\n | {\n paymentIntentClientSecret: string;\n setupIntentClientSecret?: undefined;\n }\n | {\n setupIntentClientSecret: string;\n paymentIntentClientSecret?: undefined;\n };\n\nexport type ApplePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /**\n * An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent\n * for a recurring payment, you should set this to display the amount you intend to charge. */\n cartItems?: CartSummaryItem[];\n /** Sets the text displayed by the call to action button in the Apple Pay sheet. */\n buttonType?: ButtonType;\n /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */\n request?:\n | RecurringPaymentRequest\n | AutomaticReloadPaymentRequest\n | MultiMerchantRequest;\n /** Callback function for setting the order details (retrieved from your server) to give users the\n * ability to track and manage their purchases in Wallet. Stripe calls your implementation after the\n * payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion`\n * function, or else the Apple Pay sheet will hang. */\n setOrderTracking?: (\n completion: (\n orderIdentifier: string,\n orderTypeIdentifier: string,\n authenticationToken: string,\n webServiceUrl: string\n ) => void\n ) => void;\n};\n\nexport type GooglePayParams = {\n /** The two-letter ISO 3166 code of the country of your business, e.g. \"US\" */\n merchantCountryCode: string;\n /** The three-letter ISO 4217 alphabetic currency code, e.g. \"USD\" or \"EUR\". Required in order to support Google Pay when processing a Setup Intent. */\n currencyCode?: string;\n /** Whether or not to use the Google Pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. */\n testEnv?: boolean;\n};\n\n/**\n * Used to customize the appearance of your PaymentSheet\n */\nexport type AppearanceParams = RecursivePartial<{\n /** Describes the appearance of fonts in your PaymentSheet */\n font: FontConfig;\n /** Describes the colors in your PaymentSheet. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | GlobalColorConfig\n | { light: GlobalColorConfig; dark: GlobalColorConfig };\n /** Describes the appearance of shapes in the PaymentSheet, such as buttons, inputs, and tabs. */\n shapes: {\n /** The border radius used for buttons, inputs, and tabs in your PaymentSheet.\n * @default 6.0\n */\n borderRadius: number;\n /** The border width used for inputs and tabs in your PaymentSheet.\n * @default 1.0\n */\n borderWidth: number;\n /** iOS only. The shadow used for buttons, inputs, and tabs in your PaymentSheet */\n shadow: ShadowConfig;\n };\n /** Describes the appearance of the primary \"Pay\" button at the bottom of your Payment Sheet */\n primaryButton: PrimaryButtonConfig;\n}>;\n\nexport type FontConfig = {\n /**\n * The font used for regular text. PaymentSheet will attempt to use medium and bold versions of this font if they exist.\n *\n * On iOS, this should be the \"PostScript name\" found in Font Book after installing the font.\n * On Android, this should be the name of the font file (containing only lowercase alphanumeric characters) in android/app/src/main/res/font\n *\n * @default The OS's system font\n */\n family: string;\n /** The scale factor for all fonts in your PaymentSheet. This value is required to be greater than 0. Font sizes are multiplied by this value before being displayed. For example, setting this to 1.2 increases the size of all text by 20%.\n * @default 1.0\n */\n scale: number;\n};\n\nexport type ShadowConfig = {\n /** The color of the shadow.\n * @default \"#000000\"\n * */\n color: string;\n /** The alpha or opacity of the shadow.\n * @default 0.05\n */\n opacity: number;\n /** The positioning of the shadow relative to the component. For example, a negative x and y will result in a shadow placed below and to the left of the component.\n * @default {x: 0, y: 2}\n */\n offset: { x: number; y: number };\n /** The blur radius of the shadow.\n * @default 4\n */\n blurRadius: number;\n};\n\nexport type GlobalColorConfig = {\n /** A primary color used throughout your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System blue color on iOS, and \"#007AFF\" (light) / \"#0074D4\" (dark) on Android.\n */\n primary: string;\n /** The color used for the background of your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color on iOS, and \"#ffffff\" (light) / \"#2e2e2e\" (dark) on Android.\n */\n background: string;\n /** The color used for the background of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System background color (light) / System secondary background color (dark) on iOS, and \"#ffffff\" (light) / \"#a9a9a9\" (dark) on Android.\n */\n componentBackground: string;\n /** The color used for the external border of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentBorder: string;\n /** The color used for the internal border (meaning the border is shared with another component) of inputs, tabs, and other components in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System gray (3) color on iOS, and \"#33787880\" (light) / \"#787880\" (dark) on Android.\n */\n componentDivider: string;\n /** The color of the header text in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n primaryText: string;\n /** The color of the label text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n secondaryText: string;\n /** The color of the input text in your PaymentSheet components, such as the user's card number or zip code, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default \"#000000\"\n */\n componentText: string;\n /** The color of the placeholder text of input fields, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System label color on iOS, and \"#99000000\" (light) / \"#99ffffff\" (dark) on Android.\n */\n placeholderText: string;\n /** The color used for icons in your Payment Sheet, such as the close or back icons, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System seconday label color on iOS, and \"#99000000\" (light) / \"#ffffff\" (dark) on Android.\n */\n icon: string;\n /** The color used to indicate errors or destructive actions in your Payment Sheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System red color on iOS, and \"#ff0000\" (light) / \"#ff0000\" (dark) on Android.\n */\n error: string;\n};\n\nexport type PrimaryButtonConfig = {\n /** The font family used specifically for the primary button.\n * @default The root `appearance.font.family`\n */\n font: Pick<FontConfig, 'family'>;\n /** The colors used specifically for the primary button. Provide either a base config, or both `light` and `dark` configs, which will be useed based on whether the user is in Light or Dark mode. */\n colors:\n | PrimaryButtonColorConfig\n | { light: PrimaryButtonColorConfig; dark: PrimaryButtonColorConfig };\n /** Describes the border and shadow of the primary button. */\n shapes: {\n /** The border radius used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderRadius`\n */\n borderRadius: number;\n /** The border width used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.borderWidth`\n */\n borderWidth: number;\n /** iOS only. The shadow used for the primary button in your PaymentSheet\n * @default The root `appearance.shapes.shadow`\n */\n shadow: ShadowConfig;\n };\n};\n\nexport type PrimaryButtonColorConfig = {\n /** The background color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The root `appearance.colors.primary`\n */\n background: string;\n /** The color of the text for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default White or black, depending on the color of the button.\n */\n text: string;\n /** The border color used for the primary button in your PaymentSheet, represented as a hex string with format #RRGGBB or #AARRGGBB.\n * @default The System quaternary label on iOS, transparent on Android.\n */\n border: string;\n};\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\nexport interface PaymentOption {\n label: string;\n image: string;\n}\n\nexport type PresentOptions = {\n /** The number of milliseconds (after presenting) before the Payment Sheet closes automatically, at which point\n *`presentPaymentSheet` will resolve with an `error.code` of `PaymentSheetError.Timeout`. The default is no timeout.\n */\n timeout?: number;\n};\n"],"mappings":""}
1
+ {"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 +1 @@
1
- {"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type { LastPaymentError } from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams =\n | PaymentMethod.CardParams\n | PaymentMethod.IdealParams\n | PaymentMethod.OxxoParams\n | PaymentMethod.P24Params\n | PaymentMethod.AlipayParams\n | PaymentMethod.GiropayParams\n | PaymentMethod.SepaParams\n | PaymentMethod.EpsParams\n | PaymentMethod.AuBecsDebitParams\n | PaymentMethod.SofortParams\n | PaymentMethod.GrabPayParams\n | PaymentMethod.FPXParams\n | PaymentMethod.AfterpayClearpayParams\n | PaymentMethod.KlarnaParams\n | PaymentMethod.BancontactParams\n | PaymentMethod.USBankAccountParams;\n// TODO: Change the above back to PaymentMethod.CreateParams when PayPal is supported through SetupIntents\n\nexport type ConfirmOptions = {};\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAiDYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
1
+ {"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {\n LastPaymentError,\n ConfirmParams as PaymentIntentConfirmParams,\n ConfirmOptions as PaymentIntentConfirmOptions,\n} from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentIntentConfirmParams;\n\nexport type ConfirmOptions = PaymentIntentConfirmOptions;\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAoCYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
@@ -11,7 +11,7 @@ export declare const retrieveSetupIntent: (clientSecret: string) => Promise<Retr
11
11
  * @param {object=} options An optional object that contains options for this payment method.
12
12
  * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.
13
13
  */
14
- export declare const confirmPayment: (paymentIntentClientSecret: string, params?: PaymentMethod.CreateParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
14
+ export declare const confirmPayment: (paymentIntentClientSecret: string, params?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
15
15
  /** @deprecated Use `isPlatformPaySupported` instead. */
16
16
  export declare const isApplePaySupported: () => Promise<boolean>;
17
17
  /** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
@@ -3,6 +3,6 @@ import type { PaymentIntent } from '../types';
3
3
  * useConfirmPayment hook
4
4
  */
5
5
  export declare function useConfirmPayment(): {
6
- confirmPayment: (paymentIntentClientSecret: string, data?: import("../types/PaymentMethod").CreateParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<import("../types").ConfirmPaymentResult>;
6
+ confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<import("../types").ConfirmPaymentResult>;
7
7
  loading: boolean;
8
8
  };
@@ -5,7 +5,7 @@ import type { PaymentMethod, PaymentIntent, ApplePay, PaymentSheet, CreatePaymen
5
5
  export declare function useStripe(): {
6
6
  retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>;
7
7
  retrieveSetupIntent: (clientSecret: string) => Promise<RetrieveSetupIntentResult>;
8
- confirmPayment: (paymentIntentClientSecret: string, data?: PaymentMethod.CreateParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
8
+ confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
9
9
  createPaymentMethod: (data: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>;
10
10
  handleNextAction: (paymentIntentClientSecret: string, returnURL?: string | undefined) => Promise<HandleNextActionResult>;
11
11
  isApplePaySupported: boolean | null;
@@ -37,7 +37,7 @@ interface ContactName {
37
37
  export interface ShippingContact {
38
38
  emailAddress?: string;
39
39
  name: ContactName;
40
- phoneNumber?: number;
40
+ phoneNumber?: string;
41
41
  postalAddress: PostalAddress;
42
42
  }
43
43
  export declare type CartSummaryItem = DeferredCartSummaryItem | ImmediateCartSummaryItem | RecurringCartSummaryItem;
@@ -1,8 +1,10 @@
1
1
  import type { StripeError } from '.';
2
- import type { Address } from './Common';
2
+ import type { Address, BillingDetails } from './Common';
3
3
  import type { Result as PaymentMethodResult } from './PaymentMethod';
4
4
  import type { NextAction } from './NextAction';
5
5
  import type * as PaymentMethod from './PaymentMethod';
6
+ import type { FormDetails } from './components/AuBECSDebitFormComponent';
7
+ import type { BankAcccountHolderType, BankAcccountType } from './Token';
6
8
  export interface Result {
7
9
  id: string;
8
10
  amount: number;
@@ -24,7 +26,7 @@ export interface Result {
24
26
  shipping: ShippingDetails | null;
25
27
  nextAction: NextAction | null;
26
28
  }
27
- export declare type ConfirmParams = PaymentMethod.CreateParams;
29
+ export declare type ConfirmParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
28
30
  export declare type ConfirmOptions = PaymentMethod.ConfirmOptions;
29
31
  export declare type LastPaymentError = StripeError<string> & {
30
32
  paymentMethod: PaymentMethodResult;
@@ -47,3 +49,189 @@ export declare enum Status {
47
49
  RequiresCapture = "RequiresCapture",
48
50
  Unknown = "Unknown"
49
51
  }
52
+ export declare type MandateData = {
53
+ customerAcceptance: {
54
+ online: {
55
+ ipAddress: string;
56
+ userAgent: string;
57
+ };
58
+ };
59
+ };
60
+ export declare type CardParams = {
61
+ paymentMethodType: 'Card';
62
+ paymentMethodData?: {
63
+ token?: string;
64
+ billingDetails?: BillingDetails;
65
+ mandateData?: MandateData;
66
+ };
67
+ } | {
68
+ paymentMethodType: 'Card';
69
+ paymentMethodData: {
70
+ paymentMethodId: string;
71
+ cvc?: string;
72
+ billingDetails?: BillingDetails;
73
+ mandateData?: MandateData;
74
+ };
75
+ };
76
+ export interface IdealParams {
77
+ paymentMethodType: 'Ideal';
78
+ paymentMethodData?: {
79
+ bankName?: string;
80
+ billingDetails?: BillingDetails;
81
+ mandateData?: MandateData;
82
+ };
83
+ }
84
+ export interface FPXParams {
85
+ paymentMethodType: 'Fpx';
86
+ paymentMethodData?: {
87
+ testOfflineBank?: boolean;
88
+ mandateData?: MandateData;
89
+ };
90
+ }
91
+ export interface AlipayParams {
92
+ paymentMethodType: 'Alipay';
93
+ paymentMethodData?: {
94
+ mandateData?: MandateData;
95
+ };
96
+ }
97
+ export interface OxxoParams {
98
+ paymentMethodType: 'Oxxo';
99
+ paymentMethodData: {
100
+ billingDetails: BillingDetails;
101
+ mandateData?: MandateData;
102
+ };
103
+ }
104
+ export interface SofortParams {
105
+ paymentMethodType: 'Sofort';
106
+ paymentMethodData: {
107
+ country: string;
108
+ billingDetails: BillingDetails;
109
+ mandateData?: MandateData;
110
+ };
111
+ }
112
+ export interface GrabPayParams {
113
+ paymentMethodType: 'GrabPay';
114
+ paymentMethodData?: {
115
+ billingDetails?: BillingDetails;
116
+ mandateData?: MandateData;
117
+ };
118
+ }
119
+ export interface BancontactParams {
120
+ paymentMethodType: 'Bancontact';
121
+ paymentMethodData: {
122
+ billingDetails: BillingDetails;
123
+ mandateData?: MandateData;
124
+ };
125
+ }
126
+ export interface SepaParams {
127
+ paymentMethodType: 'SepaDebit';
128
+ paymentMethodData: {
129
+ iban: string;
130
+ billingDetails: BillingDetails;
131
+ mandateData?: MandateData;
132
+ };
133
+ }
134
+ export interface GiropayParams {
135
+ paymentMethodType: 'Giropay';
136
+ paymentMethodData: {
137
+ billingDetails: BillingDetails;
138
+ mandateData?: MandateData;
139
+ };
140
+ }
141
+ export interface AfterpayClearpayParams {
142
+ paymentMethodType: 'AfterpayClearpay';
143
+ paymentMethodData: {
144
+ shippingDetails: BillingDetails;
145
+ billingDetails: BillingDetails;
146
+ mandateData?: MandateData;
147
+ };
148
+ }
149
+ export declare type KlarnaParams = {
150
+ paymentMethodType: 'Klarna';
151
+ paymentMethodData: {
152
+ billingDetails: Pick<Required<BillingDetails>, 'email'> & {
153
+ address: Pick<Required<Address>, 'country'>;
154
+ } & BillingDetails;
155
+ shippingDetails?: BillingDetails;
156
+ mandateData?: MandateData;
157
+ };
158
+ };
159
+ export interface EpsParams {
160
+ paymentMethodType: 'Eps';
161
+ paymentMethodData: {
162
+ billingDetails: BillingDetails;
163
+ mandateData?: MandateData;
164
+ };
165
+ }
166
+ export interface P24Params {
167
+ paymentMethodType: 'P24';
168
+ paymentMethodData: {
169
+ billingDetails: BillingDetails;
170
+ mandateData?: MandateData;
171
+ };
172
+ }
173
+ export interface WeChatPayParams {
174
+ paymentMethodType: 'WeChatPay';
175
+ paymentMethodData: {
176
+ appId: string;
177
+ billingDetails?: BillingDetails;
178
+ mandateData?: MandateData;
179
+ };
180
+ }
181
+ export interface AuBecsDebitParams {
182
+ paymentMethodType: 'AuBecsDebit';
183
+ paymentMethodData: {
184
+ formDetails: FormDetails;
185
+ mandateData?: MandateData;
186
+ };
187
+ }
188
+ export declare type AffirmParams = {
189
+ paymentMethodType: 'Affirm';
190
+ paymentMethodData?: {
191
+ /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
192
+ shippingDetails?: BillingDetails;
193
+ billingDetails?: BillingDetails;
194
+ mandateData?: MandateData;
195
+ };
196
+ };
197
+ /**
198
+ * If paymentMethodData is null, it is assumed that the bank account details have already been attached
199
+ * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
200
+ */
201
+ export declare type USBankAccountParams = {
202
+ paymentMethodType: 'USBankAccount';
203
+ paymentMethodData?: {
204
+ billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;
205
+ accountNumber: string;
206
+ routingNumber: string;
207
+ /** Defaults to Individual */
208
+ accountHolderType?: BankAcccountHolderType;
209
+ /** Defaults to Checking */
210
+ accountType?: BankAcccountType;
211
+ mandateData?: MandateData;
212
+ };
213
+ };
214
+ export declare type PayPalParams = {
215
+ paymentMethodType: 'PayPal';
216
+ paymentMethodData?: {
217
+ billingDetails?: BillingDetails;
218
+ mandateData?: MandateData;
219
+ };
220
+ };
221
+ export declare type CashAppParams = {
222
+ paymentMethodType: 'CashApp';
223
+ paymentMethodData?: {
224
+ billingDetails?: BillingDetails;
225
+ mandateData?: MandateData;
226
+ };
227
+ };
228
+ export declare type CollectBankAccountParams = {
229
+ paymentMethodType: 'USBankAccount';
230
+ paymentMethodData: {
231
+ billingDetails: {
232
+ name: string;
233
+ email?: string;
234
+ };
235
+ mandateData?: MandateData;
236
+ };
237
+ };
@@ -18,7 +18,7 @@ export interface Result {
18
18
  Upi: UpiResult;
19
19
  USBankAccount: USBankAccountResult;
20
20
  }
21
- export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams;
21
+ export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
22
22
  export declare type ConfirmParams = CreateParams;
23
23
  export declare type CreateOptions = {
24
24
  setupFutureUsage?: FutureUsage;
@@ -164,6 +164,12 @@ export declare type PayPalParams = {
164
164
  billingDetails?: BillingDetails;
165
165
  };
166
166
  };
167
+ export declare type CashAppParams = {
168
+ paymentMethodType: 'CashApp';
169
+ paymentMethodData?: {
170
+ billingDetails?: BillingDetails;
171
+ };
172
+ };
167
173
  export interface AuBecsDebitResult {
168
174
  fingerprint?: string;
169
175
  last4?: string;
@@ -184,6 +190,10 @@ export interface CardResult {
184
190
  last4?: string;
185
191
  preferredNetwork?: string;
186
192
  availableNetworks?: Array<string>;
193
+ threeDSecureUsage?: ThreeDSecureUsage;
194
+ }
195
+ export interface ThreeDSecureUsage {
196
+ isSupported?: boolean;
187
197
  }
188
198
  export interface FpxResult {
189
199
  bank?: string;
@@ -19,6 +19,8 @@ export declare type SetupParams = ClientSecretParams & {
19
19
  style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
20
20
  /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
21
21
  returnURL?: string;
22
+ /** Configuration for how billing details are collected during checkout. */
23
+ billingDetailsCollectionConfiguration?: BillingDetailsCollectionConfiguration;
22
24
  /** 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. */
23
25
  defaultBillingDetails?: BillingDetails;
24
26
  /**
@@ -234,4 +236,32 @@ export declare type PresentOptions = {
234
236
  */
235
237
  timeout?: number;
236
238
  };
239
+ export declare type BillingDetailsCollectionConfiguration = {
240
+ /** How to collect the name field. Defaults to `CollectionMode.automatic`. */
241
+ name?: CollectionMode;
242
+ /** How to collect the phone field. Defaults to `CollectionMode.automatic`. */
243
+ phone?: CollectionMode;
244
+ /** How to collect the email field. Defaults to `CollectionMode.automatic`. */
245
+ email?: CollectionMode;
246
+ /** How to collect the billing address. Defaults to `CollectionMode.automatic`. */
247
+ address?: AddressCollectionMode;
248
+ /** 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. */
249
+ attachDefaultsToPaymentMethod?: Boolean;
250
+ };
251
+ export declare enum CollectionMode {
252
+ /** The field may or may not be collected depending on the Payment Method's requirements. */
253
+ AUTOMATIC = "automatic",
254
+ /** The field will never be collected. If this field is required by the Payment Method, you must provide it as part of `defaultBillingDetails`. */
255
+ NEVER = "never",
256
+ /** The field will always be collected, even if it isn't required for the Payment Method. */
257
+ ALWAYS = "always"
258
+ }
259
+ export declare enum AddressCollectionMode {
260
+ /** Only the fields required by the Payment Method will be collected, which may be none. */
261
+ AUTOMATIC = "automatic",
262
+ /** Billing address will never be collected. If the Payment Method requires a billing address, you must provide it as part of `defaultBillingDetails`. */
263
+ NEVER = "never",
264
+ /** Collect the full billing address, regardless of the Payment Method's requirements. */
265
+ FULL = "full"
266
+ }
237
267
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { Type } from './PaymentMethod';
2
- import type { LastPaymentError } from './PaymentIntent';
2
+ import type { LastPaymentError, ConfirmParams as PaymentIntentConfirmParams, ConfirmOptions as PaymentIntentConfirmOptions } from './PaymentIntent';
3
3
  import type { NextAction } from './NextAction';
4
4
  import type * as PaymentMethod from './PaymentMethod';
5
5
  export interface Result {
@@ -18,8 +18,8 @@ export interface Result {
18
18
  description: string | null;
19
19
  nextAction: NextAction | null;
20
20
  }
21
- export declare type ConfirmParams = PaymentMethod.CardParams | PaymentMethod.IdealParams | PaymentMethod.OxxoParams | PaymentMethod.P24Params | PaymentMethod.AlipayParams | PaymentMethod.GiropayParams | PaymentMethod.SepaParams | PaymentMethod.EpsParams | PaymentMethod.AuBecsDebitParams | PaymentMethod.SofortParams | PaymentMethod.GrabPayParams | PaymentMethod.FPXParams | PaymentMethod.AfterpayClearpayParams | PaymentMethod.KlarnaParams | PaymentMethod.BancontactParams | PaymentMethod.USBankAccountParams;
22
- export declare type ConfirmOptions = {};
21
+ export declare type ConfirmParams = PaymentIntentConfirmParams;
22
+ export declare type ConfirmOptions = PaymentIntentConfirmOptions;
23
23
  export declare type FutureUsage = 'Unknown' | 'None' | 'OnSession' | 'OffSession' | 'OneTime';
24
24
  export declare enum Status {
25
25
  Succeeded = "Succeeded",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-react-native",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "author": "Stripe",
5
5
  "description": "Stripe SDK for React Native",
6
6
  "main": "lib/commonjs/index",
@@ -16,6 +16,7 @@
16
16
  "release": "./scripts/publish",
17
17
  "example": "yarn --cwd example",
18
18
  "pods": "cd example && npx pod-install --quiet",
19
+ "update-pods": "cd example/ios && pod update Stripe StripeApplePay StripeFinancialConnections StripePayments StripePaymentSheet StripePaymentsUI StripeCore StripeUICore",
19
20
  "bootstrap": "yarn example && yarn && yarn pods",
20
21
  "bootstrap-no-pods": "yarn example && yarn",
21
22
  "docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
@@ -55,7 +55,7 @@ interface ContactName {
55
55
  export interface ShippingContact {
56
56
  emailAddress?: string;
57
57
  name: ContactName;
58
- phoneNumber?: number;
58
+ phoneNumber?: string;
59
59
  postalAddress: PostalAddress;
60
60
  }
61
61