@stripe/stripe-react-native 0.68.0 → 0.69.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/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/LinkControllerManager.kt +175 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +31 -24
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +8 -4
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt +9 -28
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +3 -2
- package/android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt +20 -18
- package/ios/CurrencySelectorElementView.swift +1 -1
- package/ios/Mappers+Checkout.swift +3 -3
- package/ios/OnrampErrors.swift +1 -14
- package/ios/StripeSdk.mm +15 -15
- package/ios/StripeSdkImpl+Checkout.swift +15 -39
- package/ios/StripeSdkImpl+LinkController.swift +108 -0
- package/ios/StripeSdkImpl.swift +8 -3
- 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/CurrencySelectorElement.js +1 -1
- package/lib/commonjs/components/CurrencySelectorElement.js.map +1 -1
- package/lib/commonjs/components/PaymentMethodMessagingElement.js +1 -1
- package/lib/commonjs/components/PaymentMethodMessagingElement.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/connect/Components.js +1 -1
- package/lib/commonjs/connect/Components.js.map +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
- package/lib/commonjs/connect/NavigationBar.js +1 -1
- package/lib/commonjs/connect/NavigationBar.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/hooks/useCheckout.js +1 -1
- package/lib/commonjs/hooks/useCheckout.js.map +1 -1
- package/lib/commonjs/hooks/useLinkController.js +2 -0
- package/lib/commonjs/hooks/useLinkController.js.map +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js.map +1 -1
- package/lib/commonjs/specs/NativeCardForm.js +1 -1
- package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/commonjs/specs/NativeCurrencySelectorElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
- package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +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/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/LinkController.js +2 -0
- package/lib/commonjs/types/LinkController.js.map +1 -0
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.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/CurrencySelectorElement.js +1 -1
- package/lib/module/components/CurrencySelectorElement.js.map +1 -1
- package/lib/module/components/PaymentMethodMessagingElement.js +1 -1
- package/lib/module/components/PaymentMethodMessagingElement.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/connect/Components.js +1 -1
- package/lib/module/connect/Components.js.map +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/module/connect/EmbeddedComponent.js +1 -1
- package/lib/module/connect/EmbeddedComponent.js.map +1 -1
- package/lib/module/connect/ModalCloseButton.js +1 -1
- package/lib/module/connect/ModalCloseButton.js.map +1 -1
- package/lib/module/connect/NavigationBar.js +1 -1
- package/lib/module/connect/NavigationBar.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/hooks/useCheckout.js +1 -1
- package/lib/module/hooks/useCheckout.js.map +1 -1
- package/lib/module/hooks/useLinkController.js +2 -0
- package/lib/module/hooks/useLinkController.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/module/specs/NativeCardField.js +1 -1
- package/lib/module/specs/NativeCardField.js.map +1 -1
- package/lib/module/specs/NativeCardForm.js +1 -1
- package/lib/module/specs/NativeCardForm.js.map +1 -1
- package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/module/specs/NativeCurrencySelectorElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/module/specs/NativeGooglePayButton.js +1 -1
- package/lib/module/specs/NativeNavigationBar.js +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js +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/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/LinkController.js +2 -0
- package/lib/module/types/LinkController.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/connect/Components.d.ts +1 -1
- package/lib/typescript/src/connect/Components.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts +19 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLinkController.d.ts +28 -0
- package/lib/typescript/src/hooks/useLinkController.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +5 -2
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/Checkout.d.ts +1 -14
- package/lib/typescript/src/types/Checkout.d.ts.map +1 -1
- package/lib/typescript/src/types/Errors.d.ts +8 -0
- package/lib/typescript/src/types/Errors.d.ts.map +1 -1
- package/lib/typescript/src/types/LinkController.d.ts +71 -0
- package/lib/typescript/src/types/LinkController.d.ts.map +1 -0
- package/lib/typescript/src/types/Onramp.d.ts +0 -13
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/connect/Components.tsx +10 -0
- package/src/functions.ts +48 -0
- package/src/hooks/useCheckout.tsx +0 -14
- package/src/hooks/useLinkController.tsx +54 -0
- package/src/index.tsx +1 -0
- package/src/specs/NativeStripeSdkModule.ts +11 -7
- package/src/types/Checkout.ts +1 -19
- package/src/types/Errors.ts +9 -0
- package/src/types/LinkController.ts +75 -0
- package/src/types/Onramp.ts +0 -14
- package/src/types/index.ts +2 -0
- package/stripe-react-native.podspec +1 -1
package/src/types/Errors.ts
CHANGED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Result as PaymentMethodResult } from './PaymentMethod';
|
|
2
|
+
import type { LinkControllerError, StripeError } from './Errors';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @PrivatePreview Payment method types supported by the Link flow.
|
|
6
|
+
*/
|
|
7
|
+
export enum LinkPaymentMethodType {
|
|
8
|
+
Card = 'card',
|
|
9
|
+
BankAccount = 'bankAccount',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @PrivatePreview Configuration for initializing the Link controller.
|
|
14
|
+
*/
|
|
15
|
+
export type Configuration = {
|
|
16
|
+
/** The customer's email address used for Link consumer lookup. */
|
|
17
|
+
email?: string;
|
|
18
|
+
/** Your customer-facing business name, displayed in Link UI. */
|
|
19
|
+
merchantDisplayName: string;
|
|
20
|
+
/** Payment method types to support in the Link sheet. If omitted, all available types are shown. */
|
|
21
|
+
supportedPaymentMethodTypes?: LinkPaymentMethodType[];
|
|
22
|
+
/** Customer phone number in E.164 format to prefill during signup. */
|
|
23
|
+
phoneNumber?: string;
|
|
24
|
+
/** Whether to allow the user to log out. Defaults to true. */
|
|
25
|
+
allowLogout?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Optional SetupIntent client secret. When provided, the SDK confirms the SetupIntent
|
|
28
|
+
* with the selected payment method automatically before returning.
|
|
29
|
+
*/
|
|
30
|
+
setupIntentClientSecret?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @PrivatePreview A preview of the payment method the user selected in Link.
|
|
35
|
+
* Intended for display in the host app's checkout UI after the flow completes.
|
|
36
|
+
*/
|
|
37
|
+
export type PaymentMethodPreview = {
|
|
38
|
+
/**
|
|
39
|
+
* Payment method icon as a data URI PNG string (e.g., "data:image/png;base64,...").
|
|
40
|
+
* Suitable for rendering directly in a React Native `<Image source={{ uri: icon }}>` component.
|
|
41
|
+
*/
|
|
42
|
+
icon: string;
|
|
43
|
+
/** The Link label to render in your screen. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Details about the selected Link payment method. This will typically render the display name of the payment method followed by the last four digits, e.g. `Visa Credit •••• 4242`. */
|
|
46
|
+
sublabel?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @PrivatePreview Result returned from `initLinkController`.
|
|
51
|
+
*/
|
|
52
|
+
export type InitResult =
|
|
53
|
+
| { error?: undefined }
|
|
54
|
+
| { error: StripeError<LinkControllerError> };
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @PrivatePreview Result returned from `presentLinkController`.
|
|
58
|
+
*/
|
|
59
|
+
export type PresentResult =
|
|
60
|
+
| {
|
|
61
|
+
/** The payment method created from the user's Link selection. */
|
|
62
|
+
paymentMethod: PaymentMethodResult;
|
|
63
|
+
/** A preview of the selected payment method for display purposes. */
|
|
64
|
+
paymentMethodPreview?: PaymentMethodPreview;
|
|
65
|
+
error?: undefined;
|
|
66
|
+
}
|
|
67
|
+
| {
|
|
68
|
+
paymentMethod?: undefined;
|
|
69
|
+
paymentMethodPreview?: undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Set when the operation failed or was canceled.
|
|
72
|
+
* Cancellation has `error.code === LinkControllerError.Canceled`.
|
|
73
|
+
*/
|
|
74
|
+
error: StripeError<LinkControllerError>;
|
|
75
|
+
};
|
package/src/types/Onramp.ts
CHANGED
|
@@ -273,25 +273,11 @@ export type ComplianceIdentifierRequirements = {
|
|
|
273
273
|
*/
|
|
274
274
|
export type OnrampErrorType = 'AppAttestationError' | 'UncategorizedApiError';
|
|
275
275
|
|
|
276
|
-
/**
|
|
277
|
-
* A native SDK component and version included in Crypto Onramp diagnostics.
|
|
278
|
-
*/
|
|
279
|
-
export type SDKVersion = {
|
|
280
|
-
/** The SDK component name. */
|
|
281
|
-
name: string;
|
|
282
|
-
/** The SDK component version. */
|
|
283
|
-
version: string;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
276
|
export type OnrampApiError = StripeError<OnrampError> & {
|
|
287
277
|
onrampErrorType: string;
|
|
288
278
|
developerMessage: string;
|
|
289
279
|
userMessage: string;
|
|
290
280
|
reason?: string;
|
|
291
|
-
operation: string;
|
|
292
|
-
appPackageName: string;
|
|
293
|
-
mode?: 'live' | 'test';
|
|
294
|
-
sdkVersions?: SDKVersion[];
|
|
295
281
|
requestId?: string;
|
|
296
282
|
apiErrorCode?: string;
|
|
297
283
|
apiErrorType?: string;
|
package/src/types/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ import * as FinancialConnections from './FinancialConnections';
|
|
|
28
28
|
import * as PlatformPay from './PlatformPay';
|
|
29
29
|
import * as Onramp from './Onramp';
|
|
30
30
|
import * as ConfirmationToken from './ConfirmationToken';
|
|
31
|
+
import * as LinkController from './LinkController';
|
|
31
32
|
|
|
32
33
|
export {
|
|
33
34
|
ApplePay,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
PlatformPay,
|
|
45
46
|
Onramp,
|
|
46
47
|
ConfirmationToken,
|
|
48
|
+
LinkController,
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
export * from './PushProvisioning';
|
|
@@ -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 = '26.
|
|
5
|
+
stripe_version = '26.3.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|