@stripe/stripe-react-native 0.50.1 → 0.50.3
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/.env +19 -0
- package/CHANGELOG.md +17 -0
- package/CLAUDE.md +148 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +41 -23
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +9 -11
- package/ios/PaymentSheetAppearance.swift +15 -11
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/wooj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/wooj.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/ios/StripeSdkImpl.swift +6 -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/functions.js +1 -1
- package/lib/commonjs/functions.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/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.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/functions.js +1 -1
- package/lib/module/functions.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/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +6 -9
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -9
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/patches/old-arch-codegen-fix.patch +6 -2
- package/src/functions.ts +8 -18
- package/src/types/EmbeddedPaymentElement.tsx +6 -19
- package/src/types/PaymentSheet.ts +17 -9
- package/stripe-react-native.podspec +1 -1
- package/android/.gradle/8.11.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.11.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.11.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.11.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.11.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.11.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.11.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
package/.env
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Stripe API keys - see https://stripe.com/docs/development/quickstart#api-keys
|
|
2
|
+
STRIPE_PUBLISHABLE_KEY=pk_test
|
|
3
|
+
STRIPE_SECRET_KEY=sk_test
|
|
4
|
+
|
|
5
|
+
STRIPE_PUBLISHABLE_KEY_MY=pk_test
|
|
6
|
+
STRIPE_SECRET_KEY_MY=sk_test
|
|
7
|
+
|
|
8
|
+
STRIPE_PUBLISHABLE_KEY_MX=pk_test
|
|
9
|
+
STRIPE_SECRET_KEY_MX=sk_test
|
|
10
|
+
|
|
11
|
+
STRIPE_PUBLISHABLE_KEY_AU=pk_test
|
|
12
|
+
STRIPE_SECRET_KEY_AU=sk_test
|
|
13
|
+
|
|
14
|
+
STRIPE_PUBLISHABLE_KEY_WECHAT=pk_test
|
|
15
|
+
STRIPE_SECRET_KEY_WECHAT=sk_test
|
|
16
|
+
|
|
17
|
+
# Required for webhook forwarding
|
|
18
|
+
# See the README on how to do this with the Stripe CLI
|
|
19
|
+
STRIPE_WEBHOOK_SECRET=whsec_
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.50.3 - 2025-08-07
|
|
4
|
+
|
|
5
|
+
**Fixed**
|
|
6
|
+
- Fixed Android crash when using `RowSelectionBehavior.ImmediateAction` with `FormSheetAction.Confirm` in EmbeddedPaymentElement.
|
|
7
|
+
|
|
8
|
+
## 0.50.2 - 2025-08-06
|
|
9
|
+
|
|
10
|
+
**Changes**
|
|
11
|
+
- Renamed `RowStyle.FlatWithChevron` to `RowStyle.FlatWithDisclosure` and updated related interfaces (`ChevronConfig` → `DisclosureConfig`).
|
|
12
|
+
- Updated `stripe-ios` to 24.19.0
|
|
13
|
+
- Updated `stripe-android` to 21.22.+
|
|
14
|
+
- Added `successBackgroundColor` and `successTextColor` properties to `PrimaryButtonColorConfig` for customizing the primary button appearance in success states.
|
|
15
|
+
|
|
16
|
+
**Fixes**
|
|
17
|
+
- Fixed missing `onCustomPaymentMethodConfirmHandlerCallback` in old architecture codegen patch. This resolves pod install failures when using React Native 0.74+ with old architecture and custom payment methods.
|
|
18
|
+
- Fixes an issue where saved payment methods weren't auto selected when using `EmbeddedPaymentElement` on Android.
|
|
19
|
+
|
|
3
20
|
## 0.50.1 - 2025-07-22
|
|
4
21
|
|
|
5
22
|
**Fixes**
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
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.
|
|
@@ -3,4 +3,4 @@ StripeSdk_compileSdkVersion=30
|
|
|
3
3
|
StripeSdk_targetSdkVersion=28
|
|
4
4
|
StripeSdk_minSdkVersion=21
|
|
5
5
|
# Keep StripeSdk_stripeVersion in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/android/gradle.properties
|
|
6
|
-
StripeSdk_stripeVersion=21.
|
|
6
|
+
StripeSdk_stripeVersion=21.22.+
|
|
@@ -194,9 +194,9 @@ private fun buildPrimaryButton(
|
|
|
194
194
|
|
|
195
195
|
return PaymentSheet.PrimaryButton(
|
|
196
196
|
colorsLight =
|
|
197
|
-
buildPrimaryButtonColors(lightColorParams, PaymentSheet.PrimaryButtonColors.defaultLight),
|
|
197
|
+
buildPrimaryButtonColors(lightColorParams, PaymentSheet.PrimaryButtonColors.defaultLight, context),
|
|
198
198
|
colorsDark =
|
|
199
|
-
buildPrimaryButtonColors(darkColorParams, PaymentSheet.PrimaryButtonColors.defaultDark),
|
|
199
|
+
buildPrimaryButtonColors(darkColorParams, PaymentSheet.PrimaryButtonColors.defaultDark, context),
|
|
200
200
|
shape =
|
|
201
201
|
PaymentSheet.PrimaryButtonShape(
|
|
202
202
|
cornerRadiusDp =
|
|
@@ -217,6 +217,7 @@ private fun buildPrimaryButton(
|
|
|
217
217
|
private fun buildPrimaryButtonColors(
|
|
218
218
|
colorParams: Bundle,
|
|
219
219
|
default: PaymentSheet.PrimaryButtonColors,
|
|
220
|
+
context: Context,
|
|
220
221
|
): PaymentSheet.PrimaryButtonColors =
|
|
221
222
|
PaymentSheet.PrimaryButtonColors(
|
|
222
223
|
background =
|
|
@@ -243,6 +244,20 @@ private fun buildPrimaryButtonColors(
|
|
|
243
244
|
colorParams.getString(PaymentSheetAppearanceKeys.BORDER),
|
|
244
245
|
default.border,
|
|
245
246
|
),
|
|
247
|
+
successBackgroundColor =
|
|
248
|
+
dynamicColorFromParams(
|
|
249
|
+
context,
|
|
250
|
+
colorParams,
|
|
251
|
+
PaymentSheetAppearanceKeys.SUCCESS_BACKGROUND,
|
|
252
|
+
default.successBackgroundColor,
|
|
253
|
+
),
|
|
254
|
+
onSuccessBackgroundColor =
|
|
255
|
+
dynamicColorFromParams(
|
|
256
|
+
context,
|
|
257
|
+
colorParams,
|
|
258
|
+
PaymentSheetAppearanceKeys.SUCCESS_TEXT,
|
|
259
|
+
default.onSuccessBackgroundColor,
|
|
260
|
+
),
|
|
246
261
|
)
|
|
247
262
|
|
|
248
263
|
@SuppressLint("RestrictedApi")
|
|
@@ -341,7 +356,7 @@ private fun buildEmbeddedAppearance(
|
|
|
341
356
|
val checkmarkParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.CHECKMARK)
|
|
342
357
|
val separatorInsetsParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_INSETS)
|
|
343
358
|
|
|
344
|
-
// Default separator insets specific to FlatWithCheckmark and
|
|
359
|
+
// Default separator insets specific to FlatWithCheckmark and FlatWithDisclosure
|
|
345
360
|
val defaultSeparatorStartInsetDp = 0.0f
|
|
346
361
|
val defaultSeparatorEndInsetDp = 0.0f
|
|
347
362
|
|
|
@@ -392,12 +407,12 @@ private fun buildEmbeddedAppearance(
|
|
|
392
407
|
colorsDark = flatCheckmarkColors,
|
|
393
408
|
)
|
|
394
409
|
}
|
|
395
|
-
"
|
|
410
|
+
"flatWithDisclosure" -> {
|
|
396
411
|
val flatParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLAT)
|
|
397
|
-
val
|
|
412
|
+
val disclosureParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.DISCLOSURE)
|
|
398
413
|
val separatorInsetsParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_INSETS)
|
|
399
414
|
|
|
400
|
-
// Default separator insets specific to FlatWithCheckmark and
|
|
415
|
+
// Default separator insets specific to FlatWithCheckmark and FlatWithDisclosure
|
|
401
416
|
val defaultSeparatorStartInsetDp = 0.0f
|
|
402
417
|
val defaultSeparatorEndInsetDp = 0.0f
|
|
403
418
|
|
|
@@ -418,32 +433,33 @@ private fun buildEmbeddedAppearance(
|
|
|
418
433
|
Color.GRAY,
|
|
419
434
|
)
|
|
420
435
|
|
|
421
|
-
val
|
|
436
|
+
val parsedDisclosureColor =
|
|
422
437
|
dynamicColorFromParams(
|
|
423
438
|
context,
|
|
424
|
-
|
|
439
|
+
disclosureParams,
|
|
425
440
|
PaymentSheetAppearanceKeys.COLOR,
|
|
426
441
|
defaultColors.componentBorder, // Default to component border color like other elements
|
|
427
442
|
)
|
|
428
443
|
|
|
429
444
|
// Create the required Colors object
|
|
430
|
-
val
|
|
431
|
-
PaymentSheet.Appearance.Embedded.RowStyle.
|
|
445
|
+
val flatDisclosureColors =
|
|
446
|
+
PaymentSheet.Appearance.Embedded.RowStyle.FlatWithDisclosure.Colors(
|
|
432
447
|
separatorColor = parsedSeparatorColor,
|
|
433
|
-
|
|
448
|
+
disclosureColor = parsedDisclosureColor,
|
|
434
449
|
)
|
|
435
450
|
|
|
436
|
-
PaymentSheet.Appearance.Embedded.RowStyle.
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
451
|
+
PaymentSheet.Appearance.Embedded.RowStyle.FlatWithDisclosure
|
|
452
|
+
.Builder()
|
|
453
|
+
.separatorThicknessDp(separatorThickness)
|
|
454
|
+
.startSeparatorInsetDp(startSeparatorInset)
|
|
455
|
+
.endSeparatorInsetDp(endSeparatorInset)
|
|
456
|
+
.topSeparatorEnabled(topEnabled)
|
|
457
|
+
.bottomSeparatorEnabled(bottomEnabled)
|
|
458
|
+
.additionalVerticalInsetsDp(additionalInsets)
|
|
459
|
+
.horizontalInsetsDp(0.0F) // We do not have an iOS equal for this API so it's not configurable in React Native
|
|
460
|
+
.colorsLight(flatDisclosureColors)
|
|
461
|
+
.colorsDark(flatDisclosureColors)
|
|
462
|
+
.build()
|
|
447
463
|
}
|
|
448
464
|
"floatingButton" -> {
|
|
449
465
|
val floatingParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLOATING)
|
|
@@ -654,6 +670,8 @@ private class PaymentSheetAppearanceKeys {
|
|
|
654
670
|
const val PRIMARY_BUTTON = "primaryButton"
|
|
655
671
|
const val TEXT = "text"
|
|
656
672
|
const val BORDER = "border"
|
|
673
|
+
const val SUCCESS_BACKGROUND = "successBackgroundColor"
|
|
674
|
+
const val SUCCESS_TEXT = "successTextColor"
|
|
657
675
|
|
|
658
676
|
const val EMBEDDED_PAYMENT_ELEMENT = "embeddedPaymentElement"
|
|
659
677
|
const val ROW = "row"
|
|
@@ -670,7 +688,7 @@ private class PaymentSheetAppearanceKeys {
|
|
|
670
688
|
const val SELECTED_COLOR = "selectedColor"
|
|
671
689
|
const val UNSELECTED_COLOR = "unselectedColor"
|
|
672
690
|
const val CHECKMARK = "checkmark"
|
|
673
|
-
const val
|
|
691
|
+
const val DISCLOSURE = "disclosure"
|
|
674
692
|
const val COLOR = "color"
|
|
675
693
|
const val CHECKMARK_INSET = "inset"
|
|
676
694
|
|
|
@@ -550,7 +550,7 @@ class PaymentSheetFragment :
|
|
|
550
550
|
)
|
|
551
551
|
|
|
552
552
|
internal fun buildGooglePayConfig(params: Bundle?): PaymentSheet.GooglePayConfiguration? {
|
|
553
|
-
if (params == null) {
|
|
553
|
+
if (params == null || params.isEmpty) {
|
|
554
554
|
return null
|
|
555
555
|
}
|
|
556
556
|
|
|
@@ -617,14 +617,13 @@ class PaymentSheetFragment :
|
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
@OptIn(PaymentMethodOptionsSetupFutureUsagePreview::class)
|
|
620
|
-
private fun buildIntentConfigurationMode(modeParams: Bundle): PaymentSheet.IntentConfiguration.Mode
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return if (modeParams.containsKey("amount")) {
|
|
620
|
+
private fun buildIntentConfigurationMode(modeParams: Bundle): PaymentSheet.IntentConfiguration.Mode =
|
|
621
|
+
if (modeParams.containsKey("amount")) {
|
|
622
|
+
val currencyCode =
|
|
623
|
+
modeParams.getString("currencyCode")
|
|
624
|
+
?: throw PaymentSheetException(
|
|
625
|
+
"You must provide a value to intentConfiguration.mode.currencyCode",
|
|
626
|
+
)
|
|
628
627
|
PaymentSheet.IntentConfiguration.Mode.Payment(
|
|
629
628
|
amount = modeParams.getInt("amount").toLong(),
|
|
630
629
|
currency = currencyCode,
|
|
@@ -639,11 +638,10 @@ class PaymentSheetFragment :
|
|
|
639
638
|
"You must provide a value to intentConfiguration.mode.setupFutureUsage",
|
|
640
639
|
)
|
|
641
640
|
PaymentSheet.IntentConfiguration.Mode.Setup(
|
|
642
|
-
currency = currencyCode,
|
|
641
|
+
currency = modeParams.getString("currencyCode"),
|
|
643
642
|
setupFutureUse = setupFutureUsage,
|
|
644
643
|
)
|
|
645
644
|
}
|
|
646
|
-
}
|
|
647
645
|
|
|
648
646
|
@OptIn(ExperimentalCustomerSessionApi::class)
|
|
649
647
|
@Throws(PaymentSheetException::class)
|
|
@@ -134,6 +134,8 @@ internal class PaymentSheetAppearance {
|
|
|
134
134
|
primaryButton.backgroundColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams)
|
|
135
135
|
primaryButton.textColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.TEXT, lightParams: lightModeParams, darkParams: darkModeParams)
|
|
136
136
|
primaryButton.borderColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BORDER, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.primaryButton.borderColor
|
|
137
|
+
primaryButton.successBackgroundColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.SUCCESS_BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.primaryButton.successBackgroundColor
|
|
138
|
+
primaryButton.successTextColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.SUCCESS_TEXT, lightParams: lightModeParams, darkParams: darkModeParams)
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
return primaryButton
|
|
@@ -185,8 +187,8 @@ internal class PaymentSheetAppearance {
|
|
|
185
187
|
row.style = .floatingButton
|
|
186
188
|
case PaymentSheetAppearanceKeys.ROW_STYLE_FLAT_WITH_CHECKMARK:
|
|
187
189
|
row.style = .flatWithCheckmark
|
|
188
|
-
case PaymentSheetAppearanceKeys.
|
|
189
|
-
row.style = .
|
|
190
|
+
case PaymentSheetAppearanceKeys.ROW_STYLE_FLAT_WITH_DISCLOSURE:
|
|
191
|
+
row.style = .flatWithDisclosure
|
|
190
192
|
default:
|
|
191
193
|
throw PaymentSheetAppearanceError.invalidRowStyle(styleString)
|
|
192
194
|
}
|
|
@@ -240,8 +242,8 @@ internal class PaymentSheetAppearance {
|
|
|
240
242
|
flat.checkmark = try buildEmbeddedCheckmark(params: checkmarkParams)
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
if let
|
|
244
|
-
flat.
|
|
245
|
+
if let disclosureParams = params[PaymentSheetAppearanceKeys.DISCLOSURE] as? NSDictionary {
|
|
246
|
+
flat.disclosure = try buildEmbeddedDisclosure(params: disclosureParams)
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
return flat
|
|
@@ -279,16 +281,16 @@ internal class PaymentSheetAppearance {
|
|
|
279
281
|
return checkmark
|
|
280
282
|
}
|
|
281
283
|
|
|
282
|
-
|
|
283
|
-
var
|
|
284
|
+
private class func buildEmbeddedDisclosure(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Disclosure {
|
|
285
|
+
var disclosure = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.disclosure
|
|
284
286
|
|
|
285
|
-
|
|
287
|
+
disclosure.color = parseThemedColor(
|
|
286
288
|
params: params,
|
|
287
289
|
key: PaymentSheetAppearanceKeys.COLOR,
|
|
288
290
|
default: UIColor.systemGray // Default iOS system gray color
|
|
289
291
|
)
|
|
290
292
|
|
|
291
|
-
|
|
293
|
+
return disclosure
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
private class func buildEmbeddedFloating(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Floating {
|
|
@@ -387,7 +389,7 @@ extension PaymentSheetAppearanceError: LocalizedError {
|
|
|
387
389
|
case .unexpectedHexStringLength(let hexString):
|
|
388
390
|
return NSLocalizedString("Failed to set Payment Sheet appearance. Expected hex string of length 6 or 8, but received: \(hexString)", comment: "Failed to set color")
|
|
389
391
|
case .invalidRowStyle(let styleString):
|
|
390
|
-
return NSLocalizedString("Failed to set Embedded Payment Element appearance. Invalid row style '\(styleString)'. Expected one of: 'flatWithRadio', 'floatingButton', 'flatWithCheckmark', '
|
|
392
|
+
return NSLocalizedString("Failed to set Embedded Payment Element appearance. Invalid row style '\(styleString)'. Expected one of: 'flatWithRadio', 'floatingButton', 'flatWithCheckmark', 'flatWithDisclosure'.", comment: "Invalid row style string")
|
|
391
393
|
}
|
|
392
394
|
}
|
|
393
395
|
}
|
|
@@ -428,6 +430,8 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
428
430
|
static let PRIMARY_BUTTON = "primaryButton"
|
|
429
431
|
static let TEXT = "text"
|
|
430
432
|
static let BORDER = "border"
|
|
433
|
+
static let SUCCESS_BACKGROUND = "successBackgroundColor"
|
|
434
|
+
static let SUCCESS_TEXT = "successTextColor"
|
|
431
435
|
|
|
432
436
|
static let EMBEDDED_PAYMENT_ELEMENT = "embeddedPaymentElement"
|
|
433
437
|
static let ROW = "row"
|
|
@@ -444,7 +448,7 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
444
448
|
static let SELECTED_COLOR = "selectedColor"
|
|
445
449
|
static let UNSELECTED_COLOR = "unselectedColor"
|
|
446
450
|
static let CHECKMARK = "checkmark"
|
|
447
|
-
static let
|
|
451
|
+
static let DISCLOSURE = "disclosure"
|
|
448
452
|
static let SPACING = "spacing"
|
|
449
453
|
static let TOP = "top"
|
|
450
454
|
static let LEFT = "left"
|
|
@@ -456,7 +460,7 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
456
460
|
static let ROW_STYLE_FLAT_WITH_RADIO = "flatWithRadio"
|
|
457
461
|
static let ROW_STYLE_FLOATING_BUTTON = "floatingButton"
|
|
458
462
|
static let ROW_STYLE_FLAT_WITH_CHECKMARK = "flatWithCheckmark"
|
|
459
|
-
static let
|
|
463
|
+
static let ROW_STYLE_FLAT_WITH_DISCLOSURE = "flatWithDisclosure"
|
|
460
464
|
|
|
461
465
|
static let FORM_INSETS = "formInsetValues"
|
|
462
466
|
}
|
|
Binary file
|
package/ios/StripeSdk.xcodeproj/xcuserdata/wooj.xcuserdatad/xcschemes/xcschememanagement.plist
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>StripeSdk.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>1</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
<key>Tests.xcscheme_^#shared#^_</key>
|
|
13
|
+
<dict>
|
|
14
|
+
<key>orderHint</key>
|
|
15
|
+
<integer>0</integer>
|
|
16
|
+
</dict>
|
|
17
|
+
</dict>
|
|
18
|
+
</dict>
|
|
19
|
+
</plist>
|
package/ios/StripeSdkImpl.swift
CHANGED
|
@@ -467,6 +467,12 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
467
467
|
return
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
+
// Prevent multiple simultaneous Apple Pay presentations
|
|
471
|
+
if self.confirmApplePayResolver != nil {
|
|
472
|
+
resolve(Errors.createError(ErrorType.Failed, "Apple Pay is already in progress"))
|
|
473
|
+
return
|
|
474
|
+
}
|
|
475
|
+
|
|
470
476
|
self.applePaySummaryItems = paymentRequest.paymentSummaryItems
|
|
471
477
|
self.applePayShippingMethods = paymentRequest.shippingMethods ?? []
|
|
472
478
|
self.applePayShippingAddressErrors = nil
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddToWalletButton.default,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
|
|
2
2
|
//# sourceMappingURL=AddToWalletButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,mFAAAC,SAAA,gBAgEhE,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAF,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAS,GAAA,EAACV,wBAAA,CAAAS,OAAuB,CAAAE,MAAA,CAAAC,MAAA,IAClBL,KAAK,EACTM,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CACdC,KAEE,QACC,CAAAR,UAAU,CAACQ,KAAK,CAACC,WAAW,CAAC,EAAC,EACpC,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddressSheet.default,Object.assign({},props,{onSubmitAction:function onSubmitAction(event){return onSubmit(event.nativeEvent.result);},onErrorAction:function onErrorAction(event){return onError(event.nativeEvent.error);}}));}
|
|
2
2
|
//# sourceMappingURL=AddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,8EAAAC,SAAA,wBA4DtD,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAyC,IAAtC,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,CAAAF,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAU,GAAA,EAACX,mBAAA,CAAAU,OAAkB,CAAAE,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAK,QAAK,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC,EAAC,CAC9DC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CAAGH,KAAK,QAAK,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACG,KAAK,CAAC,EAAC,EAC5D,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAuBECSDebitForm.default,Object.assign({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props));}
|
|
2
2
|
//# sourceMappingURL=AuBECSDebitForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,iFAAAC,SAAA,0CA6B5D,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAKrB,IAJR,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACNC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAN,IAAA,CAAAF,SAAA,EAER,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACZ,sBAAA,CAAAW,OAAqB,CAAAE,MAAA,CAAAC,MAAA,EACpBC,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CAAGC,KAAK,QAAK,CAAAV,UAAU,CAACU,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3DV,WAAW,CAAEA,WAAY,CACzBC,SAAS,CAAAK,MAAA,CAAAC,MAAA,IAAON,SAAS,CAAG,EACxBC,KAAK,CACV,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var CardField=exports.CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,autofocus=_ref.autofocus,postalCodeEnabled=_ref.postalCodeEnabled,disabled=_ref.disabled,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn(`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`);}}onCardChange==null||onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null||onFocus(focusedField);}else{onBlur==null||onBlur();}},[onFocus,onBlur]);var focus=function focus(){_NativeCardField.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardField.Commands.blur(inputRef.current);};var clear=function clear(){_NativeCardField.Commands.clear(inputRef.current);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardField.default,Object.assign({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},autofocus:autofocus!=null?autofocus:false,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,disabled:disabled!=null?disabled:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false},props));});
|
|
2
2
|
//# sourceMappingURL=CardField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,+IAAAC,KAAA,MAAAC,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,W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