@stripe/stripe-react-native 0.62.0 → 0.64.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/EventEmitterCompat.kt +4 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +22 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +6 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +5 -5
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +8 -11
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +47 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +21 -2
- package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +33 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +301 -0
- package/ios/AddressSheet/AddressSheetUtils.swift +23 -0
- package/ios/AddressSheet/AddressSheetView.swift +9 -14
- package/ios/Mappers.swift +74 -0
- package/ios/PaymentMethodFactory.swift +19 -0
- package/ios/StripeOnrampSdk.h +3 -4
- package/ios/StripeSdk-Bridging-Header.h +1 -0
- package/ios/StripeSdk.mm +1 -1
- package/ios/StripeSdkImpl.swift +38 -10
- package/ios/StripeSwiftInterop.h +1 -0
- package/jest/mock.js +2 -0
- 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/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/components/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.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/connect/testUtils.js +1 -1
- package/lib/commonjs/connect/testUtils.js.map +1 -1
- package/lib/commonjs/events.js +1 -1
- package/lib/commonjs/events.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/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.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/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/NativeOnrampSdkModule.js +1 -1
- package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +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/Onramp.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.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/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/components/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.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/connect/testUtils.js +1 -1
- package/lib/module/connect/testUtils.js.map +1 -1
- package/lib/module/events.js +1 -1
- package/lib/module/events.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/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.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/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/NativeOnrampSdkModule.js +1 -1
- package/lib/module/specs/NativeOnrampSdkModule.js.map +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/Onramp.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/typescript/src/connect/connectTypes.d.ts +76 -0
- package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -1
- package/lib/typescript/src/connect/testUtils.d.ts +4 -0
- package/lib/typescript/src/connect/testUtils.d.ts.map +1 -1
- package/lib/typescript/src/events.d.ts +5 -3
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts +2 -0
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +8 -3
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +3 -3
- package/lib/typescript/src/specs/NativeOnrampSdkModule.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/NextAction.d.ts +8 -1
- package/lib/typescript/src/types/NextAction.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +40 -1
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +11 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentMethod.d.ts +10 -2
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/StripeProvider.tsx +1 -1
- package/src/connect/connectTypes.ts +88 -0
- package/src/connect/testUtils.ts +2 -0
- package/src/events.ts +14 -11
- package/src/functions.ts +1 -1
- package/src/hooks/useOnramp.tsx +38 -23
- package/src/specs/NativeOnrampSdkModule.ts +3 -3
- package/src/specs/NativeStripeSdkModule.ts +3 -1
- package/src/types/NextAction.ts +9 -0
- package/src/types/Onramp.ts +45 -1
- package/src/types/PaymentIntent.ts +10 -0
- package/src/types/PaymentMethod.ts +9 -0
- package/stripe-react-native.podspec +1 -1
- package/android/.idea/.name +0 -1
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/android.iml +0 -9
- package/android/.idea/caches/deviceStreaming.xml +0 -1550
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/kotlinc.xml +0 -7
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentMethod.d.ts","sourceRoot":"","sources":["../../../../src/types/PaymentMethod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EACV,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,IAAI,CAAC;IACxB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,SAAS,EAAE,eAAe,CAAC;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,eAAe,CAAC;IAC3B,GAAG,EAAE,SAAS,CAAC;IACf,aAAa,EAAE,mBAAmB,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,WAAW,GACX,UAAU,GACV,SAAS,GACT,YAAY,GACZ,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,aAAa,GACb,SAAS,GACT,s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AAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,4MAA4M;IAC5M,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,mKAAmK;IACnK,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -52,7 +52,7 @@ export const initStripe = async (params: InitStripeParams): Promise<void> => {
|
|
|
52
52
|
await NativeStripeSdk.initialise(extendedParams);
|
|
53
53
|
|
|
54
54
|
if (Platform.OS === 'android') {
|
|
55
|
-
await NativeOnrampSdk
|
|
55
|
+
await NativeOnrampSdk?.initialise(extendedParams);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -302,6 +302,44 @@ export declare type AppearanceVariables = {
|
|
|
302
302
|
*/
|
|
303
303
|
buttonSecondaryColorText?: string;
|
|
304
304
|
|
|
305
|
+
// Danger Button
|
|
306
|
+
/**
|
|
307
|
+
* The color used as a background for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
308
|
+
*/
|
|
309
|
+
buttonDangerColorBackground?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The color used as a border for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
312
|
+
*/
|
|
313
|
+
buttonDangerColorBorder?: string;
|
|
314
|
+
/**
|
|
315
|
+
* The text color used for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
316
|
+
*/
|
|
317
|
+
buttonDangerColorText?: string;
|
|
318
|
+
|
|
319
|
+
// Button Padding
|
|
320
|
+
/**
|
|
321
|
+
* The horizontal padding for buttons. This accepts a valid padding value.
|
|
322
|
+
*/
|
|
323
|
+
buttonPaddingX?: string;
|
|
324
|
+
/**
|
|
325
|
+
* The vertical padding for buttons. This accepts a valid padding value.
|
|
326
|
+
*/
|
|
327
|
+
buttonPaddingY?: string;
|
|
328
|
+
|
|
329
|
+
// Button Typography
|
|
330
|
+
/**
|
|
331
|
+
* The font size for button label typography. Button label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
|
|
332
|
+
*/
|
|
333
|
+
buttonLabelFontSize?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The font weight for button label typography. Button label typography variables accept a valid font weight value.
|
|
336
|
+
*/
|
|
337
|
+
buttonLabelFontWeight?: string;
|
|
338
|
+
/**
|
|
339
|
+
* The text transform for button label typography. Button label typography variables accept a valid text transform value.
|
|
340
|
+
*/
|
|
341
|
+
buttonLabelTextTransform?: string;
|
|
342
|
+
|
|
305
343
|
/**
|
|
306
344
|
* The color used for secondary text. This accepts hex values or RGB/RGBA/HSL strings.
|
|
307
345
|
*/
|
|
@@ -326,6 +364,10 @@ export declare type AppearanceVariables = {
|
|
|
326
364
|
* The thickness of text decoration of primary actions and links. This accepts a valid text decoration thickness value.
|
|
327
365
|
*/
|
|
328
366
|
actionPrimaryTextDecorationThickness?: string;
|
|
367
|
+
/**
|
|
368
|
+
* The text transform for primary actions and links. This accepts a valid text transform value.
|
|
369
|
+
*/
|
|
370
|
+
actionPrimaryTextTransform?: string;
|
|
329
371
|
/**
|
|
330
372
|
* The color used for secondary actions and links. This accepts hex values or RGB/HSL strings.
|
|
331
373
|
*/
|
|
@@ -346,6 +388,10 @@ export declare type AppearanceVariables = {
|
|
|
346
388
|
* The thickness of text decoration of secondary actions and links. This accepts a valid text decoration thickness value.
|
|
347
389
|
*/
|
|
348
390
|
actionSecondaryTextDecorationThickness?: string;
|
|
391
|
+
/**
|
|
392
|
+
* The text transform for secondary actions and links. This accepts a valid text transform value.
|
|
393
|
+
*/
|
|
394
|
+
actionSecondaryTextTransform?: string;
|
|
349
395
|
|
|
350
396
|
// Neutral Badge Colors
|
|
351
397
|
/**
|
|
@@ -403,6 +449,30 @@ export declare type AppearanceVariables = {
|
|
|
403
449
|
*/
|
|
404
450
|
badgeDangerColorBorder?: string;
|
|
405
451
|
|
|
452
|
+
// Badge Padding
|
|
453
|
+
/**
|
|
454
|
+
* The horizontal padding used for badges. This supports pixel values only.
|
|
455
|
+
*/
|
|
456
|
+
badgePaddingX?: string;
|
|
457
|
+
/**
|
|
458
|
+
* The vertical padding used for badges. This supports pixel values only.
|
|
459
|
+
*/
|
|
460
|
+
badgePaddingY?: string;
|
|
461
|
+
|
|
462
|
+
// Badge Typography
|
|
463
|
+
/**
|
|
464
|
+
* The font size for badge label typography. Badge label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
|
|
465
|
+
*/
|
|
466
|
+
badgeLabelFontSize?: string;
|
|
467
|
+
/**
|
|
468
|
+
* The font weight for badge label typography. Badge label typography variables accept a valid font weight value.
|
|
469
|
+
*/
|
|
470
|
+
badgeLabelFontWeight?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The text transform for badge label typography. Badge label typography variables accept a valid text transform value.
|
|
473
|
+
*/
|
|
474
|
+
badgeLabelTextTransform?: string;
|
|
475
|
+
|
|
406
476
|
// Background
|
|
407
477
|
/**
|
|
408
478
|
* The background color used when highlighting information, like the selected row on a table or particular piece of UI. This accepts hex values or RGB/HSL strings.
|
|
@@ -427,6 +497,24 @@ export declare type AppearanceVariables = {
|
|
|
427
497
|
* The color used for to fill in form items like checkboxes, radio buttons and switches. This accepts hex values or RGB/HSL strings.
|
|
428
498
|
*/
|
|
429
499
|
formAccentColor?: string;
|
|
500
|
+
/**
|
|
501
|
+
* The color used for placeholder text in form items. This accepts hex values or RGB/HSL strings.
|
|
502
|
+
*/
|
|
503
|
+
formPlaceholderTextColor?: string;
|
|
504
|
+
/**
|
|
505
|
+
* The horizontal padding used for input fields in forms. This supports pixel values only.
|
|
506
|
+
*/
|
|
507
|
+
inputFieldPaddingX?: string;
|
|
508
|
+
/**
|
|
509
|
+
* The vertical padding used for input fields in forms. This supports pixel values only.
|
|
510
|
+
*/
|
|
511
|
+
inputFieldPaddingY?: string;
|
|
512
|
+
|
|
513
|
+
// Table
|
|
514
|
+
/**
|
|
515
|
+
* The vertical padding used for table rows. This supports pixel values only.
|
|
516
|
+
*/
|
|
517
|
+
tableRowPaddingY?: string;
|
|
430
518
|
|
|
431
519
|
// Border Sizing
|
|
432
520
|
/**
|
package/src/connect/testUtils.ts
CHANGED
package/src/events.ts
CHANGED
|
@@ -76,22 +76,25 @@ export function addListener<EventT extends keyof Events>(
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const compatOnrampEventEmitter =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
? Platform.OS === 'ios'
|
|
79
|
+
NativeOnrampSdkModule == null
|
|
80
|
+
? null
|
|
81
|
+
: Platform.OS === 'ios'
|
|
83
82
|
? new NativeEventEmitter(NativeOnrampSdkModule as any)
|
|
84
|
-
: DeviceEventEmitter
|
|
85
|
-
: null;
|
|
83
|
+
: DeviceEventEmitter;
|
|
86
84
|
|
|
87
|
-
type
|
|
85
|
+
type OnrampEventMap = {
|
|
86
|
+
onCheckoutClientSecretRequested: void;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type OnrampEvents = keyof OnrampEventMap;
|
|
88
90
|
|
|
89
91
|
export function addOnrampListener<EventT extends OnrampEvents>(
|
|
90
92
|
event: EventT,
|
|
91
|
-
handler:
|
|
93
|
+
handler: (params: OnrampEventMap[EventT]) => void
|
|
92
94
|
): EventSubscription {
|
|
93
|
-
if (compatOnrampEventEmitter
|
|
94
|
-
|
|
95
|
+
if (compatOnrampEventEmitter == null) {
|
|
96
|
+
// Return a no-op subscription when module is not available
|
|
97
|
+
return { remove: () => {} } as EventSubscription;
|
|
95
98
|
}
|
|
96
|
-
return
|
|
99
|
+
return compatOnrampEventEmitter.addListener(event, handler);
|
|
97
100
|
}
|
package/src/functions.ts
CHANGED
package/src/hooks/useOnramp.tsx
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { EventSubscription } from 'react-native';
|
|
2
2
|
import NativeOnrampSdk from '../specs/NativeOnrampSdkModule';
|
|
3
3
|
import { Onramp, OnrampError, StripeError } from '../types';
|
|
4
|
-
import type { Address
|
|
4
|
+
import type { Address } from '../types';
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
import { addOnrampListener } from '../events';
|
|
7
7
|
import { CryptoPaymentToken } from '../types/Onramp';
|
|
8
8
|
|
|
9
|
+
function requireOnrampModule() {
|
|
10
|
+
if (NativeOnrampSdk == null) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
"Onramp module is not available. On Android, add 'StripeSdk_includeOnramp=true' to gradle.properties."
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return NativeOnrampSdk;
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
let onCheckoutClientSecretRequestedSubscription: EventSubscription | null =
|
|
10
19
|
null;
|
|
11
20
|
|
|
@@ -17,14 +26,14 @@ export function useOnramp() {
|
|
|
17
26
|
async (
|
|
18
27
|
config: Onramp.Configuration
|
|
19
28
|
): Promise<{ error?: StripeError<OnrampError> }> => {
|
|
20
|
-
return
|
|
29
|
+
return requireOnrampModule().configureOnramp(config);
|
|
21
30
|
},
|
|
22
31
|
[]
|
|
23
32
|
);
|
|
24
33
|
|
|
25
34
|
const _hasLinkAccount = useCallback(
|
|
26
35
|
async (email: string): Promise<Onramp.HasLinkAccountResult> => {
|
|
27
|
-
return
|
|
36
|
+
return requireOnrampModule().hasLinkAccount(email);
|
|
28
37
|
},
|
|
29
38
|
[]
|
|
30
39
|
);
|
|
@@ -33,7 +42,7 @@ export function useOnramp() {
|
|
|
33
42
|
async (
|
|
34
43
|
info: Onramp.LinkUserInfo
|
|
35
44
|
): Promise<Onramp.RegisterLinkUserResult> => {
|
|
36
|
-
return
|
|
45
|
+
return requireOnrampModule().registerLinkUser(info);
|
|
37
46
|
},
|
|
38
47
|
[]
|
|
39
48
|
);
|
|
@@ -43,7 +52,10 @@ export function useOnramp() {
|
|
|
43
52
|
walletAddress: string,
|
|
44
53
|
network: Onramp.CryptoNetwork
|
|
45
54
|
): Promise<{ error?: StripeError<OnrampError> }> => {
|
|
46
|
-
return
|
|
55
|
+
return requireOnrampModule().registerWalletAddress(
|
|
56
|
+
walletAddress,
|
|
57
|
+
network
|
|
58
|
+
);
|
|
47
59
|
},
|
|
48
60
|
[]
|
|
49
61
|
);
|
|
@@ -52,14 +64,14 @@ export function useOnramp() {
|
|
|
52
64
|
async (
|
|
53
65
|
kycInfo: Onramp.KycInfo
|
|
54
66
|
): Promise<{ error?: StripeError<OnrampError> }> => {
|
|
55
|
-
return
|
|
67
|
+
return requireOnrampModule().attachKycInfo(kycInfo);
|
|
56
68
|
},
|
|
57
69
|
[]
|
|
58
70
|
);
|
|
59
71
|
|
|
60
72
|
const _presentKycInfoVerification = useCallback(
|
|
61
73
|
async (updatedAddress: Address | null): Promise<Onramp.VerifyKycResult> => {
|
|
62
|
-
return
|
|
74
|
+
return requireOnrampModule().presentKycInfoVerification(updatedAddress);
|
|
63
75
|
},
|
|
64
76
|
[]
|
|
65
77
|
);
|
|
@@ -68,7 +80,7 @@ export function useOnramp() {
|
|
|
68
80
|
async (
|
|
69
81
|
linkAuthTokenClientSecret: string
|
|
70
82
|
): Promise<{ error?: StripeError<OnrampError> }> => {
|
|
71
|
-
return
|
|
83
|
+
return requireOnrampModule().authenticateUserWithToken(
|
|
72
84
|
linkAuthTokenClientSecret
|
|
73
85
|
);
|
|
74
86
|
},
|
|
@@ -77,7 +89,7 @@ export function useOnramp() {
|
|
|
77
89
|
|
|
78
90
|
const _updatePhoneNumber = useCallback(
|
|
79
91
|
async (phone: string): Promise<{ error?: StripeError<OnrampError> }> => {
|
|
80
|
-
return
|
|
92
|
+
return requireOnrampModule().updatePhoneNumber(phone);
|
|
81
93
|
},
|
|
82
94
|
[]
|
|
83
95
|
);
|
|
@@ -85,7 +97,7 @@ export function useOnramp() {
|
|
|
85
97
|
const _verifyIdentity = useCallback(async (): Promise<{
|
|
86
98
|
error?: StripeError<OnrampError>;
|
|
87
99
|
}> => {
|
|
88
|
-
return
|
|
100
|
+
return requireOnrampModule().verifyIdentity();
|
|
89
101
|
}, []);
|
|
90
102
|
|
|
91
103
|
/**
|
|
@@ -107,16 +119,14 @@ export function useOnramp() {
|
|
|
107
119
|
): Promise<Onramp.CollectPaymentMethodResult>;
|
|
108
120
|
(
|
|
109
121
|
paymentMethod: 'PlatformPay',
|
|
110
|
-
platformPayParams:
|
|
122
|
+
platformPayParams: Onramp.OnrampPlatformPayParams
|
|
111
123
|
): Promise<Onramp.CollectPaymentMethodResult>;
|
|
112
124
|
} = useCallback(
|
|
113
125
|
async (
|
|
114
126
|
paymentMethod: OnrampPaymentMethod,
|
|
115
|
-
platformPayParams?:
|
|
116
|
-
| PlatformPay.PaymentMethodParams
|
|
117
|
-
| Record<string, never>
|
|
127
|
+
platformPayParams?: Onramp.OnrampPlatformPayParams | Record<string, never>
|
|
118
128
|
): Promise<Onramp.CollectPaymentMethodResult> => {
|
|
119
|
-
return
|
|
129
|
+
return requireOnrampModule().collectPaymentMethod(
|
|
120
130
|
paymentMethod,
|
|
121
131
|
(platformPayParams ?? {}) as any
|
|
122
132
|
);
|
|
@@ -126,7 +136,7 @@ export function useOnramp() {
|
|
|
126
136
|
|
|
127
137
|
const _createCryptoPaymentToken =
|
|
128
138
|
useCallback(async (): Promise<Onramp.CreateCryptoPaymentTokenResult> => {
|
|
129
|
-
return
|
|
139
|
+
return requireOnrampModule().createCryptoPaymentToken();
|
|
130
140
|
}, []);
|
|
131
141
|
|
|
132
142
|
const _performCheckout = useCallback(
|
|
@@ -140,20 +150,20 @@ export function useOnramp() {
|
|
|
140
150
|
async () => {
|
|
141
151
|
try {
|
|
142
152
|
const clientSecret = await provideCheckoutClientSecret();
|
|
143
|
-
|
|
153
|
+
requireOnrampModule().provideCheckoutClientSecret(clientSecret);
|
|
144
154
|
} catch (error: any) {
|
|
145
|
-
|
|
155
|
+
requireOnrampModule().provideCheckoutClientSecret(null);
|
|
146
156
|
}
|
|
147
157
|
}
|
|
148
158
|
);
|
|
149
|
-
return
|
|
159
|
+
return requireOnrampModule().performCheckout(onrampSessionId);
|
|
150
160
|
},
|
|
151
161
|
[]
|
|
152
162
|
);
|
|
153
163
|
|
|
154
164
|
const _authorize = useCallback(
|
|
155
165
|
async (linkAuthIntentId: string): Promise<Onramp.AuthorizeResult> => {
|
|
156
|
-
return
|
|
166
|
+
return requireOnrampModule().onrampAuthorize(linkAuthIntentId);
|
|
157
167
|
},
|
|
158
168
|
[]
|
|
159
169
|
);
|
|
@@ -162,7 +172,7 @@ export function useOnramp() {
|
|
|
162
172
|
async (
|
|
163
173
|
token: CryptoPaymentToken
|
|
164
174
|
): Promise<Onramp.PaymentDisplayDataResult> => {
|
|
165
|
-
return
|
|
175
|
+
return requireOnrampModule().getCryptoTokenDisplayData(token);
|
|
166
176
|
},
|
|
167
177
|
[]
|
|
168
178
|
);
|
|
@@ -170,7 +180,7 @@ export function useOnramp() {
|
|
|
170
180
|
const _logOut = useCallback(async (): Promise<{
|
|
171
181
|
error?: StripeError<OnrampError>;
|
|
172
182
|
}> => {
|
|
173
|
-
return
|
|
183
|
+
return requireOnrampModule().logout();
|
|
174
184
|
}, []);
|
|
175
185
|
|
|
176
186
|
const _isAuthError = (error?: StripeError<OnrampError>): boolean => {
|
|
@@ -273,7 +283,12 @@ export function useOnramp() {
|
|
|
273
283
|
* @param platformPayParams Platform-specific parameters (required when `paymentMethod` is 'PlatformPay').
|
|
274
284
|
* - iOS: provide `applePay` params
|
|
275
285
|
* - Android: provide `googlePay` params
|
|
276
|
-
*
|
|
286
|
+
* - To receive Apple Pay billing details back as `kycInfo`, request `.name` and/or `.postalAddress`
|
|
287
|
+
* in `applePay.requiredBillingContactFields`
|
|
288
|
+
* - To receive Google Pay billing details back as `kycInfo`, ensure that the `GooglePayConfig`
|
|
289
|
+
* passed to `configure` has `billingAddressConfig` with `format` set to `Full` and the desired fields
|
|
290
|
+
* set to `true`.
|
|
291
|
+
* @returns Promise that resolves to an object with displayData, optional kycInfo, or error
|
|
277
292
|
*/
|
|
278
293
|
collectPaymentMethod: _collectPaymentMethod,
|
|
279
294
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TurboModuleRegistry } from 'react-native';
|
|
2
2
|
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
|
|
3
|
-
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
3
|
import type { Address, InitialiseParams, Onramp } from '../types';
|
|
5
4
|
import type { UnsafeObject } from './utils';
|
|
6
5
|
|
|
@@ -33,7 +32,6 @@ export interface Spec extends TurboModule {
|
|
|
33
32
|
platformPayParams: UnsafeObject<any>
|
|
34
33
|
): Promise<Onramp.CollectPaymentMethodResult>;
|
|
35
34
|
provideCheckoutClientSecret(clientSecret: string | null): void;
|
|
36
|
-
onCheckoutClientSecretRequested: EventEmitter<UnsafeObject<any>>;
|
|
37
35
|
createCryptoPaymentToken(): Promise<Onramp.CreateCryptoPaymentTokenResult>;
|
|
38
36
|
performCheckout(onrampSessionId: string): Promise<Onramp.VoidResult>;
|
|
39
37
|
onrampAuthorize(linkAuthIntentId: string): Promise<Onramp.AuthorizeResult>;
|
|
@@ -41,6 +39,8 @@ export interface Spec extends TurboModule {
|
|
|
41
39
|
token: UnsafeObject<Onramp.CryptoPaymentToken>
|
|
42
40
|
): Promise<Onramp.PaymentDisplayDataResult>;
|
|
43
41
|
logout(): Promise<Onramp.VoidResult>;
|
|
42
|
+
addListener: (eventType: string) => void;
|
|
43
|
+
removeListeners: (count: number) => void;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export default TurboModuleRegistry.
|
|
46
|
+
export default TurboModuleRegistry.get<Spec>('OnrampSdk');
|
|
@@ -63,7 +63,7 @@ export interface Spec extends TurboModule {
|
|
|
63
63
|
): Promise<HandleNextActionForSetupResult>;
|
|
64
64
|
confirmPayment(
|
|
65
65
|
paymentIntentClientSecret: string,
|
|
66
|
-
params
|
|
66
|
+
params: UnsafeObject<PaymentIntent.ConfirmParams> | null,
|
|
67
67
|
options?: UnsafeObject<PaymentIntent.ConfirmOptions>
|
|
68
68
|
): Promise<ConfirmPaymentResult>;
|
|
69
69
|
confirmSetupIntent(
|
|
@@ -117,6 +117,8 @@ export interface Spec extends TurboModule {
|
|
|
117
117
|
deviceType: string;
|
|
118
118
|
appName: string;
|
|
119
119
|
appVersion: string;
|
|
120
|
+
isNewArchitecture: boolean;
|
|
121
|
+
reactNativeVersion: string;
|
|
120
122
|
};
|
|
121
123
|
};
|
|
122
124
|
canAddCardToWallet(
|
package/src/types/NextAction.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type NextAction =
|
|
|
4
4
|
| WeChatRedirectAction
|
|
5
5
|
| AlipayRedirectAction
|
|
6
6
|
| BoletoVoucherAction
|
|
7
|
+
| MultibancoVoucherAction
|
|
7
8
|
| OxxoVoucherAction;
|
|
8
9
|
|
|
9
10
|
export type VerifyWithMicrodepositsAction = {
|
|
@@ -39,6 +40,14 @@ export type KonbiniVoucherAction = {
|
|
|
39
40
|
voucherURL: string;
|
|
40
41
|
};
|
|
41
42
|
|
|
43
|
+
export type MultibancoVoucherAction = {
|
|
44
|
+
type: 'multibanco';
|
|
45
|
+
voucherURL: string;
|
|
46
|
+
entity?: string;
|
|
47
|
+
reference?: string;
|
|
48
|
+
expiresAt?: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
42
51
|
export type OxxoVoucherAction = {
|
|
43
52
|
type: 'oxxoVoucher';
|
|
44
53
|
expiration: number;
|
package/src/types/Onramp.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Address } from './Common';
|
|
2
2
|
import type { OnrampError, StripeError } from './Errors';
|
|
3
|
+
import type {
|
|
4
|
+
ApplePayBaseParams,
|
|
5
|
+
ApplePayPaymentMethodParams,
|
|
6
|
+
} from './PlatformPay';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Configuration used to initialize and customize the crypto onramp experience.
|
|
@@ -28,7 +32,11 @@ export type GooglePayConfig = {
|
|
|
28
32
|
merchantCountryCode: string;
|
|
29
33
|
/** Merchant name displayed in the Google Pay sheet. */
|
|
30
34
|
merchantName: string;
|
|
31
|
-
/**
|
|
35
|
+
/** Set to true to request an email address. Defaults to false. */
|
|
36
|
+
isEmailRequired?: boolean;
|
|
37
|
+
/** Set to false if you don't support credit cards. Defaults to true. */
|
|
38
|
+
allowCreditCards?: boolean;
|
|
39
|
+
/** Whether an existing payment method is required. Defaults to true. */
|
|
32
40
|
existingPaymentMethodRequired?: boolean;
|
|
33
41
|
/** Billing address collection configuration. */
|
|
34
42
|
billingAddressConfig?: GooglePayBillingAddressConfig;
|
|
@@ -46,6 +54,39 @@ export type GooglePayBillingAddressConfig = {
|
|
|
46
54
|
isPhoneNumberRequired?: boolean;
|
|
47
55
|
};
|
|
48
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Google Pay parameters for the onramp collectPaymentMethod call.
|
|
59
|
+
* Only includes the fields passed to GooglePayPaymentMethodLauncher.present().
|
|
60
|
+
* Google Pay config (merchantCountryCode, testEnv, etc.) belongs in GooglePayConfig
|
|
61
|
+
* provided to configure().
|
|
62
|
+
*/
|
|
63
|
+
export type OnrampGooglePayParams = {
|
|
64
|
+
/** ISO 4217 alphabetic currency code (e.g. "USD"). */
|
|
65
|
+
currencyCode: string;
|
|
66
|
+
/** Amount in the currency's smallest unit. */
|
|
67
|
+
amount: number;
|
|
68
|
+
/** An optional label to display with the amount. */
|
|
69
|
+
label?: string;
|
|
70
|
+
/** A unique ID that identifies a transaction attempt. Required when sending callbacks to the Google Transaction Events API. */
|
|
71
|
+
transactionId?: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Platform Pay parameters for the onramp collectPaymentMethod call.
|
|
76
|
+
*/
|
|
77
|
+
export type OnrampPlatformPayParams = {
|
|
78
|
+
/**
|
|
79
|
+
* Google Pay parameters. Android only.
|
|
80
|
+
*/
|
|
81
|
+
googlePay?: OnrampGooglePayParams;
|
|
82
|
+
/**
|
|
83
|
+
* Apple Pay parameters. iOS only.
|
|
84
|
+
* To receive `kycInfo` back from `collectPaymentMethod`, request Apple Pay billing
|
|
85
|
+
* `.name` and/or `.postalAddress` via `requiredBillingContactFields`.
|
|
86
|
+
*/
|
|
87
|
+
applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;
|
|
88
|
+
};
|
|
89
|
+
|
|
49
90
|
/**
|
|
50
91
|
* Customization options for Link/Stripe-provided UI.
|
|
51
92
|
*/
|
|
@@ -270,10 +311,13 @@ export type CollectPaymentMethodResult =
|
|
|
270
311
|
| {
|
|
271
312
|
/** Display data for the selected payment method. */
|
|
272
313
|
displayData: PaymentMethodDisplayData;
|
|
314
|
+
/** Partial KYC data returned from Platform Pay billing details, when requested. */
|
|
315
|
+
kycInfo?: KycInfo;
|
|
273
316
|
error?: undefined;
|
|
274
317
|
}
|
|
275
318
|
| {
|
|
276
319
|
displayData?: undefined;
|
|
320
|
+
kycInfo?: undefined;
|
|
277
321
|
/** Present if collection/selection failed with an error. */
|
|
278
322
|
error: StripeError<OnrampError>;
|
|
279
323
|
};
|
|
@@ -33,6 +33,7 @@ export type ConfirmParams =
|
|
|
33
33
|
| CardParams
|
|
34
34
|
| IdealParams
|
|
35
35
|
| OxxoParams
|
|
36
|
+
| MultibancoParams
|
|
36
37
|
| P24Params
|
|
37
38
|
| AlipayParams
|
|
38
39
|
| AlmaParams
|
|
@@ -157,6 +158,15 @@ export interface OxxoParams {
|
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
160
|
|
|
161
|
+
export interface MultibancoParams {
|
|
162
|
+
paymentMethodType: 'Multibanco';
|
|
163
|
+
paymentMethodData: {
|
|
164
|
+
billingDetails: BillingDetails & { email: string };
|
|
165
|
+
mandateData?: MandateData;
|
|
166
|
+
metadata?: MetaData;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
160
170
|
export interface GrabPayParams {
|
|
161
171
|
paymentMethodType: 'GrabPay';
|
|
162
172
|
paymentMethodData?: {
|
|
@@ -28,6 +28,7 @@ export type CreateParams =
|
|
|
28
28
|
| CardParams
|
|
29
29
|
| IdealParams
|
|
30
30
|
| OxxoParams
|
|
31
|
+
| MultibancoParams
|
|
31
32
|
| P24Params
|
|
32
33
|
| AlipayParams
|
|
33
34
|
| SepaParams
|
|
@@ -95,6 +96,13 @@ export interface OxxoParams {
|
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
export interface MultibancoParams {
|
|
100
|
+
paymentMethodType: 'Multibanco';
|
|
101
|
+
paymentMethodData: {
|
|
102
|
+
billingDetails: BillingDetails & { email: string };
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
98
106
|
export interface GrabPayParams {
|
|
99
107
|
paymentMethodType: 'GrabPay';
|
|
100
108
|
paymentMethodData?: {
|
|
@@ -276,6 +284,7 @@ export type Type =
|
|
|
276
284
|
| 'P24'
|
|
277
285
|
| 'Eps'
|
|
278
286
|
| 'Bancontact'
|
|
287
|
+
| 'Multibanco'
|
|
279
288
|
| 'Oxxo'
|
|
280
289
|
| 'Upi'
|
|
281
290
|
| 'USBankAccount'
|
|
@@ -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 = '~> 25.
|
|
5
|
+
stripe_version = '~> 25.11.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|
package/android/.idea/.name
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
stripe-react-native
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|