@stripe/stripe-react-native 0.55.1 → 0.56.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/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +703 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +3 -2
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +46 -0
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +72 -34
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +37 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/ApplePayButtonManagerDelegate.java +12 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/ApplePayButtonManagerInterface.java +4 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +8 -64
- package/ios/ApplePayButtonManager.m +1 -1
- package/ios/ApplePayButtonView.swift +2 -2
- package/ios/NewArch/ApplePayButtonComponentView.mm +1 -1
- package/ios/OldArch/StripeSdkEventEmitterCompat.h +2 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.m +12 -0
- package/ios/StripeSdk.mm +14 -0
- package/ios/StripeSdkEmitter.swift +2 -0
- package/ios/StripeSdkImpl+CustomerSheet.swift +70 -19
- package/ios/StripeSdkImpl+PaymentSheet.swift +14 -5
- package/ios/StripeSdkImpl.swift +3 -1
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js.map +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/components/CustomerSheet.js +1 -1
- package/lib/commonjs/components/CustomerSheet.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js.map +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/AddressSheet.js +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.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/components/CustomerSheet.js +1 -1
- package/lib/module/components/CustomerSheet.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/events.js.map +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js.map +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/components/CustomerSheet.d.ts +1 -1
- package/lib/typescript/src/components/CustomerSheet.d.ts.map +1 -1
- package/lib/typescript/src/events.d.ts +2 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeApplePayButton.d.ts +1 -1
- package/lib/typescript/src/specs/NativeApplePayButton.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +3 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/ConfirmationToken.d.ts +0 -3
- package/lib/typescript/src/types/ConfirmationToken.d.ts.map +1 -1
- package/lib/typescript/src/types/CustomerSheet.d.ts +70 -12
- package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +2 -4
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +1 -6
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CustomerSheet.tsx +65 -9
- package/src/components/PlatformPayButton.tsx +1 -1
- package/src/events.ts +2 -0
- package/src/specs/NativeApplePayButton.ts +1 -1
- package/src/specs/NativeStripeSdkModule.ts +7 -0
- package/src/types/ConfirmationToken.ts +0 -3
- package/src/types/CustomerSheet.ts +80 -12
- package/src/types/EmbeddedPaymentElement.tsx +2 -4
- package/src/types/PaymentSheet.ts +1 -6
- package/stripe-react-native.podspec +1 -1
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
CreateTokenForCVCUpdateResult,
|
|
12
12
|
CreateTokenResult,
|
|
13
13
|
CustomerAdapter,
|
|
14
|
+
CustomerSessionClientSecret,
|
|
14
15
|
CustomerSheetError,
|
|
15
16
|
CustomerSheetInitParams,
|
|
16
17
|
CustomerSheetPresentParams,
|
|
@@ -175,6 +176,12 @@ export interface Spec extends TurboModule {
|
|
|
175
176
|
customerAdapterSetupIntentClientSecretForCustomerAttachCallback(
|
|
176
177
|
clientSecret: string
|
|
177
178
|
): Promise<void>;
|
|
179
|
+
clientSecretProviderSetupIntentClientSecretCallback(
|
|
180
|
+
setupIntentClientSecret: string
|
|
181
|
+
): Promise<void>;
|
|
182
|
+
clientSecretProviderCustomerSessionClientSecretCallback(
|
|
183
|
+
customerSessionClientSecret: UnsafeObject<CustomerSessionClientSecret>
|
|
184
|
+
): Promise<void>;
|
|
178
185
|
createEmbeddedPaymentElement(
|
|
179
186
|
intentConfig: UnsafeObject<IntentConfiguration>,
|
|
180
187
|
configuration: UnsafeObject<EmbeddedPaymentElementConfiguration>
|
|
@@ -4,9 +4,6 @@ import type { Type as PaymentMethodType } from './PaymentMethod';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* ConfirmationToken result type.
|
|
7
|
-
*
|
|
8
|
-
* @internal DO NOT USE - This API is under active development and is not ready for use.
|
|
9
|
-
* The API is subject to breaking changes without notice. Do not use in production or development.
|
|
10
7
|
*/
|
|
11
8
|
export interface Result {
|
|
12
9
|
/** Unique identifier for the object (e.g. `ctoken_...`). */
|
|
@@ -7,17 +7,11 @@ import type {
|
|
|
7
7
|
CardBrand,
|
|
8
8
|
} from '../types';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type CustomerSheetOptionalInitParams = {
|
|
11
11
|
/** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. iOS only. */
|
|
12
12
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
13
13
|
/** Configuration for the look and feel of the UI. */
|
|
14
14
|
appearance?: PaymentSheet.AppearanceParams;
|
|
15
|
-
/** Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. */
|
|
16
|
-
setupIntentClientSecret?: string;
|
|
17
|
-
/** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */
|
|
18
|
-
customerId: string;
|
|
19
|
-
/** A short-lived token that allows the SDK to access a Customer's payment methods. */
|
|
20
|
-
customerEphemeralKeySecret: string;
|
|
21
15
|
/** Your customer-facing business name. The default value is the name of your app. */
|
|
22
16
|
merchantDisplayName?: string;
|
|
23
17
|
/** Optional configuration for setting the header text of the Payment Method selection screen */
|
|
@@ -37,11 +31,6 @@ export type CustomerSheetInitParams = {
|
|
|
37
31
|
/** The list of preferred networks that should be used to process payments made with a co-branded card.
|
|
38
32
|
* This value will only be used if your user hasn't selected a network themselves. */
|
|
39
33
|
preferredNetworks?: Array<CardBrand>;
|
|
40
|
-
/** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if
|
|
41
|
-
* you would prefer retrieving and updating your Stripe customer object via your own backend instead.
|
|
42
|
-
* WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.
|
|
43
|
-
*/
|
|
44
|
-
customerAdapter?: CustomerAdapter;
|
|
45
34
|
/** This is an experimental feature that may be removed at any time.
|
|
46
35
|
* Defaults to true. If true, the customer can delete all saved payment methods.
|
|
47
36
|
* If false, the customer can't delete if they only have one saved payment method remaining.
|
|
@@ -56,6 +45,45 @@ export type CustomerSheetInitParams = {
|
|
|
56
45
|
cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
|
|
57
46
|
};
|
|
58
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Required params for initializing a CustomerSheet using a legacy CustomerAdapter
|
|
50
|
+
*/
|
|
51
|
+
type CustomerAdapterInitParams = {
|
|
52
|
+
/** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */
|
|
53
|
+
customerId: string;
|
|
54
|
+
/** Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. */
|
|
55
|
+
setupIntentClientSecret?: string;
|
|
56
|
+
/** A short-lived token that allows the SDK to access a Customer's payment methods. */
|
|
57
|
+
customerEphemeralKeySecret: string;
|
|
58
|
+
/** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if
|
|
59
|
+
* you would prefer retrieving and updating your Stripe customer object via your own backend instead.
|
|
60
|
+
* WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.
|
|
61
|
+
*/
|
|
62
|
+
customerAdapter?: CustomerAdapter;
|
|
63
|
+
intentConfiguration?: never;
|
|
64
|
+
clientSecretProvider?: never;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Required params for initializing a CustomerSheet with a CustomerSession
|
|
69
|
+
*/
|
|
70
|
+
type CustomerSessionInitParams = {
|
|
71
|
+
/** An object that configures the intent used to display saved payment methods to a customer.*/
|
|
72
|
+
intentConfiguration: CustomerSheetIntentConfiguration;
|
|
73
|
+
/** An object that provides the client secret for the customer session. */
|
|
74
|
+
clientSecretProvider: ClientSecretProvider;
|
|
75
|
+
customerId?: never;
|
|
76
|
+
setupIntentClientSecret?: never;
|
|
77
|
+
customerEphemeralKeySecret?: never;
|
|
78
|
+
customerAdapter?: never;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type CustomerSheetInitParams = (
|
|
82
|
+
| CustomerAdapterInitParams
|
|
83
|
+
| CustomerSessionInitParams
|
|
84
|
+
) &
|
|
85
|
+
CustomerSheetOptionalInitParams;
|
|
86
|
+
|
|
59
87
|
export type CustomerSheetPresentParams = {
|
|
60
88
|
/** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */
|
|
61
89
|
presentationStyle?:
|
|
@@ -131,3 +159,43 @@ export type CustomerPaymentOption =
|
|
|
131
159
|
| 'google_pay'
|
|
132
160
|
| 'link'
|
|
133
161
|
| string;
|
|
162
|
+
|
|
163
|
+
export interface ClientSecretProvider {
|
|
164
|
+
/**
|
|
165
|
+
* Provides the `SetupIntent` client secret that is used when attaching a payment method
|
|
166
|
+
* to a customer.
|
|
167
|
+
*/
|
|
168
|
+
provideSetupIntentClientSecret(): Promise<string>;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Provides the CustomerSessionClientSecret that will be claimed and used to access a
|
|
172
|
+
* customer's saved payment methods.
|
|
173
|
+
*/
|
|
174
|
+
provideCustomerSessionClientSecret(): Promise<CustomerSessionClientSecret>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export type CustomerSheetIntentConfiguration = {
|
|
178
|
+
/** A list of payment method types to display to the customer. If undefined or empty, we dynamically determine the payment methods using your Stripe Dashboard settings. */
|
|
179
|
+
paymentMethodTypes?: Array<string>;
|
|
180
|
+
/** The connected account whose payment method configurations will apply to the CustomerSheet session.
|
|
181
|
+
* Affects the allowed payment methods and whether card brand choice is enabled.
|
|
182
|
+
* When provided, the payment method will be saved to your platform account. See our
|
|
183
|
+
* [SetupIntent docs](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-on_behalf_of)
|
|
184
|
+
* for more information.
|
|
185
|
+
*/
|
|
186
|
+
onBehalfOf?: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type CustomerSessionClientSecret = {
|
|
190
|
+
/**
|
|
191
|
+
* The Customer the Customer Session was created for.
|
|
192
|
+
*/
|
|
193
|
+
customerId: string;
|
|
194
|
+
/**
|
|
195
|
+
* The client secret of this Customer Session.
|
|
196
|
+
* Used on the client to set up secure access to the given customer.
|
|
197
|
+
* See our [CustomerSession docs](https://docs.stripe.com/api/customer_sessions/object)
|
|
198
|
+
* for more information
|
|
199
|
+
*/
|
|
200
|
+
clientSecret: string;
|
|
201
|
+
};
|
|
@@ -135,11 +135,9 @@ export interface EmbeddedPaymentElementConfiguration {
|
|
|
135
135
|
merchantDisplayName: string;
|
|
136
136
|
/** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */
|
|
137
137
|
customerId?: string;
|
|
138
|
-
/** A short-lived token that allows the SDK to access a Customer
|
|
138
|
+
/** A short-lived token that allows the SDK to access a Customer's payment methods. */
|
|
139
139
|
customerEphemeralKeySecret?: string;
|
|
140
|
-
/**
|
|
141
|
-
* The client secret of this Customer Session. Used on the client to set up secure access to the given customer.
|
|
142
|
-
*/
|
|
140
|
+
/** The client secret of this Customer Session. Used on the client to set up secure access to the given customer. */
|
|
143
141
|
customerSessionClientSecret?: string;
|
|
144
142
|
/** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */
|
|
145
143
|
applePay?: PaymentSheetTypes.ApplePayParams;
|
|
@@ -97,9 +97,7 @@ export type SetupParams =
|
|
|
97
97
|
})
|
|
98
98
|
| (SetupParamsBase & {
|
|
99
99
|
customerEphemeralKeySecret?: never;
|
|
100
|
-
/**
|
|
101
|
-
* The client secret of this Customer Session. Used on the client to set up secure access to the given customer.
|
|
102
|
-
*/
|
|
100
|
+
/** The client secret of this Customer Session. Used on the client to set up secure access to the given customer. */
|
|
103
101
|
customerSessionClientSecret: string;
|
|
104
102
|
})
|
|
105
103
|
| SetupParamsBase;
|
|
@@ -580,9 +578,6 @@ export type IntentConfiguration = {
|
|
|
580
578
|
) => void;
|
|
581
579
|
|
|
582
580
|
/**
|
|
583
|
-
* @internal DO NOT USE - This API is under active development and is not ready for use.
|
|
584
|
-
* The API is subject to breaking changes without notice. Do not use in production or development.
|
|
585
|
-
*
|
|
586
581
|
* Called when the customer confirms payment using confirmation tokens.
|
|
587
582
|
* Your implementation should follow the guide to create (and optionally confirm) a PaymentIntent or SetupIntent on your server and call the `intentCreationCallback` with its client secret or an error if one occurred.
|
|
588
583
|
*
|
|
@@ -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 = '~> 24.
|
|
5
|
+
stripe_version = '~> 24.25.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|