@stripe/stripe-react-native 0.35.0 → 0.36.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 +20 -1
- package/README.md +4 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +13 -5
- package/android/src/main/java/com/reactnativestripesdk/CardFieldViewManager.kt +6 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +9 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +6 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +17 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +26 -1
- package/ios/CardFieldManager.m +1 -0
- package/ios/CardFieldView.swift +8 -0
- package/ios/CardFormManager.m +1 -0
- package/ios/CardFormView.swift +7 -0
- package/ios/CustomerSheet/CustomerSheetUtils.swift +5 -1
- package/ios/Mappers.swift +25 -0
- package/ios/StripeSdk+CustomerSheet.swift +3 -1
- package/ios/StripeSdk+PaymentSheet.swift +4 -0
- package/jest/mock.js +1 -1
- package/lib/commonjs/components/CardField.js +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/types/Common.js +1 -1
- package/lib/commonjs/types/Common.js.map +1 -1
- package/lib/commonjs/types/CustomerSheet.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/types/Common.js +1 -1
- package/lib/module/types/Common.js.map +1 -1
- package/lib/module/types/CustomerSheet.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/components/CardField.d.ts +4 -1
- package/lib/typescript/src/components/CardForm.d.ts +4 -1
- package/lib/typescript/src/types/Common.d.ts +11 -0
- package/lib/typescript/src/types/CustomerSheet.d.ts +4 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +8 -1
- package/lib/typescript/src/types/index.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/CardField.tsx +4 -1
- package/src/components/CardForm.tsx +4 -2
- package/src/types/Common.ts +12 -0
- package/src/types/CustomerSheet.ts +4 -0
- package/src/types/PaymentSheet.ts +8 -1
- package/src/types/index.ts +1 -0
- package/stripe-react-native.podspec +1 -1
- package/android/src/main/res/layout/stripe_react_native_google_pay_button.xml +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport * from './CustomerSheet';\nexport type { Address, BillingDetails, AddressDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type HandleNextActionForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport * from './CustomerSheet';\nexport type { Address, BillingDetails, AddressDetails } from './Common';\nexport { CardBrand } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type HandleNextActionForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"8rBAeA,4DAAuC,0BACvC,sEAAiD,oCACjD,sEAAiD,oCACjD,oEAA+C,kCAC/C,kEAA6C,gCAC7C,oEAA+C,kCAC/C,uGAAkF,0DAClF,mFAA8D,sCAC9D,+EAA0D,kCAC1D,sDAAiC,oBACjC,oFAA+D,kDAC/D,kEAA6C,gCAiB7C,mYACA,iVACA,oXAEA,gCAAqC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardFieldInput } from '../types';
|
|
1
|
+
import type { CardFieldInput, CardBrand } from '../types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
/**
|
|
@@ -19,6 +19,9 @@ export interface Props extends AccessibilityProps {
|
|
|
19
19
|
onBlur?(): void;
|
|
20
20
|
onFocus?(focusedField: CardFieldInput.FieldName | null): void;
|
|
21
21
|
testID?: string;
|
|
22
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
23
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
24
|
+
preferredNetworks?: Array<CardBrand>;
|
|
22
25
|
/**
|
|
23
26
|
* WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.
|
|
24
27
|
* Only do this if you're certain that you fulfill the necessary PCI compliance requirements.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardFormView } from '../types';
|
|
1
|
+
import type { CardFormView, CardBrand } from '../types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
/**
|
|
@@ -12,6 +12,9 @@ export interface Props extends AccessibilityProps {
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
/** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */
|
|
14
14
|
cardStyle?: CardFormView.Styles;
|
|
15
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
16
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
17
|
+
preferredNetworks?: Array<CardBrand>;
|
|
15
18
|
/** Android only */
|
|
16
19
|
placeholders?: CardFormView.Placeholders;
|
|
17
20
|
/** Android only */
|
|
@@ -24,3 +24,14 @@ export declare type AddressDetails = {
|
|
|
24
24
|
* */
|
|
25
25
|
isCheckboxSelected?: boolean;
|
|
26
26
|
};
|
|
27
|
+
export declare enum CardBrand {
|
|
28
|
+
JCB = 0,
|
|
29
|
+
Amex = 1,
|
|
30
|
+
CartesBancaires = 2,
|
|
31
|
+
DinersClub = 3,
|
|
32
|
+
Discover = 4,
|
|
33
|
+
Mastercard = 5,
|
|
34
|
+
UnionPay = 6,
|
|
35
|
+
Visa = 7,
|
|
36
|
+
Unknown = 8
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentSheet, StripeError, CustomerSheetError, BillingDetails, PaymentMethod } from '../types';
|
|
1
|
+
import type { PaymentSheet, StripeError, CustomerSheetError, BillingDetails, PaymentMethod, CardBrand } from '../types';
|
|
2
2
|
export declare type CustomerSheetInitParams = {
|
|
3
3
|
/** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. iOS only. */
|
|
4
4
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
@@ -26,6 +26,9 @@ export declare type CustomerSheetInitParams = {
|
|
|
26
26
|
applePayEnabled?: boolean;
|
|
27
27
|
/** Whether to show Google Pay as an option. Defaults to false. */
|
|
28
28
|
googlePayEnabled?: boolean;
|
|
29
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
30
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
31
|
+
preferredNetworks?: Array<CardBrand>;
|
|
29
32
|
/** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if
|
|
30
33
|
* you would prefer retrieving and updating your Stripe customer object via your own backend instead.
|
|
31
34
|
* WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BillingDetails, AddressDetails } from './Common';
|
|
1
|
+
import type { BillingDetails, AddressDetails, CardBrand } from './Common';
|
|
2
2
|
import type { CartSummaryItem } from './ApplePay';
|
|
3
3
|
import type { ButtonType, RecurringPaymentRequest, AutomaticReloadPaymentRequest, MultiMerchantRequest } from './PlatformPay';
|
|
4
4
|
import type { FutureUsage } from './PaymentIntent';
|
|
@@ -46,6 +46,9 @@ export declare type SetupParams = IntentParams & {
|
|
|
46
46
|
primaryButtonLabel?: string;
|
|
47
47
|
/** Optional configuration to display a custom message when a saved payment method is removed. iOS only. */
|
|
48
48
|
removeSavedPaymentMethodMessage?: string;
|
|
49
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
50
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
51
|
+
preferredNetworks?: Array<CardBrand>;
|
|
49
52
|
};
|
|
50
53
|
export declare type IntentParams = {
|
|
51
54
|
paymentIntentClientSecret: string;
|
|
@@ -88,6 +91,10 @@ export declare type GooglePayParams = {
|
|
|
88
91
|
label?: string;
|
|
89
92
|
/** An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. */
|
|
90
93
|
amount?: string;
|
|
94
|
+
/** The Google Pay button type to use. Set to "Pay" by default. See
|
|
95
|
+
* [Google's documentation](https://developers.google.com/android/reference/com/google/android/gms/wallet/Wallet.WalletOptions#environment)
|
|
96
|
+
* for more information on button types. */
|
|
97
|
+
buttonType?: ButtonType;
|
|
91
98
|
};
|
|
92
99
|
/**
|
|
93
100
|
* Used to customize the appearance of your PaymentSheet
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
21
21
|
"bootstrap-no-pods": "yarn example && yarn",
|
|
22
22
|
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
|
|
23
|
-
"run-example-ios": "cd example;
|
|
24
|
-
"run-example-android": "cd example;
|
|
23
|
+
"run-example-ios": "cd example;react-native run-ios --configuration Release --simulator \"iPhone 15\"",
|
|
24
|
+
"run-example-android": "cd example;react-native run-android --variant=release",
|
|
25
25
|
"test:e2e:ios": "bash ./scripts/run-maestro-tests ios",
|
|
26
26
|
"test:e2e:android": "bash ./scripts/run-maestro-tests android",
|
|
27
27
|
"test:unit:ios": "xcodebuild test -workspace example/ios/StripeSdkExample.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' -scheme UnitTests",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardFieldInput } from '../types';
|
|
1
|
+
import type { CardFieldInput, CardBrand } from '../types';
|
|
2
2
|
import React, {
|
|
3
3
|
forwardRef,
|
|
4
4
|
useCallback,
|
|
@@ -43,6 +43,9 @@ export interface Props extends AccessibilityProps {
|
|
|
43
43
|
onBlur?(): void;
|
|
44
44
|
onFocus?(focusedField: CardFieldInput.FieldName | null): void;
|
|
45
45
|
testID?: string;
|
|
46
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
47
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
48
|
+
preferredNetworks?: Array<CardBrand>;
|
|
46
49
|
/**
|
|
47
50
|
* WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.
|
|
48
51
|
* Only do this if you're certain that you fulfill the necessary PCI compliance requirements.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardFormView } from '../types';
|
|
1
|
+
import type { CardFormView, CardBrand } from '../types';
|
|
2
2
|
import React, {
|
|
3
3
|
forwardRef,
|
|
4
4
|
useCallback,
|
|
@@ -36,7 +36,9 @@ export interface Props extends AccessibilityProps {
|
|
|
36
36
|
disabled?: boolean;
|
|
37
37
|
/** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */
|
|
38
38
|
cardStyle?: CardFormView.Styles;
|
|
39
|
-
|
|
39
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
40
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
41
|
+
preferredNetworks?: Array<CardBrand>;
|
|
40
42
|
// TODO: will make it public when iOS SDK allows for this
|
|
41
43
|
// postalCodeEnabled?: boolean;
|
|
42
44
|
|
package/src/types/Common.ts
CHANGED
|
@@ -26,3 +26,15 @@ export type AddressDetails = {
|
|
|
26
26
|
* */
|
|
27
27
|
isCheckboxSelected?: boolean;
|
|
28
28
|
};
|
|
29
|
+
|
|
30
|
+
export enum CardBrand {
|
|
31
|
+
JCB = 0,
|
|
32
|
+
Amex = 1,
|
|
33
|
+
CartesBancaires = 2,
|
|
34
|
+
DinersClub = 3,
|
|
35
|
+
Discover = 4,
|
|
36
|
+
Mastercard = 5,
|
|
37
|
+
UnionPay = 6,
|
|
38
|
+
Visa = 7,
|
|
39
|
+
Unknown = 8,
|
|
40
|
+
}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
CustomerSheetError,
|
|
5
5
|
BillingDetails,
|
|
6
6
|
PaymentMethod,
|
|
7
|
+
CardBrand,
|
|
7
8
|
} from '../types';
|
|
8
9
|
|
|
9
10
|
export type CustomerSheetInitParams = {
|
|
@@ -33,6 +34,9 @@ export type CustomerSheetInitParams = {
|
|
|
33
34
|
applePayEnabled?: boolean;
|
|
34
35
|
/** Whether to show Google Pay as an option. Defaults to false. */
|
|
35
36
|
googlePayEnabled?: boolean;
|
|
37
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
38
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
39
|
+
preferredNetworks?: Array<CardBrand>;
|
|
36
40
|
/** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if
|
|
37
41
|
* you would prefer retrieving and updating your Stripe customer object via your own backend instead.
|
|
38
42
|
* WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BillingDetails, AddressDetails } from './Common';
|
|
1
|
+
import type { BillingDetails, AddressDetails, CardBrand } from './Common';
|
|
2
2
|
import type { CartSummaryItem } from './ApplePay';
|
|
3
3
|
import type {
|
|
4
4
|
ButtonType,
|
|
@@ -52,6 +52,9 @@ export type SetupParams = IntentParams & {
|
|
|
52
52
|
primaryButtonLabel?: string;
|
|
53
53
|
/** Optional configuration to display a custom message when a saved payment method is removed. iOS only. */
|
|
54
54
|
removeSavedPaymentMethodMessage?: string;
|
|
55
|
+
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
56
|
+
* This value will only be used if your user hasn't selected a network themselves. */
|
|
57
|
+
preferredNetworks?: Array<CardBrand>;
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
export type IntentParams =
|
|
@@ -110,6 +113,10 @@ export type GooglePayParams = {
|
|
|
110
113
|
label?: string;
|
|
111
114
|
/** An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. */
|
|
112
115
|
amount?: string;
|
|
116
|
+
/** The Google Pay button type to use. Set to "Pay" by default. See
|
|
117
|
+
* [Google's documentation](https://developers.google.com/android/reference/com/google/android/gms/wallet/Wallet.WalletOptions#environment)
|
|
118
|
+
* for more information on button types. */
|
|
119
|
+
buttonType?: ButtonType;
|
|
113
120
|
};
|
|
114
121
|
|
|
115
122
|
/**
|
package/src/types/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
# Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
|
|
5
|
-
stripe_version = '~> 23.
|
|
5
|
+
stripe_version = '~> 23.21.0'
|
|
6
6
|
|
|
7
7
|
Pod::Spec.new do |s|
|
|
8
8
|
s.name = 'stripe-react-native'
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
android:clickable="true"
|
|
4
|
-
android:focusable="true"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="wrap_content"
|
|
7
|
-
>
|
|
8
|
-
<com.google.android.gms.wallet.button.PayButton
|
|
9
|
-
android:id="@+id/googlePayButton"
|
|
10
|
-
android:layout_width="match_parent"
|
|
11
|
-
android:layout_height="wrap_content"
|
|
12
|
-
android:layout_marginBottom="20dp"
|
|
13
|
-
/>
|
|
14
|
-
</FrameLayout>
|