@stripe/stripe-react-native 0.22.0 → 0.23.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 +23 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +1 -2
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +2 -3
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +21 -9
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +4 -2
- package/android/src/main/res/layout/googlepay_mark_button.xml +0 -2
- package/ios/ApplePayViewController.swift +23 -15
- package/ios/Mappers.swift +35 -16
- package/ios/PaymentMethodFactory.swift +1 -1
- package/ios/StripeSdk.m +1 -0
- package/ios/StripeSdk.swift +8 -5
- package/ios/Tests/ApplePayUtilsTests.swift +0 -1
- package/jest/mock.js +6 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/ApplePayButton.js +1 -1
- package/lib/commonjs/components/ApplePayButton.js.map +1 -1
- package/lib/commonjs/components/ApplePayButtonNative.js +2 -0
- package/lib/commonjs/components/ApplePayButtonNative.js.map +1 -0
- package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/components/GooglePayButton.js +1 -1
- package/lib/commonjs/components/GooglePayButton.js.map +1 -1
- package/lib/commonjs/components/GooglePayButtonNative.js +2 -0
- package/lib/commonjs/components/GooglePayButtonNative.js.map +1 -0
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/helpers.js.map +1 -1
- package/lib/commonjs/hooks/useApplePay.js +1 -1
- package/lib/commonjs/hooks/useApplePay.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/commonjs/hooks/useGooglePay.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js +1 -1
- package/lib/commonjs/hooks/usePlatformPay.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/plugin/withStripe.js.map +1 -1
- package/lib/commonjs/types/ApplePay.js.map +1 -1
- package/lib/commonjs/types/Common.js.map +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/commonjs/types/GooglePay.js.map +1 -1
- package/lib/commonjs/types/NextAction.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentMethod.js.map +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/SetupIntent.js.map +1 -1
- package/lib/commonjs/types/ThreeDSecure.js.map +1 -1
- package/lib/commonjs/types/Token.js.map +1 -1
- package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/commonjs/types/components/AuBECSDebitFormComponent.js.map +1 -1
- package/lib/commonjs/types/components/CardFieldInput.js.map +1 -1
- package/lib/commonjs/types/components/CardFormView.js.map +1 -1
- package/lib/commonjs/types/components/GooglePayButtonComponent.js +2 -0
- package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -0
- 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/AddToWalletButton.js.map +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/ApplePayButton.js +1 -1
- package/lib/module/components/ApplePayButton.js.map +1 -1
- package/lib/module/components/ApplePayButtonNative.js +2 -0
- package/lib/module/components/ApplePayButtonNative.js.map +1 -0
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/GooglePayButton.js +1 -1
- package/lib/module/components/GooglePayButton.js.map +1 -1
- package/lib/module/components/GooglePayButtonNative.js +2 -0
- package/lib/module/components/GooglePayButtonNative.js.map +1 -0
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/helpers.js.map +1 -1
- package/lib/module/hooks/useApplePay.js +1 -1
- package/lib/module/hooks/useApplePay.js.map +1 -1
- package/lib/module/hooks/useConfirmPayment.js.map +1 -1
- package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/module/hooks/useGooglePay.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/usePlatformPay.js +1 -1
- package/lib/module/hooks/usePlatformPay.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/plugin/withStripe.js.map +1 -1
- package/lib/module/types/ApplePay.js.map +1 -1
- package/lib/module/types/Common.js.map +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/module/types/GooglePay.js.map +1 -1
- package/lib/module/types/NextAction.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentMethod.js.map +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/SetupIntent.js.map +1 -1
- package/lib/module/types/ThreeDSecure.js.map +1 -1
- package/lib/module/types/Token.js.map +1 -1
- package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/module/types/components/AuBECSDebitFormComponent.js.map +1 -1
- package/lib/module/types/components/CardFieldInput.js.map +1 -1
- package/lib/module/types/components/CardFormView.js.map +1 -1
- package/lib/module/types/components/GooglePayButtonComponent.js +2 -0
- package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -0
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +1 -1
- package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
- package/lib/typescript/src/components/ApplePayButton.d.ts +1 -1
- package/lib/typescript/src/components/ApplePayButtonNative.d.ts +3 -0
- package/lib/typescript/src/components/GooglePayButtonNative.d.ts +3 -0
- package/lib/typescript/src/functions.d.ts +8 -2
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +6 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +22 -11
- package/lib/typescript/src/types/PaymentSheet.d.ts +1 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +6 -1
- package/lib/typescript/src/types/PushProvisioning.d.ts +1 -1
- package/lib/typescript/src/types/Token.d.ts +1 -0
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +12 -1
- package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +6 -0
- package/lib/typescript/src/types/index.d.ts +3 -2
- package/package.json +4 -4
- package/src/NativeStripeSdk.tsx +3 -2
- package/src/components/AddToWalletButton.tsx +1 -1
- package/src/components/ApplePayButton.tsx +3 -10
- package/src/components/ApplePayButtonNative.tsx +5 -0
- package/src/components/GooglePayButton.tsx +1 -3
- package/src/components/GooglePayButtonNative.tsx +7 -0
- package/src/components/PlatformPayButton.tsx +2 -4
- package/src/functions.ts +35 -4
- package/src/hooks/useApplePay.tsx +1 -2
- package/src/hooks/usePlatformPay.tsx +19 -0
- package/src/hooks/useStripe.tsx +11 -0
- package/src/index.tsx +22 -36
- package/src/types/PaymentSheet.ts +1 -1
- package/src/types/PlatformPay.ts +9 -1
- package/src/types/PushProvisioning.ts +1 -1
- package/src/types/Token.ts +1 -0
- package/src/types/components/ApplePayButtonComponent.ts +18 -2
- package/src/types/components/GooglePayButtonComponent.ts +6 -0
- package/src/types/index.ts +3 -1
- package/stripe-react-native.podspec +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 paymentMethodId: string | 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":"kFA+CYA,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,"
|
|
1
|
+
{"version":3,"names":["NavigationBarStyle"],"sources":["ThreeDSecure.ts"],"sourcesContent":["export interface ConfigurationParams extends Props {\n timeout?: number;\n label?: LabelProps;\n navigationBar?: NavigationBarProps;\n textField?: TextFieldProps;\n submitButton?: ButtonProps;\n cancelButton?: ButtonProps;\n continueButton?: ButtonProps;\n nextButton?: ButtonProps;\n resendButton?: ButtonProps;\n}\n\nexport interface Props extends IOSProps, AndroidProps {}\n\nexport enum NavigationBarStyle {\n default = 0,\n black = 1,\n blackTranslucent = 2,\n}\n\nexport interface IOSProps {\n backgroundColor?: string;\n footer?: FooterProps;\n}\nexport interface IOSNavigationBarProps {\n barStyle?: NavigationBarStyle;\n translucent?: boolean;\n barTintColor?: string;\n}\n\nexport interface AndroidProps {\n accentColor?: string;\n}\nexport interface AndroidNavigationBarProps {\n statusBarColor?: string;\n backgroundColor?: string;\n}\n\nexport interface NavigationBarProps\n extends IOSNavigationBarProps,\n AndroidNavigationBarProps {\n headerText?: string;\n buttonText?: string;\n textColor?: string;\n textFontSize?: number;\n}\n\nexport interface FooterProps {\n backgroundColor?: string;\n chevronColor?: string;\n headingTextColor?: string;\n textColor?: string;\n}\n\nexport interface LabelProps {\n headingTextColor?: string;\n textColor?: string;\n textFontSize?: number;\n headingFontSize?: number;\n}\n\nexport interface TextFieldProps {\n borderColor?: string;\n borderWidth?: number;\n borderRadius?: number;\n textColor?: string;\n textFontSize?: number;\n}\n\nexport interface ButtonProps {\n backgroundColor?: string;\n borderRadius?: number;\n textColor?: string;\n textFontSize?: number;\n}\n"],"mappings":"8FAcYA,mBAAkB,yDAAlBA,kBAAkB,EAAlBA,kBAAkB,CAAlBA,kBAAkB,yBAAlBA,kBAAkB,CAAlBA,kBAAkB,qBAAlBA,kBAAkB,CAAlBA,kBAAkB,8CAAlBA,kBAAkB,8BAAlBA,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Token.ts"],"sourcesContent":["import type { Address } from './Common';\n\nexport type CardBrand =\n | 'AmericanExpress'\n | 'DinersClub'\n | 'Discover'\n | 'JCB'\n | 'MasterCard'\n | 'UnionPay'\n | 'Visa'\n | 'Unknown';\n\nexport type Type =\n | 'Account'\n | 'BankAccount'\n | 'Card'\n | 'CvcUpdate'\n | 'Person'\n | 'Pii';\n\nexport interface Result {\n id: string;\n /** The UNIX timestamp (in milliseconds) of the date this token was created. */\n created: string;\n type: Type;\n used: boolean;\n livemode: boolean;\n card?: Card;\n bankAccount?: BankAccount;\n}\n\nexport interface BankAccount {\n /** A unique ID for this bank account. */\n id: string;\n /** The name of the associated bank. */\n bankName: string | null;\n /** The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. */\n accountHolderName: string | null;\n /** The type of entity that holds the account. */\n accountHolderType: BankAcccountHolderType | null;\n /** The currency the bank account is in. This must be a country/currency pairing that Stripe supports. */\n currency: string | null;\n /** The country in which the bank account is located. */\n country: string | null;\n routingNumber: string | null;\n status: BankAccountStatus | null;\n fingerprint: string | null;\n last4: string | null;\n}\n\nexport type BankAccountStatus =\n | 'Errored'\n | 'New'\n | 'Validated'\n | 'VerificationFailed'\n | 'Verified';\n\nexport interface Card {\n id: string;\n country: string;\n brand: CardBrand;\n currency?: string;\n expMonth: number;\n expYear: number;\n last4: string;\n funding: 'Credit' | 'Debit' | 'Prepaid' | 'Unknown';\n address: Address;\n name?: string;\n}\n\nexport type CreateParams =\n | CreateCardTokenParams\n | CreateBankAccountTokenParams\n | CreatePiiTokenParams;\n\n/** Creates a single-use token that represents a credit card’s details. Use this in combination with either the CardField or CardForm components. This token can be used in place of a credit card object with any API method. See https://stripe.com/docs/api/tokens/create_card*/\nexport type CreateCardTokenParams = {\n type: 'Card';\n address?: Address;\n name?: string;\n currency?: string;\n};\n\nexport type BankAcccountHolderType = 'Company' | 'Individual';\n\nexport type BankAcccountType = 'Checking' | 'Savings';\n\n/** Creates a single-use token that represents a bank account’s details. This token can be used with any API method in place of a bank account object. See https://stripe.com/docs/api/tokens/create_bank_account */\nexport type CreateBankAccountTokenParams = {\n type: 'BankAccount';\n accountHolderName?: string;\n accountHolderType?: BankAcccountHolderType;\n accountNumber: string;\n country: string;\n currency: string;\n routingNumber?: string;\n};\n\n/** Creates a single-use token that represents the details of personally identifiable information (PII). See https://stripe.com/docs/api/tokens/create_pii */\nexport type CreatePiiTokenParams = {\n type: 'Pii';\n /** The user's personal ID number */\n personalId: string;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["ApplePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';\nimport type { ShippingMethod, ShippingContact } from '../PlatformPay';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n disabled?: boolean;\n type?: number;\n buttonStyle?: number;\n borderRadius?: number;\n onPressAction?(): void;\n onShippingMethodSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => void;\n onShippingContactSelectedAction?: (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => void;\n onCouponCodeEnteredAction?: (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => void;\n}\n\nexport type Type =\n | 'plain'\n | 'buy'\n | 'setUp'\n | 'inStore'\n | 'donate'\n | 'checkout'\n | 'book'\n | 'subscribe'\n | 'reload'\n | 'addMoney'\n | 'topUp'\n | 'order'\n | 'rent'\n | 'support'\n | 'contribute'\n | 'tip'\n | 'continue';\n\nexport type Style = 'white' | 'whiteOutline' | 'black' | 'automatic';\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["AuBECSDebitFormComponent.ts"],"sourcesContent":["import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';\n\n/**\n * @ignore\n */\nexport interface NativeProps {\n companyName: string;\n style?: StyleProp<ViewStyle>;\n formStyle: Styles;\n onCompleteAction(value: NativeSyntheticEvent<FormDetails>): void;\n}\n\nexport interface FormDetails {\n accountNumber: string;\n bsbNumber: string;\n email: string;\n name: string;\n}\n\nexport interface Styles {\n borderWidth?: number;\n backgroundColor?: string;\n borderColor?: string;\n borderRadius?: number;\n textColor?: string;\n fontSize?: number;\n placeholderColor?: string;\n textErrorColor?: string;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ValidationState"],"sources":["CardFieldInput.ts"],"sourcesContent":["import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';\nimport type { CardBrand } from '../Token';\n\nexport type FieldName = 'CardNumber' | 'Cvc' | 'ExpiryDate' | 'PostalCode';\n\nexport enum ValidationState {\n Valid = 'Valid',\n Invalid = 'Invalid',\n Incomplete = 'Incomplete',\n Unknown = 'Unknown',\n}\n\nexport interface Details {\n last4: string;\n expiryMonth: number;\n expiryYear: number;\n postalCode?: string;\n brand: CardBrand;\n complete: boolean;\n validExpiryDate: ValidationState;\n validCVC: ValidationState;\n validNumber: ValidationState;\n /**\n * WARNING: Full card details are only returned when the `dangerouslyGetFullCardDetails` prop\n * on the `CardField` component is set to `true`.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n number?: string;\n cvc?: string;\n}\n\nexport interface Styles {\n borderWidth?: number;\n backgroundColor?: string;\n borderColor?: string;\n borderRadius?: number;\n textColor?: string;\n fontSize?: number;\n placeholderColor?: string;\n cursorColor?: string;\n textErrorColor?: string;\n fontFamily?: string;\n}\n\nexport interface Placeholders {\n number?: string;\n expiration?: string;\n cvc?: string;\n postalCode?: string;\n}\n\n/**\n * @ignore\n */\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n value?: Partial<Details>;\n postalCodeEnabled?: boolean;\n autofocus?: boolean;\n countryCode: string | null;\n onCardChange(event: NativeSyntheticEvent<Details>): void;\n onFocusChange(\n event: NativeSyntheticEvent<{ focusedField: FieldName | null }>\n ): void;\n cardStyle?: Styles;\n placeholders?: Placeholders;\n}\n\nexport interface Methods {\n focus(): void;\n blur(): void;\n clear(): void;\n}\n"],"mappings":"2FAKYA,gBAAe,mDAAfA,eAAe,EAAfA,eAAe,kBAAfA,eAAe,sBAAfA,eAAe,4BAAfA,eAAe,yBAAfA,eAAe,2BAAfA,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["CardFormView.ts"],"sourcesContent":["import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';\nimport type { CardBrand } from '../Token';\n\nexport type FieldName = 'CardNumber' | 'Cvc' | 'ExpiryDate' | 'PostalCode';\n\nexport interface Details {\n last4: string;\n expiryMonth: number;\n expiryYear: number;\n postalCode?: string;\n brand: CardBrand;\n complete: boolean;\n country: string;\n /**\n * WARNING: Full card details are only returned when the `dangerouslyGetFullCardDetails` prop\n * on the `CardField` component is set to `true`.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n number?: string;\n cvc?: string;\n}\n\nexport interface Styles {\n backgroundColor?: string;\n // disabledBackgroundColor?: string;\n // type?: 'borderless' | 'standard';\n borderWidth?: number;\n borderColor?: string;\n borderRadius?: number;\n textColor?: string;\n fontSize?: number;\n placeholderColor?: string;\n cursorColor?: string;\n textErrorColor?: string;\n fontFamily?: string;\n}\n\nexport interface Placeholders {\n number?: string;\n expiration?: string;\n cvc?: string;\n postalCode?: string;\n}\n\nexport type DefaultValues = {\n /** The 2-letter country code for the country selected by default on Android. If this is null, it is set by the device's configured region in the Settings app. */\n countryCode?: string;\n};\n\n/**\n * @ignore\n */\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n // isUserInteractionEnabledValue?: boolean;\n cardStyle?: Styles;\n /** Android only */\n placeholders?: Placeholders;\n /** Android only */\n defaultValues?: DefaultValues;\n // postalCodeEnabled: boolean;\n onFocusChange(\n event: NativeSyntheticEvent<{ focusedField: FieldName | null }>\n ): void;\n onFormComplete(event: NativeSyntheticEvent<Details>): void;\n}\n\nexport interface Methods {\n focus(): void;\n blur(): void;\n}\n"],"mappings":""}
|
|
@@ -0,0 +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 buttonType?: string;\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,GooglePay:true,ApplePayButtonComponent:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,PlatformPay:true
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,GooglePay:true,ApplePayButtonComponent:true,GooglePayButtonComponent: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.GooglePayButtonComponent=exports.GooglePay=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=exports.AuBECSDebitFormComponent=exports.ApplePayButtonComponent=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 GooglePay=_interopRequireWildcard(require("./GooglePay"));exports.GooglePay=GooglePay;var ApplePayButtonComponent=_interopRequireWildcard(require("./components/ApplePayButtonComponent"));exports.ApplePayButtonComponent=ApplePayButtonComponent;var GooglePayButtonComponent=_interopRequireWildcard(require("./components/GooglePayButtonComponent"));exports.GooglePayButtonComponent=GooglePayButtonComponent;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,"
|
|
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 GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as GooglePayButtonComponent from './components/GooglePayButtonComponent';\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 GooglePay,\n ApplePayButtonComponent,\n GooglePayButtonComponent,\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 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":"0tBAeA,4DAAuC,0BACvC,sEAAiD,oCACjD,sEAAiD,oCACjD,oEAA+C,kCAC/C,kEAA6C,gCAC7C,oEAA+C,kCAC/C,8DAAyC,4BACzC,qGAAgF,wDAChF,uGAAkF,0DAClF,uGAAkF,0DAClF,mFAA8D,sCAC9D,+EAA0D,kCAC1D,sDAAiC,oBACjC,oFAA+D,kDAC/D,kEAA6C,gCAoB7C,mYACA,iVAAyB"}
|
|
@@ -43,7 +43,7 @@ declare type NativeStripeSdkType = {
|
|
|
43
43
|
isPlatformPaySupported(params: {
|
|
44
44
|
googlePay?: GooglePay.IsSupportedParams;
|
|
45
45
|
}): Promise<boolean>;
|
|
46
|
-
createPlatformPayPaymentMethod(params: PlatformPay.PaymentMethodParams): Promise<PlatformPay.PaymentMethodResult>;
|
|
46
|
+
createPlatformPayPaymentMethod(params: PlatformPay.PaymentMethodParams, usesDeprecatedTokenFlow: boolean): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;
|
|
47
47
|
dismissPlatformPay(): Promise<boolean>;
|
|
48
48
|
updatePlatformPaySheet(summaryItems: Array<ApplePay.CartSummaryItem>, shippingMethods: Array<ApplePay.ShippingMethod>, errors: Array<PlatformPay.ApplePaySheetError>): Promise<void>;
|
|
49
49
|
confirmPlatformPay(clientSecret: string, params: PlatformPay.ConfirmParams, isPaymentIntent: boolean): Promise<PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult>;
|
|
@@ -10,7 +10,7 @@ export interface Props extends AccessibilityProps {
|
|
|
10
10
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
11
11
|
androidAssetSource: ImageSourcePropType;
|
|
12
12
|
testID?: string;
|
|
13
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
13
|
+
/** 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 */
|
|
14
14
|
testEnv?: boolean;
|
|
15
15
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
16
16
|
cardDetails: {
|
|
@@ -118,11 +118,17 @@ export declare const confirmPlatformPayPayment: (clientSecret: string, params: P
|
|
|
118
118
|
*/
|
|
119
119
|
export declare const dismissPlatformPay: () => Promise<boolean>;
|
|
120
120
|
/**
|
|
121
|
-
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods)
|
|
121
|
+
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
122
122
|
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
123
|
-
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with
|
|
123
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.
|
|
124
124
|
*/
|
|
125
125
|
export declare const createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
128
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
129
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
130
|
+
*/
|
|
131
|
+
export declare const createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
126
132
|
/**
|
|
127
133
|
* iOS only. Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.
|
|
128
134
|
* @param params an object describing the Apple Pay configuration, with the following fields:
|
|
@@ -32,6 +32,12 @@ export declare function usePlatformPay(): {
|
|
|
32
32
|
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
|
|
33
33
|
*/
|
|
34
34
|
createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
37
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
38
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
39
|
+
*/
|
|
40
|
+
createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
35
41
|
/**
|
|
36
42
|
* Dismiss the Apple Pay sheet if it is open. iOS only, this is a no-op on Android.
|
|
37
43
|
* @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.
|
|
@@ -51,6 +51,7 @@ export declare function useStripe(): {
|
|
|
51
51
|
confirmPlatformPayPayment: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmPaymentResult>;
|
|
52
52
|
dismissPlatformPay: () => Promise<boolean>;
|
|
53
53
|
createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
54
|
+
createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>;
|
|
54
55
|
updatePlatformPaySheet: (params: {
|
|
55
56
|
applePay: {
|
|
56
57
|
cartItems: Array<PlatformPay.CartSummaryItem>;
|
|
@@ -2,19 +2,30 @@ export { useConfirmPayment } from './hooks/useConfirmPayment';
|
|
|
2
2
|
export { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';
|
|
3
3
|
export { useStripe } from './hooks/useStripe';
|
|
4
4
|
export { usePlatformPay } from './hooks/usePlatformPay';
|
|
5
|
-
export { useApplePay
|
|
5
|
+
export { useApplePay } from './hooks/useApplePay';
|
|
6
|
+
export type { Props as UseApplePayProps } from './hooks/useApplePay';
|
|
6
7
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
7
8
|
export { useGooglePay } from './hooks/useGooglePay';
|
|
8
9
|
export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
|
|
9
|
-
export { initStripe, StripeProvider
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
10
|
+
export { initStripe, StripeProvider } from './components/StripeProvider';
|
|
11
|
+
export type { Props as StripeProviderProps } from './components/StripeProvider';
|
|
12
|
+
export { CardField } from './components/CardField';
|
|
13
|
+
export type { Props as CardFieldProps } from './components/CardField';
|
|
14
|
+
export { CardForm } from './components/CardForm';
|
|
15
|
+
export type { Props as CardFormProps } from './components/CardForm';
|
|
16
|
+
export { ApplePayButton } from './components/ApplePayButton';
|
|
17
|
+
export type { Props as ApplePayButtonProps } from './components/ApplePayButton';
|
|
18
|
+
export { AuBECSDebitForm } from './components/AuBECSDebitForm';
|
|
19
|
+
export type { Props as AuBECSDebitFormProps } from './components/AuBECSDebitForm';
|
|
20
|
+
export { StripeContainer } from './components/StripeContainer';
|
|
21
|
+
export type { Props as StripeContainerProps } from './components/StripeContainer';
|
|
22
|
+
export { GooglePayButton } from './components/GooglePayButton';
|
|
23
|
+
export type { Props as GooglePayButtonProps } from './components/GooglePayButton';
|
|
24
|
+
export { AddToWalletButton } from './components/AddToWalletButton';
|
|
25
|
+
export type { Props as AddToWalletButtonProps } from './components/AddToWalletButton';
|
|
26
|
+
export { AddressSheet } from './components/AddressSheet';
|
|
27
|
+
export type { Props as AddressSheetProps } from './components/AddressSheet';
|
|
28
|
+
export { PlatformPayButton } from './components/PlatformPayButton';
|
|
29
|
+
export type { Props as PlatformPayButtonProps } from './components/PlatformPayButton';
|
|
19
30
|
export * from './functions';
|
|
20
31
|
export * from './types/index';
|
|
@@ -18,7 +18,7 @@ export declare type SetupParams = ClientSecretParams & {
|
|
|
18
18
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
19
19
|
/** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
|
|
20
20
|
returnURL?: string;
|
|
21
|
-
/** PaymentSheet pre-populates the billing fields with the values provided. */
|
|
21
|
+
/** 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. */
|
|
22
22
|
defaultBillingDetails?: BillingDetails;
|
|
23
23
|
/**
|
|
24
24
|
* The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
|
|
@@ -262,10 +262,15 @@ export declare type ShippingContact = ApplePayShippingContact;
|
|
|
262
262
|
export declare type IsGooglePaySupportedParams = IsSupportedParams;
|
|
263
263
|
export declare type PaymentMethodResult = {
|
|
264
264
|
paymentMethod: PaymentMethod;
|
|
265
|
-
token: Token;
|
|
266
265
|
error?: undefined;
|
|
267
266
|
} | {
|
|
268
267
|
paymentMethod?: undefined;
|
|
268
|
+
error: StripeError<PlatformPayError>;
|
|
269
|
+
};
|
|
270
|
+
export declare type TokenResult = {
|
|
271
|
+
token: Token;
|
|
272
|
+
error?: undefined;
|
|
273
|
+
} | {
|
|
269
274
|
token?: undefined;
|
|
270
275
|
error: StripeError<PlatformPayError>;
|
|
271
276
|
};
|
|
@@ -35,7 +35,7 @@ export declare type CanAddCardToWalletParams = {
|
|
|
35
35
|
primaryAccountIdentifier: string | null;
|
|
36
36
|
/** Last 4 digits of the card number. */
|
|
37
37
|
cardLastFour: string;
|
|
38
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
38
|
+
/** 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 */
|
|
39
39
|
testEnv?: boolean;
|
|
40
40
|
/** 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. */
|
|
41
41
|
hasPairedAppleWatch?: boolean;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
import type { ShippingMethod, ShippingContact } from '../PlatformPay';
|
|
2
3
|
export interface NativeProps {
|
|
3
4
|
style?: StyleProp<ViewStyle>;
|
|
5
|
+
disabled?: boolean;
|
|
4
6
|
type?: number;
|
|
5
7
|
buttonStyle?: number;
|
|
6
8
|
borderRadius?: number;
|
|
7
9
|
onPressAction?(): void;
|
|
10
|
+
onShippingMethodSelectedAction?: (value: NativeSyntheticEvent<{
|
|
11
|
+
shippingMethod: ShippingMethod;
|
|
12
|
+
}>) => void;
|
|
13
|
+
onShippingContactSelectedAction?: (value: NativeSyntheticEvent<{
|
|
14
|
+
shippingContact: ShippingContact;
|
|
15
|
+
}>) => void;
|
|
16
|
+
onCouponCodeEnteredAction?: (value: NativeSyntheticEvent<{
|
|
17
|
+
couponCode: string;
|
|
18
|
+
}>) => void;
|
|
8
19
|
}
|
|
9
20
|
export declare type Type = 'plain' | 'buy' | 'setUp' | 'inStore' | 'donate' | 'checkout' | 'book' | 'subscribe' | 'reload' | 'addMoney' | 'topUp' | 'order' | 'rent' | 'support' | 'contribute' | 'tip' | 'continue';
|
|
10
21
|
export declare type Style = 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
@@ -7,16 +7,17 @@ import * as SetupIntent from './SetupIntent';
|
|
|
7
7
|
import * as ThreeDSecure from './ThreeDSecure';
|
|
8
8
|
import * as GooglePay from './GooglePay';
|
|
9
9
|
import * as ApplePayButtonComponent from './components/ApplePayButtonComponent';
|
|
10
|
+
import * as GooglePayButtonComponent from './components/GooglePayButtonComponent';
|
|
10
11
|
import * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';
|
|
11
12
|
import * as CardFieldInput from './components/CardFieldInput';
|
|
12
13
|
import * as CardFormView from './components/CardFormView';
|
|
13
14
|
import * as Token from './Token';
|
|
14
15
|
import * as FinancialConnections from './FinancialConnections';
|
|
15
16
|
import * as PlatformPay from './PlatformPay';
|
|
16
|
-
export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, PlatformPay, };
|
|
17
|
+
export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, GooglePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, PlatformPay, };
|
|
17
18
|
export * from './PushProvisioning';
|
|
18
19
|
export * from './Errors';
|
|
19
|
-
export { Address, BillingDetails, AddressDetails } from './Common';
|
|
20
|
+
export type { Address, BillingDetails, AddressDetails } from './Common';
|
|
20
21
|
/**
|
|
21
22
|
* @ignore
|
|
22
23
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"typescript": "tsc --noEmit",
|
|
14
14
|
"lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
|
|
15
|
-
"prepare": "bob build",
|
|
15
|
+
"prepare": "bob build && husky install",
|
|
16
16
|
"release": "./scripts/publish",
|
|
17
17
|
"example": "yarn --cwd example",
|
|
18
18
|
"pods": "cd example && npx pod-install --quiet",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/plugin-transform-typescript": "^7.13.0",
|
|
43
|
-
"@expo/config-types": "^
|
|
43
|
+
"@expo/config-types": "^47.0.0",
|
|
44
44
|
"@react-native-community/bob": "^0.16.2",
|
|
45
45
|
"@react-native-community/eslint-config": "^3.0.0",
|
|
46
46
|
"@types/jest": "^26.0.23",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"eslint-config-prettier": "^6.11.0",
|
|
59
59
|
"eslint-plugin-prettier": "^3.1.3",
|
|
60
60
|
"expect-webdriverio": "^2.0.1",
|
|
61
|
-
"expo": "^
|
|
61
|
+
"expo": "^47.0.8",
|
|
62
62
|
"husky": "^8.0.0",
|
|
63
63
|
"jest": "^26.6.3",
|
|
64
64
|
"metro-react-native-babel-preset": "^0.70.3",
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -111,8 +111,9 @@ type NativeStripeSdkType = {
|
|
|
111
111
|
googlePay?: GooglePay.IsSupportedParams;
|
|
112
112
|
}): Promise<boolean>;
|
|
113
113
|
createPlatformPayPaymentMethod(
|
|
114
|
-
params: PlatformPay.PaymentMethodParams
|
|
115
|
-
|
|
114
|
+
params: PlatformPay.PaymentMethodParams,
|
|
115
|
+
usesDeprecatedTokenFlow: boolean
|
|
116
|
+
): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;
|
|
116
117
|
dismissPlatformPay(): Promise<boolean>;
|
|
117
118
|
updatePlatformPaySheet(
|
|
118
119
|
summaryItems: Array<ApplePay.CartSummaryItem>,
|
|
@@ -27,7 +27,7 @@ export interface Props extends AccessibilityProps {
|
|
|
27
27
|
/** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
|
|
28
28
|
androidAssetSource: ImageSourcePropType;
|
|
29
29
|
testID?: string;
|
|
30
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If
|
|
30
|
+
/** 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 */
|
|
31
31
|
testEnv?: boolean;
|
|
32
32
|
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
33
33
|
cardDetails: {
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import type { ApplePayButtonComponent } from '../types';
|
|
2
1
|
import React, { useMemo } from 'react';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
|
|
10
|
-
const ApplePayButtonNative =
|
|
11
|
-
requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');
|
|
2
|
+
import ApplePayButtonNative from './ApplePayButtonNative';
|
|
3
|
+
import type { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import type { ApplePayButtonComponent } from '../types';
|
|
12
5
|
|
|
13
6
|
/**
|
|
14
7
|
* Apple Pay Button Component Props
|
|
@@ -3,12 +3,10 @@ import {
|
|
|
3
3
|
AccessibilityProps,
|
|
4
4
|
StyleProp,
|
|
5
5
|
ViewStyle,
|
|
6
|
-
requireNativeComponent,
|
|
7
6
|
TouchableOpacity,
|
|
8
7
|
StyleSheet,
|
|
9
8
|
} from 'react-native';
|
|
10
|
-
|
|
11
|
-
const GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');
|
|
9
|
+
import GooglePayButtonNative from './GooglePayButtonNative';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Google Pay Button Component Props
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { requireNativeComponent } from 'react-native';
|
|
2
|
+
import type { GooglePayButtonComponent } from '../types';
|
|
3
|
+
const GooglePayButtonNative =
|
|
4
|
+
requireNativeComponent<GooglePayButtonComponent.NativeProps>(
|
|
5
|
+
'GooglePayButton'
|
|
6
|
+
);
|
|
7
|
+
export default GooglePayButtonNative;
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
AccessibilityProps,
|
|
4
4
|
StyleProp,
|
|
5
5
|
ViewStyle,
|
|
6
|
-
requireNativeComponent,
|
|
7
6
|
TouchableOpacity,
|
|
8
7
|
StyleSheet,
|
|
9
8
|
Platform,
|
|
@@ -15,9 +14,8 @@ import {
|
|
|
15
14
|
ShippingMethod,
|
|
16
15
|
ShippingContact,
|
|
17
16
|
} from '../types/PlatformPay';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const ApplePayButtonNative = requireNativeComponent<any>('ApplePayButton');
|
|
17
|
+
import GooglePayButtonNative from './GooglePayButtonNative';
|
|
18
|
+
import ApplePayButtonNative from './ApplePayButtonNative';
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* PlatformPayButton Component Props
|
package/src/functions.ts
CHANGED
|
@@ -810,16 +810,19 @@ export const dismissPlatformPay = async (): Promise<boolean> => {
|
|
|
810
810
|
};
|
|
811
811
|
|
|
812
812
|
/**
|
|
813
|
-
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods)
|
|
813
|
+
* Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
814
814
|
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
815
|
-
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with
|
|
815
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.
|
|
816
816
|
*/
|
|
817
817
|
export const createPlatformPayPaymentMethod = async (
|
|
818
818
|
params: PlatformPay.PaymentMethodParams
|
|
819
819
|
): Promise<PlatformPay.PaymentMethodResult> => {
|
|
820
820
|
try {
|
|
821
|
-
const { error, paymentMethod
|
|
822
|
-
await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
821
|
+
const { error, paymentMethod } =
|
|
822
|
+
(await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
823
|
+
params,
|
|
824
|
+
false
|
|
825
|
+
)) as PlatformPay.PaymentMethodResult;
|
|
823
826
|
if (error) {
|
|
824
827
|
return {
|
|
825
828
|
error,
|
|
@@ -827,6 +830,34 @@ export const createPlatformPayPaymentMethod = async (
|
|
|
827
830
|
}
|
|
828
831
|
return {
|
|
829
832
|
paymentMethod: paymentMethod!,
|
|
833
|
+
};
|
|
834
|
+
} catch (error: any) {
|
|
835
|
+
return {
|
|
836
|
+
error,
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
|
|
843
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
844
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
|
|
845
|
+
*/
|
|
846
|
+
export const createPlatformPayToken = async (
|
|
847
|
+
params: PlatformPay.PaymentMethodParams
|
|
848
|
+
): Promise<PlatformPay.TokenResult> => {
|
|
849
|
+
try {
|
|
850
|
+
const { error, token } =
|
|
851
|
+
(await NativeStripeSdk.createPlatformPayPaymentMethod(
|
|
852
|
+
params,
|
|
853
|
+
true
|
|
854
|
+
)) as PlatformPay.TokenResult;
|
|
855
|
+
if (error) {
|
|
856
|
+
return {
|
|
857
|
+
error,
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
return {
|
|
830
861
|
token: token!,
|
|
831
862
|
};
|
|
832
863
|
} catch (error: any) {
|
|
@@ -3,8 +3,6 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useStripe } from './useStripe';
|
|
4
4
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
5
5
|
|
|
6
|
-
const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
|
|
7
|
-
|
|
8
6
|
export interface Props {
|
|
9
7
|
/**
|
|
10
8
|
*
|
|
@@ -105,6 +103,7 @@ export function useApplePay({
|
|
|
105
103
|
);
|
|
106
104
|
|
|
107
105
|
useEffect(() => {
|
|
106
|
+
const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
|
|
108
107
|
const didSetShippingMethodListener = eventEmitter.addListener(
|
|
109
108
|
SET_SHIPPING_METHOD_CALLBACK_NAME,
|
|
110
109
|
onDidSetShippingMethod
|