@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.
Files changed (88) hide show
  1. package/android/gradle.properties +1 -1
  2. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +48 -25
  3. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +2 -0
  4. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -0
  5. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +1 -1
  6. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +8 -0
  7. package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +10 -2
  8. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -0
  9. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +4 -0
  10. package/ios/NewArch/AddToWalletButtonComponentView.mm +0 -1
  11. package/ios/NewArch/AddressSheetViewComponentView.mm +0 -1
  12. package/ios/NewArch/ApplePayButtonComponentView.mm +1 -1
  13. package/ios/NewArch/AuBECSDebitFormComponentView.mm +0 -1
  14. package/ios/NewArch/CardFieldComponentView.mm +0 -1
  15. package/ios/NewArch/CardFormComponentView.mm +1 -2
  16. package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +1 -3
  17. package/ios/NewArch/StripeContainerComponentView.mm +1 -1
  18. package/ios/NewArch/StripeNewArchConversions.h +14 -0
  19. package/ios/NewArch/StripeNewArchConversions.mm +9 -6
  20. package/ios/StripeSdk.mm +7 -0
  21. package/ios/StripeSdkImpl.swift +11 -0
  22. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  23. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  24. package/lib/commonjs/components/AddressSheet.js +1 -1
  25. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  26. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  27. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  28. package/lib/commonjs/components/CardField.js +1 -1
  29. package/lib/commonjs/components/CardField.js.map +1 -1
  30. package/lib/commonjs/components/CardForm.js +1 -1
  31. package/lib/commonjs/components/CardForm.js.map +1 -1
  32. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  33. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  34. package/lib/commonjs/components/StripeContainer.js +1 -1
  35. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  36. package/lib/commonjs/components/StripeProvider.js +1 -1
  37. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  38. package/lib/commonjs/functions.js +1 -1
  39. package/lib/commonjs/functions.js.map +1 -1
  40. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  41. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  42. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  43. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  44. package/lib/module/components/AddToWalletButton.js +1 -1
  45. package/lib/module/components/AddToWalletButton.js.map +1 -1
  46. package/lib/module/components/AddressSheet.js +1 -1
  47. package/lib/module/components/AddressSheet.js.map +1 -1
  48. package/lib/module/components/AuBECSDebitForm.js +1 -1
  49. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  50. package/lib/module/components/CardField.js +1 -1
  51. package/lib/module/components/CardField.js.map +1 -1
  52. package/lib/module/components/CardForm.js +1 -1
  53. package/lib/module/components/CardForm.js.map +1 -1
  54. package/lib/module/components/PlatformPayButton.js +1 -1
  55. package/lib/module/components/PlatformPayButton.js.map +1 -1
  56. package/lib/module/components/StripeContainer.js +1 -1
  57. package/lib/module/components/StripeContainer.js.map +1 -1
  58. package/lib/module/components/StripeProvider.js +1 -1
  59. package/lib/module/components/StripeProvider.js.map +1 -1
  60. package/lib/module/functions.js +1 -1
  61. package/lib/module/functions.js.map +1 -1
  62. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  63. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  64. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  65. package/lib/module/types/PlatformPay.js.map +1 -1
  66. package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
  67. package/lib/typescript/src/functions.d.ts +1 -0
  68. package/lib/typescript/src/functions.d.ts.map +1 -1
  69. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +1 -0
  70. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  71. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +1 -0
  72. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
  73. package/lib/typescript/src/types/PlatformPay.d.ts +7 -1
  74. package/lib/typescript/src/types/PlatformPay.d.ts.map +1 -1
  75. package/package.json +20 -1
  76. package/src/components/StripeProvider.tsx +24 -20
  77. package/src/functions.ts +11 -0
  78. package/src/specs/NativeStripeSdkModule.ts +2 -0
  79. package/src/types/EmbeddedPaymentElement.tsx +7 -0
  80. package/src/types/PlatformPay.ts +7 -1
  81. package/.clang-format +0 -90
  82. package/.editorconfig +0 -18
  83. package/.husky/pre-commit +0 -1
  84. package/CHANGELOG.md +0 -931
  85. package/CLAUDE.md +0 -148
  86. package/package-lock.json +0 -14114
  87. package/patches/README.md +0 -55
  88. package/patches/old-arch-codegen-fix.patch +0 -91
package/CLAUDE.md DELETED
@@ -1,148 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Development Commands
6
-
7
- ### Building and Linting
8
- - `yarn typescript` - Type-check TypeScript files
9
- - `yarn lint` - Lint code with ESLint
10
- - `yarn lint --fix` - Fix linting issues automatically
11
- - `yarn test` - Run Jest unit tests
12
- - `yarn prepare` - Build the library (runs `bob build && husky`)
13
-
14
- ### Development Setup
15
- - `yarn bootstrap` - Setup project by installing dependencies and CocoaPods
16
- - `yarn bootstrap-no-pods` - Setup without installing CocoaPods
17
- - `yarn pods` - Install CocoaPods for iOS (example app)
18
- - `yarn update-pods` - Update specific Stripe pod dependencies
19
-
20
- ### Example App Development Workflow
21
- 1. **Setup**: `yarn bootstrap`
22
- 2. **Run Example App** (requires 2 terminals):
23
- - Terminal 1: `yarn example start`
24
- - Terminal 2: `yarn example ios` OR `yarn example android`
25
-
26
- The example app uses a pre-configured demo backend, so no server setup is required.
27
-
28
- ### Example App Commands
29
- - `yarn example start` - Start Metro server
30
- - `yarn run-example-ios` - Run iOS example app on iPhone 16 simulator
31
- - `yarn run-example-android` - Run Android example app
32
- - `yarn run-example-ios:release` - Build and run iOS app in release mode
33
- - `yarn run-example-android:release` - Build and run Android app in release mode
34
-
35
- ### Testing
36
- - `yarn test:e2e:ios` - Run all iOS E2E tests using Maestro
37
- - `yarn test:e2e:android` - Run all Android E2E tests using Maestro
38
- - `yarn test-ios ./path/to/test.yml` - Run single iOS E2E test
39
- - `yarn test-android ./path/to/test.yml` - Run single Android E2E test
40
- - `yarn test:unit:ios` - Run iOS native unit tests via Xcode
41
- - `yarn test:unit:android` - Run Android unit tests
42
-
43
- ### Documentation
44
- - `yarn docs` - Generate API documentation using TypeDoc
45
-
46
- ### Commit Convention
47
- Follow [conventional commits](https://www.conventionalcommits.org/en):
48
- - `fix:` - Bug fixes
49
- - `feat:` - New features
50
- - `refactor:` - Code refactoring
51
- - `docs:` - Documentation changes
52
- - `test:` - Test additions/updates
53
- - `chore:` - Tooling changes
54
-
55
- ## Architecture Overview
56
-
57
- This is the official Stripe React Native SDK, providing payment processing capabilities for mobile apps.
58
-
59
- ### Key Directories
60
-
61
- - **`src/`** - Main TypeScript source code
62
- - `components/` - React Native components (CardField, PaymentSheet, etc.)
63
- - `hooks/` - React hooks for payment functionality
64
- - `types/` - TypeScript type definitions
65
- - `specs/` - Native module specifications for code generation
66
- - `functions.ts` - Core payment functions
67
- - `index.tsx` - Main exports
68
-
69
- - **`ios/`** - Native iOS implementation in Swift/Objective-C
70
- - Uses Stripe iOS SDK (~24.16.1)
71
- - Supports both Old and New Architecture (Fabric)
72
- - Test files in `ios/Tests/`
73
-
74
- - **`android/`** - Native Android implementation in Kotlin/Java
75
- - Uses Stripe Android SDK
76
- - Gradle build configuration
77
-
78
- - **`example/`** - Example React Native app demonstrating SDK usage
79
- - Contains test server in `server/` directory
80
- - Configured for both iOS and Android development
81
-
82
- - **`e2e-tests/`** - End-to-end tests using Maestro framework
83
- - Platform-specific tests in `ios-only/` and `android-only/`
84
- - Tests payment flows, UI components, and integrations
85
-
86
- ### Code Generation
87
-
88
- The SDK uses React Native's TurboModules/Fabric for native communication:
89
- - Specs defined in `src/specs/` generate native interfaces
90
- - Both Old and New Architecture supported
91
- - Special patch for Old Architecture compatibility in `patches/old-arch-codegen-fix.patch`
92
-
93
- ### Build System
94
-
95
- - **React Native Builder Bob** - Builds CommonJS, ES modules, and TypeScript declarations
96
- - **CocoaPods** - iOS dependency management
97
- - **Gradle** - Android build system
98
- - **Expo Plugin** - `src/plugin/withStripe.ts` for Expo integration
99
-
100
- ### Key Components
101
-
102
- - **StripeProvider** - Context provider for SDK initialization
103
- - **PaymentSheet** - Pre-built payment UI
104
- - **CardField/CardForm** - Card input components
105
- - **PlatformPayButton** - Apple Pay/Google Pay integration
106
- - **CustomerSheet** - Customer payment method management
107
- - **AddressSheet** - Address collection component
108
-
109
- ### Testing Strategy
110
-
111
- - **Jest** - Unit tests for TypeScript code
112
- - **Maestro** - E2E testing framework for mobile flows
113
- - **Native Tests** - iOS XCTest and Android instrumentation tests
114
- - Mock implementation provided in `jest/mock.js`
115
-
116
- ### Platform-Specific Notes
117
-
118
- - **iOS**: Requires Xcode 14.1+, iOS 13+ deployment target
119
- - **Android**: Requires API 21+, compileSdkVersion 34, Kotlin 2.x
120
- - **React Native**: Compatible with 0.78+, TypeScript 5.7+
121
- - **Expo**: Supported via plugin configuration
122
-
123
- ### Development File Locations
124
-
125
- - **iOS Native**: Open `example/ios/StripeSdkExample.xcworkspace` in Xcode
126
- - Source files: `Pods > Development Pods > stripe-react-native`
127
- - **Android Native**: Open `example/android` in Android Studio
128
- - Source files: `reactnativestripesdk` under `Android`
129
- - **TypeScript**: Edit files in `src/` and `example/`
130
-
131
- ### GitHub Issue Management
132
- - `GH_HOST=github.com gh issue list --repo stripe/stripe-react-native --limit 20` - List recent issues
133
- - `GH_HOST=github.com gh issue view <issue_number> --repo stripe/stripe-react-native` - View specific issue
134
- - `GH_HOST=github.com gh issue view <issue_number> --repo stripe/stripe-react-native --comments` - View issue with comments
135
- - `GH_HOST=github.com gh issue list --repo stripe/stripe-react-native --state all --search "keyword" --limit 30` - Search ALL issues (open/closed) by keyword
136
- - `GH_HOST=github.com gh issue create --repo stripe/stripe-react-native` - Create new issue
137
- - `GH_HOST=github.com gh issue edit <issue_number> --repo stripe/stripe-react-native` - Edit issue
138
- - `GH_HOST=github.com gh pr create --repo stripe/stripe-react-native` - Create pull request
139
- - Always use `--state all` when searching to include closed/resolved issues
140
- - Always check GitHub issues for similar problems before investigating user reports
141
- - Use GitHub CLI to distinguish between SDK bugs vs integration issues
142
-
143
- ### Filing PRs
144
- When using the GitHub `gh` command, ALWAYS set `GH_HOST=github.com`. For example: `GH_HOST=github.com gh pr create --title [...]`
145
-
146
- ### Old Architecture Compatibility
147
-
148
- The SDK maintains compatibility with React Native's Old Architecture via `patches/old-arch-codegen-fix.patch`. This patch converts EventEmitter properties to callback functions for code generation compatibility with RN ≥ 0.74.