@stripe/stripe-react-native 0.67.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/build.gradle +3 -3
- package/android/gradle.properties +1 -1
- package/android/proguard-rules.txt +4 -0
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorAppearance.kt +229 -0
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementView.kt +8 -1
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementViewManager.kt +11 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +0 -22
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +0 -22
- package/android/src/main/java/com/reactnativestripesdk/LinkControllerManager.kt +175 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +11 -4
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +43 -38
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +6 -0
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +6 -5
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +91 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/AddToWalletButtonManagerDelegate.java +3 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/AddToWalletButtonManagerInterface.java +1 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +0 -3
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +0 -1
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerDelegate.java +4 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerInterface.java +2 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +8 -8
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt +9 -28
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +10 -9
- package/android/src/test/java/com/reactnativestripesdk/CurrencySelectorAppearanceTest.kt +137 -0
- package/android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt +20 -18
- package/ios/CurrencySelectorAppearance.swift +120 -0
- package/ios/CurrencySelectorElementManager.m +1 -0
- package/ios/CurrencySelectorElementView.swift +17 -2
- package/ios/Mappers+Checkout.swift +3 -3
- package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +0 -4
- package/ios/NewArch/StripeCurrencySelectorElementComponentView.mm +1 -0
- package/ios/OnrampErrors.swift +1 -14
- package/ios/StripeSdk.mm +15 -22
- package/ios/StripeSdkImpl+Checkout.swift +15 -39
- package/ios/StripeSdkImpl+Embedded.swift +0 -24
- package/ios/StripeSdkImpl+LinkController.swift +108 -0
- package/ios/StripeSdkImpl+PaymentSheet.swift +1 -2
- 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 +2 -2
- 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/NativeAddToWalletButton.js.map +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/NativeCurrencySelectorElement.js.map +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/PushProvisioning.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/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 +2 -2
- 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/NativeAddToWalletButton.js.map +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/NativeCurrencySelectorElement.js.map +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/PushProvisioning.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/AddToWalletButton.d.ts +2 -0
- package/lib/typescript/src/components/AddToWalletButton.d.ts.map +1 -1
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts +76 -1
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts.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/connect/EmbeddedComponent.d.ts +23 -0
- package/lib/typescript/src/connect/EmbeddedComponent.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/NativeAddToWalletButton.d.ts +1 -0
- package/lib/typescript/src/specs/NativeAddToWalletButton.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts +4 -0
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +0 -1
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +5 -3
- 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/EmbeddedPaymentElement.d.ts +1 -10
- package/lib/typescript/src/types/EmbeddedPaymentElement.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/PaymentMethod.d.ts +2 -0
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
- package/lib/typescript/src/types/PushProvisioning.d.ts +2 -0
- package/lib/typescript/src/types/PushProvisioning.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/components/AddToWalletButton.tsx +2 -0
- package/src/components/CurrencySelectorElement.tsx +101 -1
- package/src/connect/Components.tsx +10 -0
- package/src/connect/EmbeddedComponent.tsx +47 -10
- 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/NativeAddToWalletButton.ts +1 -0
- package/src/specs/NativeCurrencySelectorElement.ts +5 -0
- package/src/specs/NativeEmbeddedPaymentElement.ts +1 -10
- package/src/specs/NativeStripeSdkModule.ts +11 -10
- package/src/types/Checkout.ts +1 -19
- package/src/types/EmbeddedPaymentElement.tsx +4 -27
- package/src/types/Errors.ts +9 -0
- package/src/types/LinkController.ts +75 -0
- package/src/types/Onramp.ts +0 -14
- package/src/types/PaymentMethod.ts +2 -0
- package/src/types/PushProvisioning.ts +2 -0
- package/src/types/index.ts +2 -0
- package/stripe-react-native.podspec +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { initLinkController, presentLinkController } from '../functions';
|
|
3
|
+
import type { LinkController } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `useLinkController` hook.
|
|
7
|
+
*
|
|
8
|
+
* Provides `initLinkController` and `presentLinkController` methods with a shared
|
|
9
|
+
* `loading` state. Call `initLinkController` once when your checkout screen loads,
|
|
10
|
+
* then `presentLinkController` when the customer taps your Link button.
|
|
11
|
+
*
|
|
12
|
+
* @PrivatePreview This API is in private preview and may change without notice.
|
|
13
|
+
*/
|
|
14
|
+
export function useLinkController() {
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
|
|
17
|
+
const init = useCallback(
|
|
18
|
+
async (
|
|
19
|
+
params: LinkController.Configuration
|
|
20
|
+
): Promise<LinkController.InitResult> => {
|
|
21
|
+
setLoading(true);
|
|
22
|
+
const result = await initLinkController(params);
|
|
23
|
+
setLoading(false);
|
|
24
|
+
return result;
|
|
25
|
+
},
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const present =
|
|
30
|
+
useCallback(async (): Promise<LinkController.PresentResult> => {
|
|
31
|
+
setLoading(true);
|
|
32
|
+
const result = await presentLinkController();
|
|
33
|
+
setLoading(false);
|
|
34
|
+
return result;
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
/** Whether an operation is currently in progress. */
|
|
39
|
+
loading,
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the LinkController with the provided configuration.
|
|
42
|
+
* Must be called before `presentLinkController`.
|
|
43
|
+
*
|
|
44
|
+
* @PrivatePreview
|
|
45
|
+
*/
|
|
46
|
+
initLinkController: init,
|
|
47
|
+
/**
|
|
48
|
+
* Presents the Link flow. Must be called after `initLinkController`.
|
|
49
|
+
*
|
|
50
|
+
* @PrivatePreview
|
|
51
|
+
*/
|
|
52
|
+
presentLinkController: present,
|
|
53
|
+
};
|
|
54
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ export { usePlatformPay } from './hooks/usePlatformPay';
|
|
|
6
6
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
7
7
|
export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
|
|
8
8
|
export { useOnramp } from './hooks/useOnramp';
|
|
9
|
+
export { useLinkController } from './hooks/useLinkController';
|
|
9
10
|
|
|
10
11
|
//components
|
|
11
12
|
export { initStripe, StripeProvider } from './components/StripeProvider';
|
|
@@ -29,6 +29,7 @@ export interface NativeProps extends ViewProps {
|
|
|
29
29
|
testEnv?: boolean;
|
|
30
30
|
cardDetails: UnsafeMixed<CardDetails>;
|
|
31
31
|
token?: UnsafeMixed<GooglePayCardToken> | null;
|
|
32
|
+
isBounceProvisioned?: boolean;
|
|
32
33
|
ephemeralKey: UnsafeMixed<object>;
|
|
33
34
|
onCompleteAction?: DirectEventHandler<AddToWalletButtonCompleteEvent>;
|
|
34
35
|
}
|
|
@@ -5,6 +5,8 @@ import type {
|
|
|
5
5
|
Double,
|
|
6
6
|
WithDefault,
|
|
7
7
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
8
|
+
import type { CurrencySelectorAppearance } from '../components/CurrencySelectorElement';
|
|
9
|
+
import type { UnsafeMixed } from './utils';
|
|
8
10
|
|
|
9
11
|
export interface HeightChangeEvent {
|
|
10
12
|
height: Double;
|
|
@@ -23,6 +25,9 @@ export interface NativeProps extends ViewProps {
|
|
|
23
25
|
/** When true, the toggle is visible but ignores user interaction. */
|
|
24
26
|
disabled?: WithDefault<boolean, false>;
|
|
25
27
|
|
|
28
|
+
/** Appearance overrides for the selector. */
|
|
29
|
+
appearance?: UnsafeMixed<CurrencySelectorAppearance>;
|
|
30
|
+
|
|
26
31
|
/**
|
|
27
32
|
* Fired whenever the element's intrinsic height changes so the RN
|
|
28
33
|
* layout system can update the containing view.
|
|
@@ -20,19 +20,10 @@ export interface NativeCommands {
|
|
|
20
20
|
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
21
21
|
intentConfigurationJson: string
|
|
22
22
|
) => void;
|
|
23
|
-
updateWithCheckout: (
|
|
24
|
-
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
25
|
-
sessionKey: string
|
|
26
|
-
) => void;
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
30
|
-
supportedCommands: [
|
|
31
|
-
'confirm',
|
|
32
|
-
'clearPaymentOption',
|
|
33
|
-
'update',
|
|
34
|
-
'updateWithCheckout',
|
|
35
|
-
],
|
|
26
|
+
supportedCommands: ['confirm', 'clearPaymentOption', 'update'],
|
|
36
27
|
});
|
|
37
28
|
|
|
38
29
|
type ComponentType = HostComponent<NativeProps>;
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
InitialiseParams,
|
|
23
23
|
InitPaymentSheetResult,
|
|
24
24
|
IsCardInWalletResult,
|
|
25
|
+
LinkController,
|
|
25
26
|
OpenApplePaySetupResult,
|
|
26
27
|
PaymentIntent,
|
|
27
28
|
PaymentMethod,
|
|
@@ -209,9 +210,6 @@ export interface Spec extends TurboModule {
|
|
|
209
210
|
updateEmbeddedPaymentElement(
|
|
210
211
|
intentConfig: UnsafeObject<IntentConfiguration>
|
|
211
212
|
): Promise<UnsafeObject<any> | null>;
|
|
212
|
-
updateEmbeddedPaymentElementWithCheckout(
|
|
213
|
-
sessionKey: string
|
|
214
|
-
): Promise<UnsafeObject<any> | null>;
|
|
215
213
|
clearEmbeddedPaymentOption(viewTag: Int32): Promise<void>;
|
|
216
214
|
createRadarSession(): Promise<CreateRadarSessionResult>;
|
|
217
215
|
|
|
@@ -229,13 +227,6 @@ export interface Spec extends TurboModule {
|
|
|
229
227
|
phone: string | null
|
|
230
228
|
): Promise<UnsafeObject<Checkout.State>>;
|
|
231
229
|
|
|
232
|
-
checkoutUpdateBillingAddress(
|
|
233
|
-
sessionKey: string,
|
|
234
|
-
address: UnsafeObject<Checkout.Address>,
|
|
235
|
-
name: string | null,
|
|
236
|
-
phone: string | null
|
|
237
|
-
): Promise<UnsafeObject<Checkout.State>>;
|
|
238
|
-
|
|
239
230
|
checkoutApplyPromotionCode(
|
|
240
231
|
sessionKey: string,
|
|
241
232
|
code: string
|
|
@@ -281,6 +272,16 @@ export interface Spec extends TurboModule {
|
|
|
281
272
|
storeStripeConnectDeepLink(url: string): Promise<void>;
|
|
282
273
|
pollAndClearPendingStripeConnectUrls(): Promise<string[]>;
|
|
283
274
|
|
|
275
|
+
// LinkController - Private Preview
|
|
276
|
+
|
|
277
|
+
/** @PrivatePreview */
|
|
278
|
+
initLinkController(
|
|
279
|
+
params: UnsafeObject<LinkController.Configuration>
|
|
280
|
+
): Promise<UnsafeObject<LinkController.InitResult>>;
|
|
281
|
+
|
|
282
|
+
/** @PrivatePreview */
|
|
283
|
+
presentLinkController(): Promise<UnsafeObject<LinkController.PresentResult>>;
|
|
284
|
+
|
|
284
285
|
// Events
|
|
285
286
|
addListener: (eventType: string) => void;
|
|
286
287
|
removeListeners: (count: number) => void;
|
package/src/types/Checkout.ts
CHANGED
|
@@ -103,7 +103,7 @@ export namespace Checkout {
|
|
|
103
103
|
tax: Tax;
|
|
104
104
|
/** Tax and discount details for the computed total amount. */
|
|
105
105
|
total?: Total;
|
|
106
|
-
/** The billing address
|
|
106
|
+
/** The billing address for this session, if any. */
|
|
107
107
|
billingAddress?: ContactAddress;
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -507,24 +507,6 @@ export interface Checkout {
|
|
|
507
507
|
phone?: string
|
|
508
508
|
): Promise<void>;
|
|
509
509
|
|
|
510
|
-
/**
|
|
511
|
-
* Sets the billing address for this checkout.
|
|
512
|
-
*
|
|
513
|
-
* The address is stored locally and merged into PaymentSheet configuration
|
|
514
|
-
* when presenting payment UI. If automatic tax is enabled and the tax
|
|
515
|
-
* address source is "billing", the address is also sent to the server to
|
|
516
|
-
* compute updated tax amounts.
|
|
517
|
-
*
|
|
518
|
-
* @param address - The billing address to set.
|
|
519
|
-
* @param name - The customer's name.
|
|
520
|
-
* @param phone - The customer's phone number.
|
|
521
|
-
*/
|
|
522
|
-
updateBillingAddress(
|
|
523
|
-
address: Checkout.Address,
|
|
524
|
-
name?: string,
|
|
525
|
-
phone?: string
|
|
526
|
-
): Promise<void>;
|
|
527
|
-
|
|
528
510
|
/**
|
|
529
511
|
* Applies a promotion code to the session.
|
|
530
512
|
* - Parameter code: The promotion code to apply (e.g. `"SUMMER2026"`).
|
|
@@ -251,12 +251,6 @@ class EmbeddedPaymentElement {
|
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
async updateCheckout(checkout: Checkout): Promise<unknown> {
|
|
255
|
-
return await NativeStripeSdkModule.updateEmbeddedPaymentElementWithCheckout(
|
|
256
|
-
checkout.sessionKey
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
254
|
/**
|
|
261
255
|
* Confirm the payment or setup intent.
|
|
262
256
|
* Waits for any in-progress `update()` call to finish before proceeding.
|
|
@@ -438,16 +432,7 @@ export interface UseEmbeddedPaymentElementResult {
|
|
|
438
432
|
* @note Upon completion, `paymentOption` may become null if it's no longer available.
|
|
439
433
|
* @note If you call `update` while a previous call to `update` is still in progress, the previous call is canceled.
|
|
440
434
|
*/
|
|
441
|
-
update:
|
|
442
|
-
(intentConfig: PaymentSheetTypes.IntentConfiguration): void;
|
|
443
|
-
/**
|
|
444
|
-
* Call this method when the Checkout Session values you used to initialize
|
|
445
|
-
* `EmbeddedPaymentElement` change.
|
|
446
|
-
* @checkoutSessionsPreview
|
|
447
|
-
* @internal
|
|
448
|
-
*/
|
|
449
|
-
(checkout: Checkout): void;
|
|
450
|
-
};
|
|
435
|
+
update: (intentConfig: PaymentSheetTypes.IntentConfiguration) => void;
|
|
451
436
|
// Sets the currently selected payment option to null
|
|
452
437
|
clearPaymentOption: () => void;
|
|
453
438
|
// Any error encountered during creation/update, or null
|
|
@@ -642,9 +627,7 @@ export function useEmbeddedPaymentElement(
|
|
|
642
627
|
return getElementOrThrow(elementRef).confirm();
|
|
643
628
|
}, [isAndroid]);
|
|
644
629
|
const update = useCallback(
|
|
645
|
-
(
|
|
646
|
-
updateSource: PaymentSheetTypes.IntentConfiguration | Checkout
|
|
647
|
-
): Promise<unknown> => {
|
|
630
|
+
(updateSource: PaymentSheetTypes.IntentConfiguration): Promise<unknown> => {
|
|
648
631
|
if (isAndroid) {
|
|
649
632
|
const currentRef = viewRef.current;
|
|
650
633
|
if (currentRef) {
|
|
@@ -656,11 +639,7 @@ export function useEmbeddedPaymentElement(
|
|
|
656
639
|
resolve(result);
|
|
657
640
|
}
|
|
658
641
|
);
|
|
659
|
-
|
|
660
|
-
Commands.updateWithCheckout(currentRef, updateSource.sessionKey);
|
|
661
|
-
} else {
|
|
662
|
-
Commands.update(currentRef, JSON.stringify(updateSource));
|
|
663
|
-
}
|
|
642
|
+
Commands.update(currentRef, JSON.stringify(updateSource));
|
|
664
643
|
});
|
|
665
644
|
}
|
|
666
645
|
return Promise.reject(
|
|
@@ -670,9 +649,7 @@ export function useEmbeddedPaymentElement(
|
|
|
670
649
|
|
|
671
650
|
// iOS: use native module directly
|
|
672
651
|
const embeddedElement = getElementOrThrow(elementRef);
|
|
673
|
-
return
|
|
674
|
-
? embeddedElement.updateCheckout(updateSource)
|
|
675
|
-
: embeddedElement.updateIntent(updateSource);
|
|
652
|
+
return embeddedElement.updateIntent(updateSource);
|
|
676
653
|
},
|
|
677
654
|
[isAndroid]
|
|
678
655
|
);
|
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;
|
|
@@ -304,4 +304,6 @@ export type CollectBankAccountTokenParams = {
|
|
|
304
304
|
style?: UserInterfaceStyle;
|
|
305
305
|
/** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
|
|
306
306
|
onEvent?: (event: FinancialConnectionsEvent) => void;
|
|
307
|
+
/** Optional connected account ID. Used for Stripe Connect embedded components. */
|
|
308
|
+
connectedAccountId?: string;
|
|
307
309
|
};
|
|
@@ -49,6 +49,8 @@ export type CanAddCardToWalletParams = {
|
|
|
49
49
|
primaryAccountIdentifier: string | null;
|
|
50
50
|
/** Last 4 digits of the card number. Required for Android. */
|
|
51
51
|
cardLastFour: string;
|
|
52
|
+
/** The card brand (e.g. "visa", "mastercard"). Required for Android. */
|
|
53
|
+
cardBrand: string;
|
|
52
54
|
/** 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 */
|
|
53
55
|
testEnv?: boolean;
|
|
54
56
|
/** 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. */
|
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 = '
|
|
5
|
+
stripe_version = '26.3.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|