@stripe/stripe-react-native 0.49.0 → 0.50.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/CHANGELOG.md +17 -0
- package/README.md +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 +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/src/main/AndroidManifest.xml +10 -0
- package/android/src/main/java/com/reactnativestripesdk/CustomPaymentMethodActivity.kt +81 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +96 -1
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +26 -5
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +0 -17
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +17 -6
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +116 -20
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +22 -0
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +52 -6
- package/android/src/main/res/values/styles.xml +27 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +8 -0
- package/ios/ApplePayButtonManager.m +4 -0
- package/ios/ApplePayButtonView.swift +11 -4
- package/ios/Mappers.swift +0 -5
- package/ios/NewArch/ApplePayButtonComponentView.mm +6 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.h +1 -1
- package/ios/OldArch/StripeSdkEventEmitterCompat.m +7 -1
- package/ios/PaymentMethodFactory.swift +0 -17
- package/ios/PaymentSheetAppearance.swift +81 -67
- package/ios/StripeSdk.mm +7 -0
- package/ios/StripeSdkEmitter.swift +1 -0
- package/ios/StripeSdkImpl+Embedded.swift +39 -17
- package/ios/StripeSdkImpl+PaymentSheet.swift +114 -1
- package/ios/StripeSdkImpl.swift +38 -9
- 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/events.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.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/PaymentIntent.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/events.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeApplePayButton.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/PaymentIntent.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/components/PlatformPayButton.d.ts.map +1 -1
- package/lib/typescript/src/events.d.ts +1 -1
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeApplePayButton.d.ts +4 -0
- package/lib/typescript/src/specs/NativeApplePayButton.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +2 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +2 -0
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +1 -10
- package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentMethod.d.ts +2 -13
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +55 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/patches/README.md +55 -0
- package/patches/old-arch-codegen-fix.patch +87 -0
- package/src/components/PlatformPayButton.tsx +12 -4
- package/src/events.ts +2 -1
- package/src/functions.ts +36 -1
- package/src/specs/NativeApplePayButton.ts +5 -0
- package/src/specs/NativeStripeSdkModule.ts +4 -0
- package/src/types/EmbeddedPaymentElement.tsx +33 -0
- package/src/types/PaymentIntent.ts +0 -10
- package/src/types/PaymentMethod.ts +0 -14
- package/src/types/PaymentSheet.ts +59 -0
- package/.env +0 -19
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/wooj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/wooj.xcuserdatad/xcschemes/xcschememanagement.plist +0 -19
|
@@ -10,7 +10,7 @@ internal class PaymentSheetAppearance {
|
|
|
10
10
|
class func buildAppearanceFromParams(userParams: NSDictionary?) throws -> PaymentSheet.Appearance {
|
|
11
11
|
var appearance = PaymentSheet.Appearance()
|
|
12
12
|
guard let userParams = userParams else { return appearance }
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
if let fontParams = userParams[PaymentSheetAppearanceKeys.FONT] as? NSDictionary {
|
|
15
15
|
appearance.font = try buildFont(params: fontParams)
|
|
16
16
|
}
|
|
@@ -27,19 +27,19 @@ internal class PaymentSheetAppearance {
|
|
|
27
27
|
if let primaryButtonParams = userParams[PaymentSheetAppearanceKeys.PRIMARY_BUTTON] as? NSDictionary {
|
|
28
28
|
appearance.primaryButton = try buildPrimaryButton(params: primaryButtonParams)
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
|
|
32
32
|
if let embeddedPaymentElementParams = userParams[PaymentSheetAppearanceKeys.EMBEDDED_PAYMENT_ELEMENT] as? NSDictionary {
|
|
33
33
|
appearance.embeddedPaymentElement = try buildEmbeddedPaymentElementAppearance(params: embeddedPaymentElementParams)
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
if let formInsetParams = userParams[PaymentSheetAppearanceKeys.FORM_INSETS] as? NSDictionary {
|
|
37
37
|
appearance.formInsets = try buildFormInsets(params: formInsetParams)
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
return appearance
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
private class func buildFont(params: NSDictionary) throws -> PaymentSheet.Appearance.Font {
|
|
44
44
|
var font = PaymentSheet.Appearance.Font()
|
|
45
45
|
if let fontName = params[PaymentSheetAppearanceKeys.FAMILY] as? String {
|
|
@@ -54,15 +54,15 @@ internal class PaymentSheetAppearance {
|
|
|
54
54
|
|
|
55
55
|
private class func buildColors(params: NSDictionary) throws -> PaymentSheet.Appearance.Colors {
|
|
56
56
|
var colors = PaymentSheet.Appearance.Colors()
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
if (params.object(forKey: PaymentSheetAppearanceKeys.LIGHT) != nil && params.object(forKey: PaymentSheetAppearanceKeys.DARK) == nil ||
|
|
59
59
|
params.object(forKey: PaymentSheetAppearanceKeys.DARK) != nil && params.object(forKey: PaymentSheetAppearanceKeys.LIGHT) == nil) {
|
|
60
60
|
throw PaymentSheetAppearanceError.missingAppearanceMode
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
let lightModeParams = params[PaymentSheetAppearanceKeys.LIGHT] as? NSDictionary ?? params
|
|
64
64
|
let darkModeParams = params[PaymentSheetAppearanceKeys.DARK] as? NSDictionary ?? params
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
colors.primary = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.PRIMARY, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.primary
|
|
67
67
|
colors.background = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.background
|
|
68
68
|
colors.componentBackground = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.COMPONENT_BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.componentBackground
|
|
@@ -74,13 +74,13 @@ internal class PaymentSheetAppearance {
|
|
|
74
74
|
colors.componentPlaceholderText = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.PLACEHOLDER_TEXT, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.componentPlaceholderText
|
|
75
75
|
colors.icon = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.ICON, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.icon
|
|
76
76
|
colors.danger = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.ERROR, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.danger
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
return colors
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
private class func buildShadow(params: NSDictionary) throws -> PaymentSheet.Appearance.Shadow {
|
|
82
82
|
var shadow = PaymentSheet.Appearance.Shadow()
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
if let color = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.SHADOW_COLOR, lightParams: params, darkParams: params) {
|
|
85
85
|
shadow.color = color
|
|
86
86
|
}
|
|
@@ -98,10 +98,10 @@ internal class PaymentSheetAppearance {
|
|
|
98
98
|
|
|
99
99
|
return shadow
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
private class func buildPrimaryButton(params: NSDictionary) throws -> PaymentSheet.Appearance.PrimaryButton {
|
|
103
103
|
var primaryButton = PaymentSheet.Appearance.PrimaryButton()
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
if let fontName = (params[PaymentSheetAppearanceKeys.FONT] as? NSDictionary)?[PaymentSheetAppearanceKeys.FAMILY] as? String {
|
|
106
106
|
guard let customFont = UIFont(name: fontName, size: UIFont.systemFontSize) else {
|
|
107
107
|
throw PaymentSheetAppearanceError.missingFont(fontName)
|
|
@@ -127,23 +127,23 @@ internal class PaymentSheetAppearance {
|
|
|
127
127
|
colorParams.object(forKey: PaymentSheetAppearanceKeys.DARK) != nil && colorParams.object(forKey: PaymentSheetAppearanceKeys.LIGHT) == nil) {
|
|
128
128
|
throw PaymentSheetAppearanceError.missingAppearanceMode
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
let lightModeParams = colorParams[PaymentSheetAppearanceKeys.LIGHT] as? NSDictionary ?? colorParams
|
|
132
132
|
let darkModeParams = colorParams[PaymentSheetAppearanceKeys.DARK] as? NSDictionary ?? colorParams
|
|
133
|
-
|
|
133
|
+
|
|
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
137
|
}
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
return primaryButton
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
private class func buildUserInterfaceStyleAwareColor(key: String, lightParams: NSDictionary, darkParams: NSDictionary) throws -> UIColor? {
|
|
143
143
|
guard let lightHexString = lightParams[key] as? String, let darkHexString = darkParams[key] as? String else {
|
|
144
144
|
return nil
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
|
|
147
147
|
let darkCount = darkHexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted).count
|
|
148
148
|
let lightCount = lightHexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted).count
|
|
149
149
|
if (lightCount != 6 && lightCount != 8) {
|
|
@@ -151,10 +151,10 @@ internal class PaymentSheetAppearance {
|
|
|
151
151
|
} else if (darkCount != 6 && darkCount != 8) {
|
|
152
152
|
throw PaymentSheetAppearanceError.unexpectedHexStringLength(darkHexString)
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
let lightColor = UIColor(hexString: lightHexString)
|
|
156
156
|
let darkColor = UIColor(hexString: darkHexString)
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
if #available(iOS 13.0, *) {
|
|
159
159
|
return UIColor.init { traits in
|
|
160
160
|
return traits.userInterfaceStyle == .dark ? darkColor : lightColor
|
|
@@ -163,7 +163,7 @@ internal class PaymentSheetAppearance {
|
|
|
163
163
|
return lightColor
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
|
|
167
167
|
private class func buildEmbeddedPaymentElementAppearance(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement {
|
|
168
168
|
var embeddedAppearance = PaymentSheet.Appearance.EmbeddedPaymentElement()
|
|
169
169
|
|
|
@@ -209,17 +209,16 @@ internal class PaymentSheetAppearance {
|
|
|
209
209
|
|
|
210
210
|
private class func buildEmbeddedFlat(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat {
|
|
211
211
|
var flat = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
if let thickness = params[PaymentSheetAppearanceKeys.SEPARATOR_THICKNESS] as? CGFloat {
|
|
214
214
|
flat.separatorThickness = thickness
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
216
|
+
|
|
217
|
+
flat.separatorColor = parseThemedColor(
|
|
218
|
+
params: params,
|
|
219
|
+
key: PaymentSheetAppearanceKeys.SEPARATOR_COLOR,
|
|
220
|
+
default: PaymentSheet.Appearance.default.colors.componentBorder
|
|
221
|
+
)
|
|
223
222
|
|
|
224
223
|
if let insetsParams = params[PaymentSheetAppearanceKeys.SEPARATOR_INSETS] as? NSDictionary {
|
|
225
224
|
flat.separatorInsets = try buildEdgeInsets(params: insetsParams)
|
|
@@ -251,21 +250,19 @@ internal class PaymentSheetAppearance {
|
|
|
251
250
|
private class func buildEmbeddedRadio(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Radio {
|
|
252
251
|
var radio = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.radio
|
|
253
252
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
253
|
+
// Selected‐state color
|
|
254
|
+
radio.selectedColor = parseThemedColor(
|
|
255
|
+
params: params,
|
|
256
|
+
key: PaymentSheetAppearanceKeys.SELECTED_COLOR,
|
|
257
|
+
default: PaymentSheet.Appearance.default.colors.primary
|
|
258
|
+
)
|
|
259
|
+
|
|
262
260
|
// Unselected‐state color
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
261
|
+
radio.unselectedColor = parseThemedColor(
|
|
262
|
+
params: params,
|
|
263
|
+
key: PaymentSheetAppearanceKeys.UNSELECTED_COLOR,
|
|
264
|
+
default: PaymentSheet.Appearance.default.colors.componentBorder
|
|
265
|
+
)
|
|
269
266
|
|
|
270
267
|
return radio
|
|
271
268
|
}
|
|
@@ -273,12 +270,11 @@ internal class PaymentSheetAppearance {
|
|
|
273
270
|
private class func buildEmbeddedCheckmark(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Checkmark {
|
|
274
271
|
var checkmark = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.checkmark
|
|
275
272
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
273
|
+
checkmark.color = parseThemedColor(
|
|
274
|
+
params: params,
|
|
275
|
+
key: PaymentSheetAppearanceKeys.COLOR,
|
|
276
|
+
default: PaymentSheet.Appearance.default.colors.primary
|
|
277
|
+
)
|
|
282
278
|
|
|
283
279
|
return checkmark
|
|
284
280
|
}
|
|
@@ -286,12 +282,11 @@ internal class PaymentSheetAppearance {
|
|
|
286
282
|
private class func buildEmbeddedChevron(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Chevron {
|
|
287
283
|
var chevron = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.chevron
|
|
288
284
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
285
|
+
chevron.color = parseThemedColor(
|
|
286
|
+
params: params,
|
|
287
|
+
key: PaymentSheetAppearanceKeys.COLOR,
|
|
288
|
+
default: UIColor.systemGray // Default iOS system gray color
|
|
289
|
+
)
|
|
295
290
|
|
|
296
291
|
return chevron
|
|
297
292
|
}
|
|
@@ -311,7 +306,7 @@ internal class PaymentSheetAppearance {
|
|
|
311
306
|
let left = params[PaymentSheetAppearanceKeys.LEFT] as? CGFloat ?? 0
|
|
312
307
|
let bottom = params[PaymentSheetAppearanceKeys.BOTTOM] as? CGFloat ?? 0
|
|
313
308
|
let right = params[PaymentSheetAppearanceKeys.RIGHT] as? CGFloat ?? 0
|
|
314
|
-
|
|
309
|
+
|
|
315
310
|
return UIEdgeInsets(
|
|
316
311
|
top: top,
|
|
317
312
|
left: left,
|
|
@@ -319,7 +314,7 @@ internal class PaymentSheetAppearance {
|
|
|
319
314
|
right: right
|
|
320
315
|
)
|
|
321
316
|
}
|
|
322
|
-
|
|
317
|
+
|
|
323
318
|
private class func dynamicColor(
|
|
324
319
|
from hexDict: [String: String],
|
|
325
320
|
default defaultColor: UIColor
|
|
@@ -340,13 +335,32 @@ internal class PaymentSheetAppearance {
|
|
|
340
335
|
return defaultColor
|
|
341
336
|
})
|
|
342
337
|
}
|
|
343
|
-
|
|
338
|
+
|
|
339
|
+
private class func parseThemedColor(
|
|
340
|
+
params: NSDictionary,
|
|
341
|
+
key: String,
|
|
342
|
+
default defaultColor: UIColor
|
|
343
|
+
) -> UIColor {
|
|
344
|
+
// Check if it's a dictionary with light/dark keys
|
|
345
|
+
if let colorDict = params[key] as? [String: String] {
|
|
346
|
+
return dynamicColor(from: colorDict, default: defaultColor)
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Check if it's a plain string
|
|
350
|
+
if let colorString = params[key] as? String {
|
|
351
|
+
return UIColor(hexString: colorString)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Fall back to default if no color provided
|
|
355
|
+
return defaultColor
|
|
356
|
+
}
|
|
357
|
+
|
|
344
358
|
private class func buildFormInsets(params: NSDictionary) throws -> NSDirectionalEdgeInsets {
|
|
345
359
|
let top = params[PaymentSheetAppearanceKeys.TOP] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.top
|
|
346
360
|
let leading = params[PaymentSheetAppearanceKeys.LEFT] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.leading
|
|
347
361
|
let bottom = params[PaymentSheetAppearanceKeys.BOTTOM] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.bottom
|
|
348
362
|
let trailing = params[PaymentSheetAppearanceKeys.RIGHT] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.trailing
|
|
349
|
-
|
|
363
|
+
|
|
350
364
|
return NSDirectionalEdgeInsets(
|
|
351
365
|
top: top,
|
|
352
366
|
leading: leading,
|
|
@@ -362,7 +376,7 @@ enum PaymentSheetAppearanceError : Error {
|
|
|
362
376
|
case unexpectedHexStringLength(String)
|
|
363
377
|
case invalidRowStyle(String)
|
|
364
378
|
}
|
|
365
|
-
|
|
379
|
+
|
|
366
380
|
extension PaymentSheetAppearanceError: LocalizedError {
|
|
367
381
|
public var errorDescription: String? {
|
|
368
382
|
switch self {
|
|
@@ -393,11 +407,11 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
393
407
|
static let PLACEHOLDER_TEXT = "placeholderText"
|
|
394
408
|
static let ICON = "icon"
|
|
395
409
|
static let ERROR = "error"
|
|
396
|
-
|
|
410
|
+
|
|
397
411
|
static let FONT = "font"
|
|
398
412
|
static let FAMILY = "family"
|
|
399
413
|
static let SCALE = "scale"
|
|
400
|
-
|
|
414
|
+
|
|
401
415
|
static let SHAPES = "shapes"
|
|
402
416
|
static let BORDER_RADIUS = "borderRadius"
|
|
403
417
|
static let BORDER_WIDTH = "borderWidth"
|
|
@@ -410,11 +424,11 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
410
424
|
static let BLUR_RADIUS = "blurRadius"
|
|
411
425
|
static let X = "x"
|
|
412
426
|
static let Y = "y"
|
|
413
|
-
|
|
427
|
+
|
|
414
428
|
static let PRIMARY_BUTTON = "primaryButton"
|
|
415
429
|
static let TEXT = "text"
|
|
416
430
|
static let BORDER = "border"
|
|
417
|
-
|
|
431
|
+
|
|
418
432
|
static let EMBEDDED_PAYMENT_ELEMENT = "embeddedPaymentElement"
|
|
419
433
|
static let ROW = "row"
|
|
420
434
|
static let STYLE = "style"
|
|
@@ -437,12 +451,12 @@ private struct PaymentSheetAppearanceKeys {
|
|
|
437
451
|
static let BOTTOM = "bottom"
|
|
438
452
|
static let RIGHT = "right"
|
|
439
453
|
static let COLOR = "color"
|
|
440
|
-
|
|
454
|
+
|
|
441
455
|
// Row Style Enum Values (match TS string enum values)
|
|
442
456
|
static let ROW_STYLE_FLAT_WITH_RADIO = "flatWithRadio"
|
|
443
457
|
static let ROW_STYLE_FLOATING_BUTTON = "floatingButton"
|
|
444
458
|
static let ROW_STYLE_FLAT_WITH_CHECKMARK = "flatWithCheckmark"
|
|
445
459
|
static let ROW_STYLE_FLAT_WITH_CHEVRON = "flatWithChevron"
|
|
446
|
-
|
|
460
|
+
|
|
447
461
|
static let FORM_INSETS = "formInsetValues"
|
|
448
462
|
}
|
package/ios/StripeSdk.mm
CHANGED
|
@@ -400,6 +400,13 @@ RCT_EXPORT_METHOD(clearEmbeddedPaymentOption:(NSInteger)viewTag
|
|
|
400
400
|
resolve(nil);
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
+
RCT_EXPORT_METHOD(customPaymentMethodResultCallback:(nonnull NSDictionary *)result
|
|
404
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
405
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
406
|
+
{
|
|
407
|
+
[StripeSdkImpl.shared customPaymentMethodResultCallback:result resolver:resolve rejecter:reject];
|
|
408
|
+
}
|
|
409
|
+
|
|
403
410
|
/* clang-format on */
|
|
404
411
|
|
|
405
412
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -16,4 +16,5 @@ import Foundation
|
|
|
16
16
|
func emitEmbeddedPaymentElementFormSheetConfirmComplete(_ value: [String: Any])
|
|
17
17
|
func emitEmbeddedPaymentElementRowSelectionImmediateAction()
|
|
18
18
|
func emitEmbeddedPaymentElementLoadingFailed(_ value: [String: Any])
|
|
19
|
+
func emitOnCustomPaymentMethodConfirmHandlerCallback(_ value: [String: Any])
|
|
19
20
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(EmbeddedPaymentElementPrivateBeta) @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) import StripePaymentSheet
|
|
9
|
+
@_spi(EmbeddedPaymentElementPrivateBeta) @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) @_spi(CustomPaymentMethodsBeta) import StripePaymentSheet
|
|
10
10
|
|
|
11
11
|
@objc(StripeSdkImpl)
|
|
12
12
|
extension StripeSdkImpl {
|
|
@@ -69,23 +69,25 @@ extension StripeSdkImpl {
|
|
|
69
69
|
@objc(confirmEmbeddedPaymentElement:reject:)
|
|
70
70
|
public func confirmEmbeddedPaymentElement(resolve: @escaping RCTPromiseResolveBlock,
|
|
71
71
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
72
|
+
DispatchQueue.main.async { [weak self] in
|
|
73
|
+
self?.embeddedInstance?.presentingViewController = RCTPresentedViewController()
|
|
74
|
+
self?.embeddedInstance?.confirm { result in
|
|
75
|
+
switch result {
|
|
76
|
+
case .completed:
|
|
77
|
+
// Return an object with { status: 'completed' }
|
|
78
|
+
resolve(["status": "completed"])
|
|
79
|
+
case .canceled:
|
|
80
|
+
// Return an object with { status: 'canceled' }
|
|
81
|
+
resolve(["status": "canceled"])
|
|
82
|
+
case .failed(let error):
|
|
83
|
+
// Return an object with { status: 'failed', error }
|
|
84
|
+
resolve([
|
|
85
|
+
"status": "failed",
|
|
86
|
+
"error": error.localizedDescription
|
|
87
|
+
])
|
|
88
|
+
}
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
|
-
}
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
@objc(updateEmbeddedPaymentElement:resolve:reject:)
|
|
@@ -320,6 +322,26 @@ extension StripeSdkImpl {
|
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
324
|
}
|
|
325
|
+
// Parse custom payment method configuration
|
|
326
|
+
if let customPaymentMethodConfig = params["customPaymentMethodConfiguration"] as? NSDictionary {
|
|
327
|
+
let parsedMethods = StripeSdkImpl.parseCustomPaymentMethods(from: customPaymentMethodConfig)
|
|
328
|
+
|
|
329
|
+
if !parsedMethods.isEmpty {
|
|
330
|
+
let customMethods = parsedMethods.map { parsed in
|
|
331
|
+
var customPaymentMethod = EmbeddedPaymentElement.CustomPaymentMethodConfiguration.CustomPaymentMethod(
|
|
332
|
+
id: parsed.id,
|
|
333
|
+
subtitle: parsed.subtitle
|
|
334
|
+
)
|
|
335
|
+
customPaymentMethod.disableBillingDetailCollection = parsed.disableBillingDetailCollection
|
|
336
|
+
return customPaymentMethod
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
configuration.customPaymentMethodConfiguration = .init(
|
|
340
|
+
customPaymentMethods: customMethods,
|
|
341
|
+
customPaymentMethodConfirmHandler: StripeSdkImpl.createCustomPaymentMethodConfirmHandler(sdkImpl: self)
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
323
345
|
|
|
324
346
|
return (nil, configuration)
|
|
325
347
|
}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(EmbeddedPaymentElementPrivateBeta) @_spi(STP) @_spi(PaymentMethodOptionsSetupFutureUsagePreview) import StripePaymentSheet
|
|
9
|
+
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(EmbeddedPaymentElementPrivateBeta) @_spi(STP) @_spi(PaymentMethodOptionsSetupFutureUsagePreview) @_spi(CustomPaymentMethodsBeta) import StripePaymentSheet
|
|
10
|
+
|
|
10
11
|
|
|
11
12
|
extension StripeSdkImpl {
|
|
12
13
|
internal func buildPaymentSheetConfiguration(
|
|
@@ -137,6 +138,14 @@ extension StripeSdkImpl {
|
|
|
137
138
|
|
|
138
139
|
configuration.cardBrandAcceptance = computeCardBrandAcceptance(params: params)
|
|
139
140
|
|
|
141
|
+
// Parse custom payment method configuration
|
|
142
|
+
if let customPaymentMethodConfig = params["customPaymentMethodConfiguration"] as? [String: Any] {
|
|
143
|
+
configuration.customPaymentMethodConfiguration = StripeSdkImpl.buildCustomPaymentMethodConfiguration(
|
|
144
|
+
from: customPaymentMethodConfig,
|
|
145
|
+
sdkImpl: self
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
140
149
|
return (nil, configuration)
|
|
141
150
|
}
|
|
142
151
|
|
|
@@ -410,5 +419,109 @@ extension StripeSdkImpl {
|
|
|
410
419
|
return .automatic
|
|
411
420
|
}
|
|
412
421
|
}
|
|
422
|
+
|
|
423
|
+
// MARK: - Common Custom Payment Method Helper
|
|
424
|
+
|
|
425
|
+
// Simple data structure for parsed custom payment method data
|
|
426
|
+
struct ParsedCustomPaymentMethod {
|
|
427
|
+
let id: String
|
|
428
|
+
let subtitle: String?
|
|
429
|
+
let disableBillingDetailCollection: Bool
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Simple parser that extracts data without type complexity
|
|
433
|
+
static func parseCustomPaymentMethods(from config: [String: Any]) -> [ParsedCustomPaymentMethod] {
|
|
434
|
+
guard let customMethods = config["customPaymentMethods"] as? [[String: Any]],
|
|
435
|
+
!customMethods.isEmpty else { return [] }
|
|
436
|
+
|
|
437
|
+
return customMethods.compactMap { methodDict in
|
|
438
|
+
guard let id = methodDict["id"] as? String else { return nil }
|
|
439
|
+
let subtitle = methodDict["subtitle"] as? String
|
|
440
|
+
let disableBillingDetailCollection = methodDict["disableBillingDetailCollection"] as? Bool ?? true
|
|
441
|
+
|
|
442
|
+
return ParsedCustomPaymentMethod(
|
|
443
|
+
id: id,
|
|
444
|
+
subtitle: subtitle,
|
|
445
|
+
disableBillingDetailCollection: disableBillingDetailCollection
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Overload for NSDictionary
|
|
451
|
+
static func parseCustomPaymentMethods(from config: NSDictionary) -> [ParsedCustomPaymentMethod] {
|
|
452
|
+
guard let customPaymentMethods = config["customPaymentMethods"] as? NSArray,
|
|
453
|
+
customPaymentMethods.count > 0 else { return [] }
|
|
454
|
+
|
|
455
|
+
var parsedMethods: [ParsedCustomPaymentMethod] = []
|
|
456
|
+
|
|
457
|
+
for customPaymentMethodData in customPaymentMethods {
|
|
458
|
+
if let customPaymentMethodDict = customPaymentMethodData as? NSDictionary,
|
|
459
|
+
let id = customPaymentMethodDict["id"] as? String {
|
|
460
|
+
let subtitle = customPaymentMethodDict["subtitle"] as? String
|
|
461
|
+
let disableBillingDetailCollection = customPaymentMethodDict["disableBillingDetailCollection"] as? Bool ?? true
|
|
462
|
+
|
|
463
|
+
parsedMethods.append(ParsedCustomPaymentMethod(
|
|
464
|
+
id: id,
|
|
465
|
+
subtitle: subtitle,
|
|
466
|
+
disableBillingDetailCollection: disableBillingDetailCollection
|
|
467
|
+
))
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return parsedMethods
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
private static func buildCustomPaymentMethodConfiguration(
|
|
475
|
+
from config: [String: Any],
|
|
476
|
+
sdkImpl: StripeSdkImpl
|
|
477
|
+
) -> PaymentSheet.CustomPaymentMethodConfiguration? {
|
|
478
|
+
let parsedMethods = parseCustomPaymentMethods(from: config)
|
|
479
|
+
guard !parsedMethods.isEmpty else { return nil }
|
|
480
|
+
|
|
481
|
+
let customMethods = parsedMethods.map { parsed in
|
|
482
|
+
var cpm = PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethod(
|
|
483
|
+
id: parsed.id,
|
|
484
|
+
subtitle: parsed.subtitle
|
|
485
|
+
)
|
|
486
|
+
cpm.disableBillingDetailCollection = parsed.disableBillingDetailCollection
|
|
487
|
+
return cpm
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
return .init(
|
|
491
|
+
customPaymentMethods: customMethods,
|
|
492
|
+
customPaymentMethodConfirmHandler: createCustomPaymentMethodConfirmHandler(sdkImpl: sdkImpl)
|
|
493
|
+
)
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// MARK: - Common Custom Payment Method Handler
|
|
497
|
+
|
|
498
|
+
static func createCustomPaymentMethodConfirmHandler(
|
|
499
|
+
sdkImpl: StripeSdkImpl?
|
|
500
|
+
) -> PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethodConfirmHandler {
|
|
501
|
+
return { customPaymentMethod, billingDetails in
|
|
502
|
+
// Send event to JS with the custom payment method data
|
|
503
|
+
let customPaymentMethodDict: [String: Any] = [
|
|
504
|
+
"id": customPaymentMethod.id
|
|
505
|
+
]
|
|
506
|
+
|
|
507
|
+
let billingDetailsDict = Mappers.mapFromBillingDetails(billingDetails: billingDetails)
|
|
508
|
+
let payload: [String: Any] = [
|
|
509
|
+
"customPaymentMethod": customPaymentMethodDict,
|
|
510
|
+
"billingDetails": billingDetailsDict
|
|
511
|
+
]
|
|
512
|
+
|
|
513
|
+
// Use async/await with continuation instead of blocking semaphore
|
|
514
|
+
return await withCheckedContinuation { continuation in
|
|
515
|
+
// Set up callback to receive result from JavaScript
|
|
516
|
+
sdkImpl?.customPaymentMethodResultCallback = { result in
|
|
517
|
+
sdkImpl?.customPaymentMethodResultCallback = nil
|
|
518
|
+
continuation.resume(returning: result)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// Emit event to JavaScript
|
|
522
|
+
sdkImpl?.emitter?.emitOnCustomPaymentMethodConfirmHandlerCallback(payload)
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
413
526
|
}
|
|
414
527
|
|
package/ios/StripeSdkImpl.swift
CHANGED
|
@@ -62,6 +62,7 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
62
62
|
var setSelectedPaymentOptionCallback: (() -> Void)? = nil
|
|
63
63
|
var fetchSelectedPaymentOptionCallback: ((CustomerPaymentOption?) -> Void)? = nil
|
|
64
64
|
var setupIntentClientSecretForCustomerAttachCallback: ((String) -> Void)? = nil
|
|
65
|
+
var customPaymentMethodResultCallback: ((PaymentSheetResult) -> Void)?
|
|
65
66
|
|
|
66
67
|
var embeddedInstance: EmbeddedPaymentElement? = nil
|
|
67
68
|
lazy var embeddedInstanceDelegate = StripeSdkEmbeddedPaymentElementDelegate(sdkImpl: self)
|
|
@@ -130,20 +131,38 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
130
131
|
if let clientSecret = result["clientSecret"] as? String {
|
|
131
132
|
paymentSheetIntentCreationCallback(.success(clientSecret))
|
|
132
133
|
} else {
|
|
133
|
-
struct ConfirmationError: Error, LocalizedError {
|
|
134
|
-
private var errorMessage: String
|
|
135
|
-
init(errorMessage: String) {
|
|
136
|
-
self.errorMessage = errorMessage
|
|
137
|
-
}
|
|
138
|
-
public var errorDescription: String? {
|
|
139
|
-
return errorMessage
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
134
|
let errorParams = result["error"] as? NSDictionary
|
|
143
135
|
let error = ConfirmationError.init(errorMessage: errorParams?["localizedMessage"] as? String ?? "An unknown error occurred.")
|
|
144
136
|
paymentSheetIntentCreationCallback(.failure(error))
|
|
145
137
|
}
|
|
146
138
|
}
|
|
139
|
+
|
|
140
|
+
@objc(customPaymentMethodResultCallback:resolver:rejecter:)
|
|
141
|
+
@MainActor public func customPaymentMethodResultCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
142
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
143
|
+
guard let customPaymentMethodResultCallback = self.customPaymentMethodResultCallback else {
|
|
144
|
+
resolve(Errors.createError(ErrorType.Failed, "Internal error: no custom payment method callback"))
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
let status = result["status"] as? String ?? ""
|
|
149
|
+
let errorMessage = result["error"] as? String
|
|
150
|
+
|
|
151
|
+
switch status {
|
|
152
|
+
case "completed":
|
|
153
|
+
customPaymentMethodResultCallback(.completed)
|
|
154
|
+
case "canceled":
|
|
155
|
+
customPaymentMethodResultCallback(.canceled)
|
|
156
|
+
case "failed":
|
|
157
|
+
let error = ConfirmationError.init(errorMessage: errorMessage ?? "An unknown error occurred.")
|
|
158
|
+
customPaymentMethodResultCallback(.failed(error: error))
|
|
159
|
+
default:
|
|
160
|
+
let error = ConfirmationError.init(errorMessage: "Unknown custom payment method result status")
|
|
161
|
+
customPaymentMethodResultCallback(.failed(error: error))
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
resolve(NSNull())
|
|
165
|
+
}
|
|
147
166
|
|
|
148
167
|
@objc(confirmPaymentSheetPayment:rejecter:)
|
|
149
168
|
public func confirmPaymentSheetPayment(resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -1156,6 +1175,16 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1156
1175
|
break
|
|
1157
1176
|
}
|
|
1158
1177
|
}
|
|
1178
|
+
|
|
1179
|
+
struct ConfirmationError: Error, LocalizedError {
|
|
1180
|
+
private var errorMessage: String
|
|
1181
|
+
init(errorMessage: String) {
|
|
1182
|
+
self.errorMessage = errorMessage
|
|
1183
|
+
}
|
|
1184
|
+
public var errorDescription: String? {
|
|
1185
|
+
return errorMessage
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1159
1188
|
}
|
|
1160
1189
|
|
|
1161
1190
|
func findViewControllerPresenter(from uiViewController: UIViewController) -> UIViewController {
|
|
@@ -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/jaynewstrom/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,0FAAAC,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/jaynewstrom/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
|