@stripe/stripe-react-native 0.59.2 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +123 -89
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +12 -9
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +6 -5
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +54 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +34 -3
- package/ios/Mappers.swift +10 -0
- package/ios/StripeSdkImpl.swift +3 -1
- package/jest/mock.js +1 -1
- 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/connect/Components.js +1 -1
- package/lib/commonjs/connect/Components.js.map +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
- package/lib/commonjs/connect/NavigationBar.js +1 -1
- package/lib/commonjs/connect/NavigationBar.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js.map +1 -1
- package/lib/commonjs/specs/NativeCardForm.js +1 -1
- package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
- package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/Onramp.js.map +1 -1
- package/lib/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/connect/Components.js +1 -1
- package/lib/module/connect/Components.js.map +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/module/connect/EmbeddedComponent.js +1 -1
- package/lib/module/connect/EmbeddedComponent.js.map +1 -1
- package/lib/module/connect/ModalCloseButton.js +1 -1
- package/lib/module/connect/ModalCloseButton.js.map +1 -1
- package/lib/module/connect/NavigationBar.js +1 -1
- package/lib/module/connect/NavigationBar.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/module/specs/NativeCardField.js +1 -1
- package/lib/module/specs/NativeCardField.js.map +1 -1
- package/lib/module/specs/NativeCardForm.js +1 -1
- package/lib/module/specs/NativeCardForm.js.map +1 -1
- package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/module/specs/NativeGooglePayButton.js +1 -1
- package/lib/module/specs/NativeNavigationBar.js +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/Onramp.js.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +30 -0
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +0 -5
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/hooks/useOnramp.tsx +7 -3
- package/src/types/Onramp.ts +32 -0
- package/src/types/index.ts +0 -6
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ implementation 'com.google.android.material:material:<version>'
|
|
|
100
100
|
|
|
101
101
|
#### iOS
|
|
102
102
|
|
|
103
|
-
The Stripe React Native SDK
|
|
103
|
+
The Stripe React Native SDK supports all [Apple supported Xcode versions](https://developer.apple.com/news/upcoming-requirements/) and is compatible with apps targeting iOS 13 or above. For iOS 12 support, please use [`@stripe/stripe-react-native@0.19.0`](https://github.com/stripe/stripe-react-native/releases/tag/v0.19.0).
|
|
104
104
|
|
|
105
105
|
The SDK uses TypeScript features available in Babel version `7.9.0` and above.
|
|
106
106
|
Alternatively use the `plugin-transform-typescript` plugin in your project.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
StripeSdk_kotlinVersion=
|
|
1
|
+
StripeSdk_kotlinVersion=2.3.10
|
|
2
2
|
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=
|
|
6
|
+
StripeSdk_stripeVersion=23.0.2
|
|
@@ -78,7 +78,7 @@ class FakeOnrampSdkModule(
|
|
|
78
78
|
updatedAddress: ReadableMap?,
|
|
79
79
|
promise: Promise,
|
|
80
80
|
) {
|
|
81
|
-
promise
|
|
81
|
+
promise.resolveNotImplemented()
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
@ReactMethod
|
|
@@ -126,7 +126,7 @@ class FakeOnrampSdkModule(
|
|
|
126
126
|
token: ReadableMap,
|
|
127
127
|
promise: Promise,
|
|
128
128
|
) {
|
|
129
|
-
promise
|
|
129
|
+
promise.resolveNotImplemented()
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
@ReactMethod
|
|
@@ -97,17 +97,6 @@ class PaymentSheetManager(
|
|
|
97
97
|
)
|
|
98
98
|
return
|
|
99
99
|
}
|
|
100
|
-
val primaryButtonLabel = arguments.getString("primaryButtonLabel")
|
|
101
|
-
val googlePayConfig = buildGooglePayConfig(arguments.getMap("googlePay"))
|
|
102
|
-
val linkConfig = buildLinkConfig(arguments.getMap("link"))
|
|
103
|
-
val allowsDelayedPaymentMethods = arguments.getBooleanOr("allowsDelayedPaymentMethods", false)
|
|
104
|
-
val billingDetailsMap = arguments.getMap("defaultBillingDetails")
|
|
105
|
-
val billingConfigParams = arguments.getMap("billingDetailsCollectionConfiguration")
|
|
106
|
-
val paymentMethodOrder = arguments.getStringList("paymentMethodOrder")
|
|
107
|
-
val allowsRemovalOfLastSavedPaymentMethod =
|
|
108
|
-
arguments.getBooleanOr("allowsRemovalOfLastSavedPaymentMethod", true)
|
|
109
|
-
val opensCardScannerAutomatically =
|
|
110
|
-
arguments.getBooleanOr("opensCardScannerAutomatically", false)
|
|
111
100
|
paymentIntentClientSecret = arguments.getString("paymentIntentClientSecret").orEmpty()
|
|
112
101
|
setupIntentClientSecret = arguments.getString("setupIntentClientSecret").orEmpty()
|
|
113
102
|
intentConfiguration =
|
|
@@ -121,26 +110,6 @@ class PaymentSheetManager(
|
|
|
121
110
|
// Determine which callback type to use based on what's provided
|
|
122
111
|
val intentConfigMap = arguments.getMap("intentConfiguration")
|
|
123
112
|
val useConfirmationTokenCallback = intentConfigMap?.hasKey("confirmationTokenConfirmHandler") == true
|
|
124
|
-
val appearance =
|
|
125
|
-
try {
|
|
126
|
-
buildPaymentSheetAppearance(arguments.getMap("appearance"), context)
|
|
127
|
-
} catch (error: PaymentSheetAppearanceException) {
|
|
128
|
-
initPromise.resolve(createError(ErrorType.Failed.toString(), error))
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
val customerConfiguration =
|
|
133
|
-
try {
|
|
134
|
-
buildCustomerConfiguration(arguments)
|
|
135
|
-
} catch (error: PaymentSheetException) {
|
|
136
|
-
initPromise.resolve(createError(ErrorType.Failed.toString(), error))
|
|
137
|
-
return
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
val shippingDetails =
|
|
141
|
-
arguments.getMap("defaultShippingDetails")?.let {
|
|
142
|
-
AddressSheetView.buildAddressDetails(it)
|
|
143
|
-
}
|
|
144
113
|
|
|
145
114
|
val paymentOptionCallback =
|
|
146
115
|
PaymentOptionResultCallback { paymentOptionResult ->
|
|
@@ -208,8 +177,6 @@ class PaymentSheetManager(
|
|
|
208
177
|
|
|
209
178
|
is PaymentSheetResult.Completed -> {
|
|
210
179
|
resolvePaymentResult(Arguments.createMap())
|
|
211
|
-
paymentSheet = null
|
|
212
|
-
flowController = null
|
|
213
180
|
}
|
|
214
181
|
}
|
|
215
182
|
}
|
|
@@ -268,6 +235,117 @@ class PaymentSheetManager(
|
|
|
268
235
|
}
|
|
269
236
|
}
|
|
270
237
|
|
|
238
|
+
if (arguments.getBooleanOr("customFlow", false)) {
|
|
239
|
+
if (flowController == null) {
|
|
240
|
+
flowController =
|
|
241
|
+
if (intentConfiguration != null) {
|
|
242
|
+
val builder =
|
|
243
|
+
PaymentSheet.FlowController
|
|
244
|
+
.Builder(
|
|
245
|
+
resultCallback = paymentResultCallback,
|
|
246
|
+
paymentOptionResultCallback = paymentOptionCallback,
|
|
247
|
+
)
|
|
248
|
+
if (useConfirmationTokenCallback) {
|
|
249
|
+
builder.createIntentCallback(createConfirmationTokenCallback)
|
|
250
|
+
} else {
|
|
251
|
+
builder.createIntentCallback(createIntentCallback)
|
|
252
|
+
}
|
|
253
|
+
builder
|
|
254
|
+
.confirmCustomPaymentMethodCallback(this)
|
|
255
|
+
.build(activity)
|
|
256
|
+
} else {
|
|
257
|
+
PaymentSheet.FlowController
|
|
258
|
+
.Builder(
|
|
259
|
+
resultCallback = paymentResultCallback,
|
|
260
|
+
paymentOptionResultCallback = paymentOptionCallback,
|
|
261
|
+
).confirmCustomPaymentMethodCallback(this)
|
|
262
|
+
.build(activity)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
if (paymentSheet == null) {
|
|
267
|
+
paymentSheet =
|
|
268
|
+
if (intentConfiguration != null) {
|
|
269
|
+
val builder = PaymentSheet.Builder(paymentResultCallback)
|
|
270
|
+
if (useConfirmationTokenCallback) {
|
|
271
|
+
builder.createIntentCallback(createConfirmationTokenCallback)
|
|
272
|
+
} else {
|
|
273
|
+
builder.createIntentCallback(createIntentCallback)
|
|
274
|
+
}
|
|
275
|
+
@SuppressLint("RestrictedApi")
|
|
276
|
+
builder
|
|
277
|
+
.confirmCustomPaymentMethodCallback(this)
|
|
278
|
+
.build(activity, signal)
|
|
279
|
+
} else {
|
|
280
|
+
@SuppressLint("RestrictedApi")
|
|
281
|
+
PaymentSheet
|
|
282
|
+
.Builder(paymentResultCallback)
|
|
283
|
+
.confirmCustomPaymentMethodCallback(this)
|
|
284
|
+
.build(activity, signal)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
configure(arguments, initPromise)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
override fun onDestroy() {
|
|
292
|
+
flowController = null
|
|
293
|
+
paymentSheet = null
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
fun configure(
|
|
297
|
+
args: ReadableMap,
|
|
298
|
+
promise: Promise,
|
|
299
|
+
) {
|
|
300
|
+
val merchantDisplayName = args.getString("merchantDisplayName").orEmpty()
|
|
301
|
+
if (merchantDisplayName.isEmpty()) {
|
|
302
|
+
promise.resolve(
|
|
303
|
+
createError(ErrorType.Failed.toString(), "merchantDisplayName cannot be empty or null."),
|
|
304
|
+
)
|
|
305
|
+
return
|
|
306
|
+
}
|
|
307
|
+
val primaryButtonLabel = args.getString("primaryButtonLabel")
|
|
308
|
+
val googlePayConfig = buildGooglePayConfig(args.getMap("googlePay"))
|
|
309
|
+
val linkConfig = buildLinkConfig(args.getMap("link"))
|
|
310
|
+
val allowsDelayedPaymentMethods = args.getBooleanOr("allowsDelayedPaymentMethods", false)
|
|
311
|
+
val billingDetailsMap = args.getMap("defaultBillingDetails")
|
|
312
|
+
val billingConfigParams = args.getMap("billingDetailsCollectionConfiguration")
|
|
313
|
+
val paymentMethodOrder = args.getStringList("paymentMethodOrder")
|
|
314
|
+
val allowsRemovalOfLastSavedPaymentMethod =
|
|
315
|
+
args.getBooleanOr("allowsRemovalOfLastSavedPaymentMethod", true)
|
|
316
|
+
val opensCardScannerAutomatically =
|
|
317
|
+
args.getBooleanOr("opensCardScannerAutomatically", false)
|
|
318
|
+
paymentIntentClientSecret = args.getString("paymentIntentClientSecret").orEmpty()
|
|
319
|
+
setupIntentClientSecret = args.getString("setupIntentClientSecret").orEmpty()
|
|
320
|
+
intentConfiguration =
|
|
321
|
+
try {
|
|
322
|
+
buildIntentConfiguration(args.getMap("intentConfiguration"))
|
|
323
|
+
} catch (error: PaymentSheetException) {
|
|
324
|
+
promise.resolve(createError(ErrorType.Failed.toString(), error))
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
val appearance =
|
|
329
|
+
try {
|
|
330
|
+
buildPaymentSheetAppearance(args.getMap("appearance"), context)
|
|
331
|
+
} catch (error: PaymentSheetAppearanceException) {
|
|
332
|
+
promise.resolve(createError(ErrorType.Failed.toString(), error))
|
|
333
|
+
return
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
val customerConfiguration =
|
|
337
|
+
try {
|
|
338
|
+
buildCustomerConfiguration(args)
|
|
339
|
+
} catch (error: PaymentSheetException) {
|
|
340
|
+
promise.resolve(createError(ErrorType.Failed.toString(), error))
|
|
341
|
+
return
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
val shippingDetails =
|
|
345
|
+
args.getMap("defaultShippingDetails")?.let {
|
|
346
|
+
AddressSheetView.buildAddressDetails(it)
|
|
347
|
+
}
|
|
348
|
+
|
|
271
349
|
val billingDetailsConfig = buildBillingDetailsCollectionConfiguration(billingConfigParams)
|
|
272
350
|
|
|
273
351
|
val defaultBillingDetails = buildBillingDetails(billingDetailsMap)
|
|
@@ -283,72 +361,28 @@ class PaymentSheetManager(
|
|
|
283
361
|
.link(linkConfig)
|
|
284
362
|
.billingDetailsCollectionConfiguration(billingDetailsConfig)
|
|
285
363
|
.preferredNetworks(
|
|
286
|
-
mapToPreferredNetworks(
|
|
364
|
+
mapToPreferredNetworks(args.getIntegerList("preferredNetworks")),
|
|
287
365
|
).allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod)
|
|
288
366
|
.opensCardScannerAutomatically(opensCardScannerAutomatically)
|
|
289
|
-
.cardBrandAcceptance(mapToCardBrandAcceptance(
|
|
367
|
+
.cardBrandAcceptance(mapToCardBrandAcceptance(args))
|
|
290
368
|
.apply {
|
|
291
|
-
mapToAllowedCardFundingTypes(
|
|
292
|
-
}.customPaymentMethods(parseCustomPaymentMethods(
|
|
369
|
+
mapToAllowedCardFundingTypes(args)?.let { allowedCardFundingTypes(it) }
|
|
370
|
+
}.customPaymentMethods(parseCustomPaymentMethods(args.getMap("customPaymentMethodConfiguration")))
|
|
293
371
|
|
|
294
372
|
primaryButtonLabel?.let { configurationBuilder.primaryButtonLabel(it) }
|
|
295
373
|
paymentMethodOrder?.let { configurationBuilder.paymentMethodOrder(it) }
|
|
296
374
|
|
|
297
375
|
configurationBuilder.paymentMethodLayout(
|
|
298
|
-
mapToPaymentMethodLayout(
|
|
376
|
+
mapToPaymentMethodLayout(args.getString("paymentMethodLayout")),
|
|
299
377
|
)
|
|
300
378
|
|
|
301
|
-
mapToTermsDisplay(
|
|
379
|
+
mapToTermsDisplay(args)?.let { configurationBuilder.termsDisplay(it) }
|
|
302
380
|
|
|
303
381
|
paymentSheetConfiguration = configurationBuilder.build()
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
flowController =
|
|
307
|
-
if (intentConfiguration != null) {
|
|
308
|
-
val builder =
|
|
309
|
-
PaymentSheet.FlowController
|
|
310
|
-
.Builder(
|
|
311
|
-
resultCallback = paymentResultCallback,
|
|
312
|
-
paymentOptionResultCallback = paymentOptionCallback,
|
|
313
|
-
)
|
|
314
|
-
if (useConfirmationTokenCallback) {
|
|
315
|
-
builder.createIntentCallback(createConfirmationTokenCallback)
|
|
316
|
-
} else {
|
|
317
|
-
builder.createIntentCallback(createIntentCallback)
|
|
318
|
-
}
|
|
319
|
-
builder
|
|
320
|
-
.confirmCustomPaymentMethodCallback(this)
|
|
321
|
-
.build(activity)
|
|
322
|
-
} else {
|
|
323
|
-
PaymentSheet.FlowController
|
|
324
|
-
.Builder(
|
|
325
|
-
resultCallback = paymentResultCallback,
|
|
326
|
-
paymentOptionResultCallback = paymentOptionCallback,
|
|
327
|
-
).confirmCustomPaymentMethodCallback(this)
|
|
328
|
-
.build(activity)
|
|
329
|
-
}
|
|
330
|
-
configureFlowController()
|
|
382
|
+
if (args.getBooleanOr("customFlow", false)) {
|
|
383
|
+
configureFlowController(promise)
|
|
331
384
|
} else {
|
|
332
|
-
|
|
333
|
-
if (intentConfiguration != null) {
|
|
334
|
-
val builder = PaymentSheet.Builder(paymentResultCallback)
|
|
335
|
-
if (useConfirmationTokenCallback) {
|
|
336
|
-
builder.createIntentCallback(createConfirmationTokenCallback)
|
|
337
|
-
} else {
|
|
338
|
-
builder.createIntentCallback(createIntentCallback)
|
|
339
|
-
}
|
|
340
|
-
@SuppressLint("RestrictedApi")
|
|
341
|
-
builder
|
|
342
|
-
.confirmCustomPaymentMethodCallback(this)
|
|
343
|
-
.build(activity, signal)
|
|
344
|
-
} else {
|
|
345
|
-
@SuppressLint("RestrictedApi")
|
|
346
|
-
PaymentSheet
|
|
347
|
-
.Builder(paymentResultCallback)
|
|
348
|
-
.confirmCustomPaymentMethodCallback(this)
|
|
349
|
-
.build(activity, signal)
|
|
350
|
-
}
|
|
351
|
-
initPromise.resolve(Arguments.createMap())
|
|
385
|
+
promise.resolve(Arguments.createMap())
|
|
352
386
|
}
|
|
353
387
|
}
|
|
354
388
|
|
|
@@ -433,10 +467,10 @@ class PaymentSheetManager(
|
|
|
433
467
|
flowController?.confirm()
|
|
434
468
|
}
|
|
435
469
|
|
|
436
|
-
private fun configureFlowController() {
|
|
470
|
+
private fun configureFlowController(promise: Promise) {
|
|
437
471
|
val onFlowControllerConfigure =
|
|
438
472
|
PaymentSheet.FlowController.ConfigCallback { success, error ->
|
|
439
|
-
handleFlowControllerConfigured(success, error,
|
|
473
|
+
handleFlowControllerConfigured(success, error, promise, flowController)
|
|
440
474
|
}
|
|
441
475
|
|
|
442
476
|
if (!paymentIntentClientSecret.isNullOrEmpty()) {
|
|
@@ -458,7 +492,7 @@ class PaymentSheetManager(
|
|
|
458
492
|
callback = onFlowControllerConfigure,
|
|
459
493
|
)
|
|
460
494
|
} else {
|
|
461
|
-
|
|
495
|
+
promise.resolve(
|
|
462
496
|
createError(
|
|
463
497
|
ErrorType.Failed.toString(),
|
|
464
498
|
"One of `paymentIntentClientSecret`, `setupIntentClientSecret`, or `intentConfiguration` is required",
|
|
@@ -257,11 +257,14 @@ class StripeSdkModule(
|
|
|
257
257
|
params: ReadableMap,
|
|
258
258
|
promise: Promise,
|
|
259
259
|
) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
260
|
+
if (paymentSheetManager != null) {
|
|
261
|
+
paymentSheetManager?.configure(params, promise)
|
|
262
|
+
} else {
|
|
263
|
+
paymentSheetManager =
|
|
264
|
+
PaymentSheetManager(reactApplicationContext, params, promise).also {
|
|
265
|
+
registerStripeUIManager(it)
|
|
266
|
+
}
|
|
267
|
+
}
|
|
265
268
|
}
|
|
266
269
|
|
|
267
270
|
@ReactMethod
|
|
@@ -1340,10 +1343,10 @@ class StripeSdkModule(
|
|
|
1340
1343
|
stripeAccountId = stripeAccountId,
|
|
1341
1344
|
callback =
|
|
1342
1345
|
object : com.stripe.android.ApiResultCallback<RadarSession> {
|
|
1343
|
-
override fun onSuccess(
|
|
1344
|
-
val
|
|
1345
|
-
|
|
1346
|
-
promise.resolve(
|
|
1346
|
+
override fun onSuccess(result: RadarSession) {
|
|
1347
|
+
val response = WritableNativeMap()
|
|
1348
|
+
response.putString("id", result.id)
|
|
1349
|
+
promise.resolve(response)
|
|
1347
1350
|
}
|
|
1348
1351
|
|
|
1349
1352
|
override fun onError(e: Exception) {
|
|
@@ -142,7 +142,8 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
|
|
|
142
142
|
Map<String, Object> constants = getTypedExportedConstants();
|
|
143
143
|
if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
|
|
144
144
|
Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
|
|
145
|
-
"API_VERSIONS"
|
|
145
|
+
"API_VERSIONS",
|
|
146
|
+
"SYSTEM_INFO"
|
|
146
147
|
));
|
|
147
148
|
Set<String> optionalFlowConstants = new HashSet<>();
|
|
148
149
|
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
|
|
@@ -264,6 +265,10 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
|
|
|
264
265
|
@DoNotStrip
|
|
265
266
|
public abstract void clearEmbeddedPaymentOption(double viewTag, Promise promise);
|
|
266
267
|
|
|
268
|
+
@ReactMethod
|
|
269
|
+
@DoNotStrip
|
|
270
|
+
public abstract void createRadarSession(Promise promise);
|
|
271
|
+
|
|
267
272
|
@ReactMethod
|
|
268
273
|
@DoNotStrip
|
|
269
274
|
public abstract void setFinancialConnectionsForceNativeFlow(boolean enabled, Promise promise);
|
|
@@ -295,8 +300,4 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
|
|
|
295
300
|
@ReactMethod
|
|
296
301
|
@DoNotStrip
|
|
297
302
|
public abstract void removeListeners(double count);
|
|
298
|
-
|
|
299
|
-
@ReactMethod
|
|
300
|
-
@DoNotStrip
|
|
301
|
-
public abstract void createRadarSession(Promise promise);
|
|
302
303
|
}
|
|
@@ -4,6 +4,9 @@ import android.annotation.SuppressLint
|
|
|
4
4
|
import androidx.compose.ui.graphics.Color
|
|
5
5
|
import com.facebook.react.bridge.ReadableMap
|
|
6
6
|
import com.stripe.android.crypto.onramp.model.OnrampConfiguration
|
|
7
|
+
import com.stripe.android.crypto.onramp.model.PaymentMethodDisplayData
|
|
8
|
+
import com.stripe.android.googlepaylauncher.GooglePayEnvironment
|
|
9
|
+
import com.stripe.android.googlepaylauncher.GooglePayPaymentMethodLauncher
|
|
7
10
|
import com.stripe.android.link.LinkAppearance
|
|
8
11
|
import com.stripe.android.link.LinkAppearance.Colors
|
|
9
12
|
import com.stripe.android.link.LinkAppearance.PrimaryButton
|
|
@@ -25,12 +28,55 @@ internal fun mapConfig(
|
|
|
25
28
|
|
|
26
29
|
val displayName = configMap.getString("merchantDisplayName") ?: ""
|
|
27
30
|
val cryptoCustomerId = configMap.getString("cryptoCustomerId")
|
|
31
|
+
val googlePayConfig = mapGooglePayConfig(configMap.getMap("googlePay"))
|
|
28
32
|
|
|
29
33
|
return OnrampConfiguration()
|
|
30
34
|
.merchantDisplayName(displayName)
|
|
31
35
|
.publishableKey(publishableKey)
|
|
32
36
|
.appearance(appearance)
|
|
33
37
|
.cryptoCustomerId(cryptoCustomerId)
|
|
38
|
+
.apply { googlePayConfig?.let { googlePayConfig(it) } }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@SuppressLint("RestrictedApi")
|
|
42
|
+
internal fun mapGooglePayConfig(params: ReadableMap?): GooglePayPaymentMethodLauncher.Config? {
|
|
43
|
+
if (params == null) return null
|
|
44
|
+
|
|
45
|
+
val testEnv = params.hasKey("testEnv") && params.getBoolean("testEnv")
|
|
46
|
+
val merchantCountryCode = params.getString("merchantCountryCode") ?: return null
|
|
47
|
+
val merchantName = params.getString("merchantName") ?: return null
|
|
48
|
+
val existingPaymentMethodRequired =
|
|
49
|
+
params.hasKey("existingPaymentMethodRequired") && params.getBoolean("existingPaymentMethodRequired")
|
|
50
|
+
|
|
51
|
+
val billingAddressConfig =
|
|
52
|
+
mapGooglePayBillingAddressConfig(params.getMap("billingAddressConfig"))
|
|
53
|
+
|
|
54
|
+
return GooglePayPaymentMethodLauncher.Config(
|
|
55
|
+
environment = if (testEnv) GooglePayEnvironment.Test else GooglePayEnvironment.Production,
|
|
56
|
+
merchantCountryCode = merchantCountryCode,
|
|
57
|
+
merchantName = merchantName,
|
|
58
|
+
billingAddressConfig = billingAddressConfig,
|
|
59
|
+
existingPaymentMethodRequired = existingPaymentMethodRequired,
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private fun mapGooglePayBillingAddressConfig(params: ReadableMap?): GooglePayPaymentMethodLauncher.BillingAddressConfig {
|
|
64
|
+
if (params == null) return GooglePayPaymentMethodLauncher.BillingAddressConfig()
|
|
65
|
+
|
|
66
|
+
val isRequired = params.hasKey("isRequired") && params.getBoolean("isRequired")
|
|
67
|
+
val format =
|
|
68
|
+
when (params.getString("format")) {
|
|
69
|
+
"Full" -> GooglePayPaymentMethodLauncher.BillingAddressConfig.Format.Full
|
|
70
|
+
else -> GooglePayPaymentMethodLauncher.BillingAddressConfig.Format.Min
|
|
71
|
+
}
|
|
72
|
+
val isPhoneNumberRequired =
|
|
73
|
+
params.hasKey("isPhoneNumberRequired") && params.getBoolean("isPhoneNumberRequired")
|
|
74
|
+
|
|
75
|
+
return GooglePayPaymentMethodLauncher.BillingAddressConfig(
|
|
76
|
+
isRequired = isRequired,
|
|
77
|
+
format = format,
|
|
78
|
+
isPhoneNumberRequired = isPhoneNumberRequired,
|
|
79
|
+
)
|
|
34
80
|
}
|
|
35
81
|
|
|
36
82
|
@SuppressLint("RestrictedApi")
|
|
@@ -101,3 +147,11 @@ internal fun mapAppearance(appearanceMap: ReadableMap): LinkAppearance {
|
|
|
101
147
|
.style(style)
|
|
102
148
|
.primaryButton(primaryButton)
|
|
103
149
|
}
|
|
150
|
+
|
|
151
|
+
@SuppressLint("RestrictedApi")
|
|
152
|
+
internal fun mapPaymentDetailsType(type: PaymentMethodDisplayData.Type): String =
|
|
153
|
+
when (type) {
|
|
154
|
+
PaymentMethodDisplayData.Type.Card -> "Card"
|
|
155
|
+
PaymentMethodDisplayData.Type.BankAccount -> "BankAccount"
|
|
156
|
+
PaymentMethodDisplayData.Type.GooglePay -> "GooglePay"
|
|
157
|
+
}
|
|
@@ -42,7 +42,7 @@ import com.stripe.android.crypto.onramp.model.OnrampTokenAuthenticationResult
|
|
|
42
42
|
import com.stripe.android.crypto.onramp.model.OnrampUpdatePhoneNumberResult
|
|
43
43
|
import com.stripe.android.crypto.onramp.model.OnrampVerifyIdentityResult
|
|
44
44
|
import com.stripe.android.crypto.onramp.model.OnrampVerifyKycInfoResult
|
|
45
|
-
import com.stripe.android.crypto.onramp.model.
|
|
45
|
+
import com.stripe.android.crypto.onramp.model.PaymentMethodSelection
|
|
46
46
|
import com.stripe.android.link.LinkController.PaymentMethodPreview
|
|
47
47
|
import com.stripe.android.link.PaymentMethodPreviewDetails
|
|
48
48
|
import com.stripe.android.model.CardBrand
|
|
@@ -431,8 +431,32 @@ class OnrampSdkModule(
|
|
|
431
431
|
|
|
432
432
|
val method =
|
|
433
433
|
when (paymentMethod) {
|
|
434
|
-
"Card" ->
|
|
435
|
-
"BankAccount" ->
|
|
434
|
+
"Card" -> PaymentMethodSelection.Card()
|
|
435
|
+
"BankAccount" -> PaymentMethodSelection.BankAccount()
|
|
436
|
+
"CardAndBankAccount" -> PaymentMethodSelection.CardAndBankAccount()
|
|
437
|
+
"PlatformPay" -> {
|
|
438
|
+
val googlePayParams =
|
|
439
|
+
platformPayParams.getMap("googlePay")
|
|
440
|
+
?: run {
|
|
441
|
+
promise.resolve(
|
|
442
|
+
createFailedError(
|
|
443
|
+
IllegalArgumentException("Missing googlePay params in platformPayParams"),
|
|
444
|
+
),
|
|
445
|
+
)
|
|
446
|
+
return
|
|
447
|
+
}
|
|
448
|
+
val currencyCode = googlePayParams.getString("currencyCode") ?: ""
|
|
449
|
+
val amount = googlePayParams.getDouble("amount").toLong()
|
|
450
|
+
val transactionId = googlePayParams.getString("transactionId")
|
|
451
|
+
val label = googlePayParams.getString("label")
|
|
452
|
+
|
|
453
|
+
PaymentMethodSelection.GooglePay(
|
|
454
|
+
currencyCode = currencyCode,
|
|
455
|
+
amount = amount,
|
|
456
|
+
transactionId = transactionId,
|
|
457
|
+
label = label,
|
|
458
|
+
)
|
|
459
|
+
}
|
|
436
460
|
else -> {
|
|
437
461
|
promise.resolve(
|
|
438
462
|
createFailedError(
|
|
@@ -596,6 +620,12 @@ class OnrampSdkModule(
|
|
|
596
620
|
displayData.putString("label", paymentDetails.label)
|
|
597
621
|
displayData.putString("sublabel", paymentDetails.sublabel)
|
|
598
622
|
|
|
623
|
+
if (token.hasKey("card")) {
|
|
624
|
+
displayData.putString("type", "Card")
|
|
625
|
+
} else if (token.hasKey("us_bank_account")) {
|
|
626
|
+
displayData.putString("type", "BankAccount")
|
|
627
|
+
}
|
|
628
|
+
|
|
599
629
|
promise.resolve(createResult("displayData", displayData))
|
|
600
630
|
}
|
|
601
631
|
}
|
|
@@ -709,6 +739,7 @@ class OnrampSdkModule(
|
|
|
709
739
|
displayData.putString("icon", iconDataUri)
|
|
710
740
|
displayData.putString("label", result.displayData.label)
|
|
711
741
|
result.displayData.sublabel?.let { displayData.putString("sublabel", it) }
|
|
742
|
+
displayData.putString("type", mapPaymentDetailsType(result.displayData.type))
|
|
712
743
|
|
|
713
744
|
promise.resolve(createResult("displayData", displayData))
|
|
714
745
|
}
|
package/ios/Mappers.swift
CHANGED
|
@@ -1289,9 +1289,19 @@ class Mappers {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
class func paymentMethodDisplayDataToMap(_ paymentMethodDisplayData: PaymentMethodDisplayData) -> [String: String] {
|
|
1292
|
+
let type = switch paymentMethodDisplayData.paymentMethodType {
|
|
1293
|
+
case .card:
|
|
1294
|
+
"Card"
|
|
1295
|
+
case .bankAccount:
|
|
1296
|
+
"BankAccount"
|
|
1297
|
+
case .applePay:
|
|
1298
|
+
"ApplePay"
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1292
1301
|
var result = [
|
|
1293
1302
|
"icon": "data:image/png;base64," + (paymentMethodDisplayData.icon.pngData()?.base64EncodedString(options: []) ?? ""),
|
|
1294
1303
|
"label": paymentMethodDisplayData.label,
|
|
1304
|
+
"type": type,
|
|
1295
1305
|
]
|
|
1296
1306
|
|
|
1297
1307
|
if let sublabel = paymentMethodDisplayData.sublabel {
|
package/ios/StripeSdkImpl.swift
CHANGED
|
@@ -1545,11 +1545,13 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1545
1545
|
paymentMethodType = .card
|
|
1546
1546
|
case "BankAccount":
|
|
1547
1547
|
paymentMethodType = .bankAccount
|
|
1548
|
+
case "CardAndBankAccount":
|
|
1549
|
+
paymentMethodType = .cardAndBankAccount
|
|
1548
1550
|
case "PlatformPay":
|
|
1549
1551
|
guard let applePayParams = platformPayParams["applePay"] as? NSDictionary else {
|
|
1550
1552
|
resolve(Errors.createError(ErrorType.Failed, "You must provide the `applePay` parameter."))
|
|
1551
1553
|
return
|
|
1552
|
-
|
|
1554
|
+
}
|
|
1553
1555
|
|
|
1554
1556
|
let (error, paymentRequest) = ApplePayUtils.createPaymentRequest(merchantIdentifier: merchantIdentifier, params: applePayParams)
|
|
1555
1557
|
if let paymentRequest {
|
package/jest/mock.js
CHANGED
|
@@ -378,7 +378,7 @@ module.exports = {
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
// Mock NativeStripeSdkModule with getConstants for system info
|
|
381
|
-
jest.mock('
|
|
381
|
+
jest.mock('../src/specs/NativeStripeSdkModule', () => ({
|
|
382
382
|
default: {
|
|
383
383
|
getConstants: jest.fn(() => ({
|
|
384
384
|
API_VERSIONS: {
|
|
@@ -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
|
|
@@ -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,qFAAAC,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/jaynewstrom/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,wFAAAC,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/jaynewstrom/stripe/stripe-react-native/src/components/CardField.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}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
|