@stripe/stripe-react-native 0.52.0 → 0.53.1
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/EmbeddedPaymentElementView.kt +48 -25
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +10 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +4 -0
- package/ios/NewArch/AddToWalletButtonComponentView.mm +0 -1
- package/ios/NewArch/AddressSheetViewComponentView.mm +0 -1
- package/ios/NewArch/ApplePayButtonComponentView.mm +1 -1
- package/ios/NewArch/AuBECSDebitFormComponentView.mm +0 -1
- package/ios/NewArch/CardFieldComponentView.mm +0 -1
- package/ios/NewArch/CardFormComponentView.mm +1 -2
- package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +1 -3
- package/ios/NewArch/StripeContainerComponentView.mm +1 -1
- package/ios/NewArch/StripeNewArchConversions.h +14 -0
- package/ios/NewArch/StripeNewArchConversions.mm +9 -6
- package/ios/StripeSdk.mm +7 -0
- package/ios/StripeSdkImpl.swift +11 -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/functions.js +1 -1
- package/lib/commonjs/functions.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/PlatformPay.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/functions.js +1 -1
- package/lib/module/functions.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/PlatformPay.js.map +1 -1
- package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts +1 -0
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +1 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +1 -0
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +7 -1
- package/lib/typescript/src/types/PlatformPay.d.ts.map +1 -1
- package/package.json +20 -1
- package/src/components/StripeProvider.tsx +24 -20
- package/src/functions.ts +11 -0
- package/src/specs/NativeStripeSdkModule.ts +2 -0
- package/src/types/EmbeddedPaymentElement.tsx +7 -0
- package/src/types/PlatformPay.ts +7 -1
- package/.clang-format +0 -90
- package/.editorconfig +0 -18
- package/.husky/pre-commit +0 -1
- package/CHANGELOG.md +0 -931
- package/CLAUDE.md +0 -148
- package/package-lock.json +0 -14114
- package/patches/README.md +0 -55
- package/patches/old-arch-codegen-fix.patch +0 -91
package/patches/README.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Old Architecture Codegen Fix
|
|
2
|
-
|
|
3
|
-
This patch fixes the codegen issue that occurs when using `@stripe/stripe-react-native` with React Native 0.74+ in the old architecture.
|
|
4
|
-
|
|
5
|
-
## The Problem
|
|
6
|
-
|
|
7
|
-
When using React Native 0.74+ with the old architecture, you may encounter this error during pod install:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
UnsupportedModulePropertyParserError: Module NativeStripeSdkModule: TypeScript interfaces extending TurboModule must only contain 'FunctionTypeAnnotation's. Property 'onConfirmHandlerCallback' refers to a 'TSTypeReference'.
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
This occurs because the React Native codegen in the old architecture doesn't support `EventEmitter` properties in TurboModule interfaces.
|
|
14
|
-
|
|
15
|
-
## The Solution
|
|
16
|
-
|
|
17
|
-
This patch converts all `EventEmitter` properties to callback function methods, making them compatible with the old architecture codegen.
|
|
18
|
-
|
|
19
|
-
## How to Apply
|
|
20
|
-
|
|
21
|
-
### Option 1: Manual patch command
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
cd node_modules/@stripe/stripe-react-native
|
|
25
|
-
patch -p0 < patches/old-arch-codegen-fix.patch
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Option 2: Using patch-package (Recommended)
|
|
29
|
-
|
|
30
|
-
1. Install patch-package as a dev dependency:
|
|
31
|
-
```bash
|
|
32
|
-
npm install --save-dev patch-package
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
2. Apply the patch manually first:
|
|
36
|
-
```bash
|
|
37
|
-
cd node_modules/@stripe/stripe-react-native
|
|
38
|
-
patch -p0 < ../../patches/old-arch-codegen-fix.patch
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
3. Generate a patch-package patch:
|
|
42
|
-
```bash
|
|
43
|
-
npx patch-package @stripe/stripe-react-native
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
4. Add postinstall script to your `package.json`:
|
|
47
|
-
```json
|
|
48
|
-
{
|
|
49
|
-
"scripts": {
|
|
50
|
-
"postinstall": "patch-package"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
This ensures the patch is automatically applied whenever you run `npm install`.
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
--- src/specs/NativeStripeSdkModule.ts.orig 2025-07-09 10:31:12.373374861 -0600
|
|
2
|
-
+++ src/specs/NativeStripeSdkModule.ts 2025-07-09 10:31:34.254519742 -0600
|
|
3
|
-
@@ -1,7 +1,6 @@
|
|
4
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
5
|
-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
|
|
6
|
-
import type {
|
|
7
|
-
- EventEmitter,
|
|
8
|
-
Int32,
|
|
9
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
10
|
-
import type {
|
|
11
|
-
@@ -185,35 +184,47 @@
|
|
12
|
-
): Promise<void>;
|
|
13
|
-
clearEmbeddedPaymentOption(viewTag: Int32): Promise<void>;
|
|
14
|
-
|
|
15
|
-
- // Events
|
|
16
|
-
- onConfirmHandlerCallback: EventEmitter<{
|
|
17
|
-
- paymentMethod: UnsafeObject<PaymentMethod.Result>;
|
|
18
|
-
- shouldSavePaymentMethod: boolean;
|
|
19
|
-
- }>;
|
|
20
|
-
- onFinancialConnectionsEvent: EventEmitter<
|
|
21
|
-
- UnsafeObject<FinancialConnectionsEvent>
|
|
22
|
-
- >;
|
|
23
|
-
- onOrderTrackingCallback: EventEmitter<void>;
|
|
24
|
-
- onCustomerAdapterFetchPaymentMethodsCallback: EventEmitter<void>;
|
|
25
|
-
- onCustomerAdapterAttachPaymentMethodCallback: EventEmitter<{
|
|
26
|
-
- paymentMethodId: string;
|
|
27
|
-
- }>;
|
|
28
|
-
- onCustomerAdapterDetachPaymentMethodCallback: EventEmitter<{
|
|
29
|
-
- paymentMethodId: string;
|
|
30
|
-
- }>;
|
|
31
|
-
- onCustomerAdapterSetSelectedPaymentOptionCallback: EventEmitter<{
|
|
32
|
-
- paymentOption: string;
|
|
33
|
-
- }>;
|
|
34
|
-
- onCustomerAdapterFetchSelectedPaymentOptionCallback: EventEmitter<void>;
|
|
35
|
-
- onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback: EventEmitter<void>;
|
|
36
|
-
- embeddedPaymentElementDidUpdateHeight: EventEmitter<UnsafeObject<any>>;
|
|
37
|
-
- embeddedPaymentElementWillPresent: EventEmitter<void>;
|
|
38
|
-
- embeddedPaymentElementDidUpdatePaymentOption: EventEmitter<UnsafeObject<any>>;
|
|
39
|
-
- embeddedPaymentElementFormSheetConfirmComplete: EventEmitter<
|
|
40
|
-
- UnsafeObject<any>
|
|
41
|
-
- >;
|
|
42
|
-
- embeddedPaymentElementRowSelectionImmediateAction: EventEmitter<void>;
|
|
43
|
-
- embeddedPaymentElementLoadingFailed: EventEmitter<UnsafeObject<any>>;
|
|
44
|
-
- onCustomPaymentMethodConfirmHandlerCallback: EventEmitter<UnsafeObject<any>>;
|
|
45
|
-
+ // Events (callback form for old architecture)
|
|
46
|
-
+ onConfirmHandlerCallback(
|
|
47
|
-
+ callback: (event: {
|
|
48
|
-
+ paymentMethod: UnsafeObject<PaymentMethod.Result>;
|
|
49
|
-
+ shouldSavePaymentMethod: boolean;
|
|
50
|
-
+ }) => void
|
|
51
|
-
+ ): void;
|
|
52
|
-
+ onFinancialConnectionsEvent(
|
|
53
|
-
+ callback: (event: UnsafeObject<FinancialConnectionsEvent>) => void
|
|
54
|
-
+ ): void;
|
|
55
|
-
+ onOrderTrackingCallback(callback: () => void): void;
|
|
56
|
-
+ onCustomerAdapterFetchPaymentMethodsCallback(callback: () => void): void;
|
|
57
|
-
+ onCustomerAdapterAttachPaymentMethodCallback(
|
|
58
|
-
+ callback: (event: { paymentMethodId: string }) => void
|
|
59
|
-
+ ): void;
|
|
60
|
-
+ onCustomerAdapterDetachPaymentMethodCallback(
|
|
61
|
-
+ callback: (event: { paymentMethodId: string }) => void
|
|
62
|
-
+ ): void;
|
|
63
|
-
+ onCustomerAdapterSetSelectedPaymentOptionCallback(
|
|
64
|
-
+ callback: (event: { paymentOption: string }) => void
|
|
65
|
-
+ ): void;
|
|
66
|
-
+ onCustomerAdapterFetchSelectedPaymentOptionCallback(
|
|
67
|
-
+ callback: () => void
|
|
68
|
-
+ ): void;
|
|
69
|
-
+ onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback(
|
|
70
|
-
+ callback: () => void
|
|
71
|
-
+ ): void;
|
|
72
|
-
+ embeddedPaymentElementDidUpdateHeight(
|
|
73
|
-
+ callback: (event: UnsafeObject<any>) => void
|
|
74
|
-
+ ): void;
|
|
75
|
-
+ embeddedPaymentElementWillPresent(callback: () => void): void;
|
|
76
|
-
+ embeddedPaymentElementDidUpdatePaymentOption(
|
|
77
|
-
+ callback: (event: UnsafeObject<any>) => void
|
|
78
|
-
+ ): void;
|
|
79
|
-
+ embeddedPaymentElementFormSheetConfirmComplete(
|
|
80
|
-
+ callback: (event: UnsafeObject<any>) => void
|
|
81
|
-
+ ): void;
|
|
82
|
-
+ embeddedPaymentElementRowSelectionImmediateAction(callback: () => void): void;
|
|
83
|
-
+ embeddedPaymentElementLoadingFailed(
|
|
84
|
-
+ callback: (event: UnsafeObject<any>) => void
|
|
85
|
-
+ ): void;
|
|
86
|
-
+ onCustomPaymentMethodConfirmHandlerCallback(
|
|
87
|
-
+ callback: (event: UnsafeObject<any>) => void
|
|
88
|
-
+ ): void;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('StripeSdk');
|