@stripe/stripe-react-native 0.41.0 → 0.42.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +3 -0
  3. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  5. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/8.9/gc.properties +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  10. package/android/.gradle/vcs-1/gc.properties +0 -0
  11. package/android/.project +11 -0
  12. package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
  13. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +21 -0
  14. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +20 -0
  15. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +114 -35
  16. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +50 -0
  17. package/ios/FinancialConnections.swift +14 -2
  18. package/ios/Mappers.swift +23 -0
  19. package/ios/PaymentMethodFactory.swift +31 -29
  20. package/ios/StripeSdk.swift +50 -19
  21. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  22. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  23. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  24. package/lib/commonjs/components/AddressSheet.js +1 -1
  25. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  26. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  27. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  28. package/lib/commonjs/components/CardField.js +1 -1
  29. package/lib/commonjs/components/CardField.js.map +1 -1
  30. package/lib/commonjs/components/CardForm.js +1 -1
  31. package/lib/commonjs/components/CardForm.js.map +1 -1
  32. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  33. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  34. package/lib/commonjs/components/StripeContainer.js +1 -1
  35. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  36. package/lib/commonjs/functions.js +1 -1
  37. package/lib/commonjs/functions.js.map +1 -1
  38. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +1 -1
  39. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
  40. package/lib/commonjs/hooks/useStripe.js +1 -1
  41. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  42. package/lib/commonjs/types/FinancialConnections.js +1 -1
  43. package/lib/commonjs/types/FinancialConnections.js.map +1 -1
  44. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  45. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  46. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  47. package/lib/module/NativeStripeSdk.js.map +1 -1
  48. package/lib/module/components/AddToWalletButton.js +1 -1
  49. package/lib/module/components/AddToWalletButton.js.map +1 -1
  50. package/lib/module/components/AddressSheet.js +1 -1
  51. package/lib/module/components/AddressSheet.js.map +1 -1
  52. package/lib/module/components/AuBECSDebitForm.js +1 -1
  53. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  54. package/lib/module/components/CardField.js +1 -1
  55. package/lib/module/components/CardField.js.map +1 -1
  56. package/lib/module/components/CardForm.js +1 -1
  57. package/lib/module/components/CardForm.js.map +1 -1
  58. package/lib/module/components/PlatformPayButton.js +1 -1
  59. package/lib/module/components/PlatformPayButton.js.map +1 -1
  60. package/lib/module/components/StripeContainer.js +1 -1
  61. package/lib/module/components/StripeContainer.js.map +1 -1
  62. package/lib/module/functions.js +1 -1
  63. package/lib/module/functions.js.map +1 -1
  64. package/lib/module/hooks/useFinancialConnectionsSheet.js +1 -1
  65. package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
  66. package/lib/module/hooks/useStripe.js +1 -1
  67. package/lib/module/hooks/useStripe.js.map +1 -1
  68. package/lib/module/types/FinancialConnections.js +1 -1
  69. package/lib/module/types/FinancialConnections.js.map +1 -1
  70. package/lib/module/types/PaymentIntent.js.map +1 -1
  71. package/lib/module/types/PaymentMethod.js.map +1 -1
  72. package/lib/module/types/PaymentSheet.js.map +1 -1
  73. package/lib/typescript/src/NativeStripeSdk.d.ts +1 -1
  74. package/lib/typescript/src/functions.d.ts +6 -2
  75. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +4 -2
  76. package/lib/typescript/src/hooks/useStripe.d.ts +2 -2
  77. package/lib/typescript/src/types/FinancialConnections.d.ts +64 -0
  78. package/lib/typescript/src/types/PaymentIntent.d.ts +26 -0
  79. package/lib/typescript/src/types/PaymentMethod.d.ts +7 -0
  80. package/lib/typescript/src/types/PaymentSheet.d.ts +1 -1
  81. package/package.json +3 -4
  82. package/src/NativeStripeSdk.tsx +1 -1
  83. package/src/functions.ts +57 -2
  84. package/src/hooks/useFinancialConnectionsSheet.tsx +12 -4
  85. package/src/hooks/useStripe.tsx +10 -4
  86. package/src/types/FinancialConnections.ts +69 -0
  87. package/src/types/PaymentIntent.ts +30 -1
  88. package/src/types/PaymentMethod.ts +8 -0
  89. package/src/types/PaymentSheet.ts +1 -1
  90. package/stripe-react-native.podspec +1 -1
@@ -7,6 +7,7 @@ class PaymentMethodFactory {
7
7
  var paymentMethodOptions: NSDictionary? = nil
8
8
  var cardFieldView: CardFieldView? = nil
9
9
  var cardFormView: CardFormView? = nil
10
+ var metadata: [String: String]? = nil
10
11
 
11
12
  init(paymentMethodData: NSDictionary?, options: NSDictionary, cardFieldView: CardFieldView?, cardFormView: CardFormView?) {
12
13
  self.paymentMethodData = paymentMethodData
@@ -14,6 +15,7 @@ class PaymentMethodFactory {
14
15
  self.paymentMethodOptions = options
15
16
  self.cardFieldView = cardFieldView
16
17
  self.cardFormView = cardFormView
18
+ self.metadata = paymentMethodData?["metadata"] as? [String: String]
17
19
  }
18
20
 
19
21
  func createParams(paymentMethodType: STPPaymentMethodType) throws -> STPPaymentMethodParams? {
@@ -124,7 +126,7 @@ class PaymentMethodFactory {
124
126
 
125
127
  // private func createWeChatPayPaymentMethodParams() throws -> STPPaymentMethodParams {
126
128
  // let params = STPPaymentMethodWeChatPayParams()
127
- // return STPPaymentMethodParams(weChatPay: params, billingDetails: billingDetailsParams, metadata: nil)
129
+ // return STPPaymentMethodParams(weChatPay: params, billingDetails: billingDetailsParams, metadata: metadata)
128
130
  // }
129
131
  //
130
132
 
@@ -152,22 +154,22 @@ class PaymentMethodFactory {
152
154
  if let bankName = self.paymentMethodData?["bankName"] as? String {
153
155
  params.bankName = bankName
154
156
  }
155
-
156
157
 
157
- return STPPaymentMethodParams(iDEAL: params, billingDetails: billingDetailsParams, metadata: nil)
158
+
159
+ return STPPaymentMethodParams(iDEAL: params, billingDetails: billingDetailsParams, metadata: metadata)
158
160
  }
159
161
 
160
162
  private func createGrabpayPaymentMethodParams() -> STPPaymentMethodParams {
161
163
  let params = STPPaymentMethodGrabPayParams()
162
164
 
163
- return STPPaymentMethodParams(grabPay: params, billingDetails: billingDetailsParams, metadata: nil)
165
+ return STPPaymentMethodParams(grabPay: params, billingDetails: billingDetailsParams, metadata: metadata)
164
166
  }
165
167
 
166
168
  private func createCardPaymentMethodParams() throws -> STPPaymentMethodParams {
167
169
  if let token = paymentMethodData?["token"] as? String {
168
170
  let methodParams = STPPaymentMethodCardParams()
169
171
  methodParams.token = token
170
- return STPPaymentMethodParams(card: methodParams, billingDetails: billingDetailsParams, metadata: nil)
172
+ return STPPaymentMethodParams(card: methodParams, billingDetails: billingDetailsParams, metadata: metadata)
171
173
  }
172
174
 
173
175
  if let params = cardFieldView?.cardParams as? STPPaymentMethodParams {
@@ -197,7 +199,7 @@ class PaymentMethodFactory {
197
199
  billingDetailsParams?.address?.country = address.country
198
200
  }
199
201
  }
200
- return STPPaymentMethodParams(card: params, billingDetails: billingDetailsParams, metadata: nil)
202
+ return STPPaymentMethodParams(card: params, billingDetails: billingDetailsParams, metadata: metadata)
201
203
  }
202
204
 
203
205
  throw PaymentMethodError.cardPaymentMissingParams
@@ -225,11 +227,11 @@ class PaymentMethodFactory {
225
227
  params.rawBankString = "test_offline_bank"
226
228
  }
227
229
 
228
- return STPPaymentMethodParams(fpx: params, billingDetails: billingDetailsParams, metadata: nil)
230
+ return STPPaymentMethodParams(fpx: params, billingDetails: billingDetailsParams, metadata: metadata)
229
231
  }
230
232
 
231
233
  private func createAlipayPaymentMethodParams() throws -> STPPaymentMethodParams {
232
- return STPPaymentMethodParams(alipay: STPPaymentMethodAlipayParams(), billingDetails: billingDetailsParams, metadata: nil)
234
+ return STPPaymentMethodParams(alipay: STPPaymentMethodAlipayParams(), billingDetails: billingDetailsParams, metadata: metadata)
233
235
  }
234
236
 
235
237
  private func createP24PaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -239,7 +241,7 @@ class PaymentMethodFactory {
239
241
  throw PaymentMethodError.p24PaymentMissingParams
240
242
  }
241
243
 
242
- return STPPaymentMethodParams(przelewy24: params, billingDetails: billingDetails, metadata: nil)
244
+ return STPPaymentMethodParams(przelewy24: params, billingDetails: billingDetails, metadata: metadata)
243
245
  }
244
246
 
245
247
  private func createAlipayPaymentMethodOptions() throws -> STPConfirmPaymentMethodOptions {
@@ -255,7 +257,7 @@ class PaymentMethodFactory {
255
257
  let params = STPPaymentMethodSofortParams()
256
258
  params.country = country
257
259
 
258
- return STPPaymentMethodParams(sofort: params, billingDetails: billingDetailsParams, metadata: nil)
260
+ return STPPaymentMethodParams(sofort: params, billingDetails: billingDetailsParams, metadata: metadata)
259
261
  }
260
262
 
261
263
  private func createBancontactPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -265,7 +267,7 @@ class PaymentMethodFactory {
265
267
  throw PaymentMethodError.bancontactPaymentMissingParams
266
268
  }
267
269
 
268
- return STPPaymentMethodParams(bancontact: params, billingDetails: billingDetails, metadata: nil)
270
+ return STPPaymentMethodParams(bancontact: params, billingDetails: billingDetails, metadata: metadata)
269
271
  }
270
272
 
271
273
  private func createSepaPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -280,7 +282,7 @@ class PaymentMethodFactory {
280
282
 
281
283
  params.iban = iban
282
284
 
283
- return STPPaymentMethodParams(sepaDebit: params, billingDetails: billingDetails, metadata: nil)
285
+ return STPPaymentMethodParams(sepaDebit: params, billingDetails: billingDetails, metadata: metadata)
284
286
  }
285
287
 
286
288
  private func createOXXOPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -290,7 +292,7 @@ class PaymentMethodFactory {
290
292
  throw PaymentMethodError.bancontactPaymentMissingParams
291
293
  }
292
294
 
293
- return STPPaymentMethodParams(oxxo: params, billingDetails: billingDetails, metadata: nil)
295
+ return STPPaymentMethodParams(oxxo: params, billingDetails: billingDetails, metadata: metadata)
294
296
  }
295
297
 
296
298
  private func createGiropayPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -300,7 +302,7 @@ class PaymentMethodFactory {
300
302
  throw PaymentMethodError.giropayPaymentMissingParams
301
303
  }
302
304
 
303
- return STPPaymentMethodParams(giropay: params, billingDetails: billingDetails, metadata: nil)
305
+ return STPPaymentMethodParams(giropay: params, billingDetails: billingDetails, metadata: metadata)
304
306
  }
305
307
 
306
308
  private func createEPSPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -310,7 +312,7 @@ class PaymentMethodFactory {
310
312
  throw PaymentMethodError.epsPaymentMissingParams
311
313
  }
312
314
 
313
- return STPPaymentMethodParams(eps: params, billingDetails: billingDetails, metadata: nil)
315
+ return STPPaymentMethodParams(eps: params, billingDetails: billingDetails, metadata: metadata)
314
316
  }
315
317
 
316
318
  private func createBECSDebitPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -324,7 +326,7 @@ class PaymentMethodFactory {
324
326
  params.accountNumber = formDetails?["accountNumber"] as? String
325
327
  params.bsbNumber = formDetails?["bsbNumber"] as? String
326
328
 
327
- return STPPaymentMethodParams(aubecsDebit: params, billingDetails: billingDetails, metadata: nil)
329
+ return STPPaymentMethodParams(aubecsDebit: params, billingDetails: billingDetails, metadata: metadata)
328
330
  }
329
331
 
330
332
  private func createAfterpayClearpayPaymentMethodParams() throws -> STPPaymentMethodParams {
@@ -334,19 +336,19 @@ class PaymentMethodFactory {
334
336
  throw PaymentMethodError.afterpayClearpayPaymentMissingParams
335
337
  }
336
338
 
337
- return STPPaymentMethodParams(afterpayClearpay: params, billingDetails: billingDetails, metadata: nil)
339
+ return STPPaymentMethodParams(afterpayClearpay: params, billingDetails: billingDetails, metadata: metadata)
338
340
  }
339
341
 
340
342
  private func createKlarnaPaymentMethodParams() throws -> STPPaymentMethodParams {
341
343
  let params = STPPaymentMethodKlarnaParams()
342
344
 
343
345
  if let billingDetails = billingDetailsParams, billingDetails.address?.country != nil, billingDetails.email != nil {
344
- return STPPaymentMethodParams(klarna: params, billingDetails: billingDetails, metadata: nil)
346
+ return STPPaymentMethodParams(klarna: params, billingDetails: billingDetails, metadata: metadata)
345
347
  } else {
346
348
  throw PaymentMethodError.klarnaPaymentMissingParams
347
349
  }
348
350
  }
349
-
351
+
350
352
  private func createUSBankAccountPaymentMethodParams() throws -> STPPaymentMethodParams {
351
353
  let params = STPPaymentMethodUSBankAccountParams()
352
354
 
@@ -363,36 +365,36 @@ class PaymentMethodFactory {
363
365
  params.accountType = Mappers.mapToUSBankAccountType(type: self.paymentMethodData?["accountType"] as? String)
364
366
 
365
367
  if let billingDetails = billingDetailsParams, billingDetails.name != nil {
366
- return STPPaymentMethodParams(usBankAccount: params, billingDetails: billingDetails, metadata: nil)
368
+ return STPPaymentMethodParams(usBankAccount: params, billingDetails: billingDetails, metadata: metadata)
367
369
  } else {
368
370
  throw PaymentMethodError.usBankAccountPaymentMissingParams
369
371
  }
370
372
  }
371
-
373
+
372
374
  private func createPayPalPaymentMethodParams() throws -> STPPaymentMethodParams {
373
- return STPPaymentMethodParams(payPal: STPPaymentMethodPayPalParams(), billingDetails: billingDetailsParams, metadata: nil)
375
+ return STPPaymentMethodParams(payPal: STPPaymentMethodPayPalParams(), billingDetails: billingDetailsParams, metadata: metadata)
374
376
  }
375
-
377
+
376
378
  private func createAffirmPaymentMethodParams() throws -> STPPaymentMethodParams {
377
379
  let params = STPPaymentMethodAffirmParams()
378
- return STPPaymentMethodParams(affirm: params, metadata: nil)
380
+ return STPPaymentMethodParams(affirm: params, metadata: metadata)
379
381
  }
380
-
382
+
381
383
  private func createCashAppPaymentMethodParams() throws -> STPPaymentMethodParams {
382
384
  let params = STPPaymentMethodCashAppParams()
383
- return STPPaymentMethodParams(cashApp: params, billingDetails: billingDetailsParams, metadata: nil)
385
+ return STPPaymentMethodParams(cashApp: params, billingDetails: billingDetailsParams, metadata: metadata)
384
386
  }
385
-
387
+
386
388
  private func createRevolutPayPaymentMethodParams() throws -> STPPaymentMethodParams {
387
389
  let params = STPPaymentMethodRevolutPayParams()
388
- return STPPaymentMethodParams(revolutPay: params, billingDetails: billingDetailsParams, metadata: nil)
390
+ return STPPaymentMethodParams(revolutPay: params, billingDetails: billingDetailsParams, metadata: metadata)
389
391
  }
390
392
 
391
393
  func createMandateData() -> STPMandateDataParams? {
392
394
  if let mandateParams = paymentMethodData?["mandateData"] as? NSDictionary {
393
395
  if let customerAcceptanceParams = mandateParams["customerAcceptance"] as? NSDictionary {
394
396
  let mandate = STPMandateDataParams.init(customerAcceptance: STPMandateCustomerAcceptanceParams.init())
395
-
397
+
396
398
  mandate.customerAcceptance.type = .online
397
399
  if let onlineParams = customerAcceptanceParams["online"] as? NSDictionary {
398
400
  mandate.customerAcceptance.onlineParams = .init(ipAddress: onlineParams["ipAddress"] as? String ?? "", userAgent: onlineParams["userAgent"] as? String ?? "")
@@ -71,7 +71,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
71
71
  override func supportedEvents() -> [String]! {
72
72
  return ["onOrderTrackingCallback", "onConfirmHandlerCallback", "onCustomerAdapterFetchPaymentMethodsCallback", "onCustomerAdapterAttachPaymentMethodCallback",
73
73
  "onCustomerAdapterDetachPaymentMethodCallback", "onCustomerAdapterSetSelectedPaymentOptionCallback", "onCustomerAdapterFetchSelectedPaymentOptionCallback",
74
- "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback"]
74
+ "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", "onFinancialConnectionsEvent"]
75
75
  }
76
76
 
77
77
  @objc override static func requiresMainQueueSetup() -> Bool {
@@ -129,7 +129,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
129
129
  }
130
130
 
131
131
  @objc(intentCreationCallback:resolver:rejecter:)
132
- func intentCreationCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock,
132
+ @MainActor func intentCreationCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock,
133
133
  rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
134
134
  guard let paymentSheetIntentCreationCallback = self.paymentSheetIntentCreationCallback else {
135
135
  resolve(Errors.createError(ErrorType.Failed, "No intent creation callback was set"))
@@ -138,18 +138,18 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
138
138
  if let clientSecret = result["clientSecret"] as? String {
139
139
  paymentSheetIntentCreationCallback(.success(clientSecret))
140
140
  } else {
141
- class ConfirmationError: Error, LocalizedError {
142
- private var errorMessage: String
143
- init(errorMessage: String) {
144
- self.errorMessage = errorMessage
145
- }
146
- public var errorDescription: String? {
147
- return errorMessage
148
- }
141
+ struct ConfirmationError: Error, LocalizedError {
142
+ private var errorMessage: String
143
+ init(errorMessage: String) {
144
+ self.errorMessage = errorMessage
149
145
  }
150
- let errorParams = result["error"] as? NSDictionary
151
- let error = ConfirmationError.init(errorMessage: errorParams?["localizedMessage"] as? String ?? "An unknown error occurred.")
152
- paymentSheetIntentCreationCallback(.failure(error))
146
+ public var errorDescription: String? {
147
+ return errorMessage
148
+ }
149
+ }
150
+ let errorParams = result["error"] as? NSDictionary
151
+ let error = ConfirmationError.init(errorMessage: errorParams?["localizedMessage"] as? String ?? "An unknown error occurred.")
152
+ paymentSheetIntentCreationCallback(.failure(error))
153
153
  }
154
154
  }
155
155
 
@@ -733,13 +733,23 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
733
733
  connectionsReturnURL = nil
734
734
  }
735
735
 
736
+ var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
737
+
738
+ if hasEventListeners {
739
+ onEvent = { [weak self] event in
740
+ let mappedEvent = Mappers.financialConnectionsEventToMap(event)
741
+ self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent)
742
+ }
743
+ }
744
+
736
745
  if (isPaymentIntent) {
737
746
  DispatchQueue.main.async {
738
747
  STPBankAccountCollector().collectBankAccountForPayment(
739
748
  clientSecret: clientSecret as String,
740
749
  returnURL: connectionsReturnURL,
741
750
  params: collectParams,
742
- from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController())
751
+ from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController()),
752
+ onEvent: onEvent
743
753
  ) { intent, error in
744
754
  if let error = error {
745
755
  resolve(Errors.createError(ErrorType.Failed, error as NSError))
@@ -765,7 +775,8 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
765
775
  clientSecret: clientSecret as String,
766
776
  returnURL: connectionsReturnURL,
767
777
  params: collectParams,
768
- from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController())
778
+ from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController()),
779
+ onEvent: onEvent
769
780
  ) { intent, error in
770
781
  if let error = error {
771
782
  resolve(Errors.createError(ErrorType.Failed, error as NSError))
@@ -1040,9 +1051,19 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
1040
1051
  if let urlScheme = urlScheme {
1041
1052
  returnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
1042
1053
  } else {
1043
- returnURL = nil
1054
+ returnURL = nil
1055
+ }
1056
+
1057
+ var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
1058
+
1059
+ if hasEventListeners {
1060
+ onEvent = { [weak self] event in
1061
+ let mappedEvent = Mappers.financialConnectionsEventToMap(event)
1062
+ self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent)
1063
+ }
1044
1064
  }
1045
- FinancialConnections.presentForToken(withClientSecret: clientSecret, returnURL: returnURL, resolve: resolve)
1065
+
1066
+ FinancialConnections.presentForToken(withClientSecret: clientSecret, returnURL: returnURL, onEvent: onEvent, resolve: resolve)
1046
1067
  }
1047
1068
 
1048
1069
  @objc(collectFinancialConnectionsAccounts:resolver:rejecter:)
@@ -1059,9 +1080,19 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
1059
1080
  if let urlScheme = urlScheme {
1060
1081
  returnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
1061
1082
  } else {
1062
- returnURL = nil
1083
+ returnURL = nil
1063
1084
  }
1064
- FinancialConnections.present(withClientSecret: clientSecret, returnURL: returnURL, resolve: resolve)
1085
+
1086
+ var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
1087
+
1088
+ if hasEventListeners {
1089
+ onEvent = { [weak self] event in
1090
+ let mappedEvent = Mappers.financialConnectionsEventToMap(event)
1091
+ self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent)
1092
+ }
1093
+ }
1094
+
1095
+ FinancialConnections.present(withClientSecret: clientSecret, returnURL: returnURL, onEvent: onEvent, resolve: resolve)
1065
1096
  }
1066
1097
 
1067
1098
  @objc(configureOrderTracking:orderIdentifier:webServiceUrl:authenticationToken:resolver:rejecter:)
@@ -1 +1 @@
1
- {"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n PlatformPay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n CreateTokenResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n CustomerSheetInitParams,\n CustomerSheetPresentParams,\n CustomerSheetResult,\n CustomerSheetError,\n StripeError,\n CustomerPaymentOption,\n CustomerAdapter,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n handleNextActionForSetup(\n setupIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionForSetupResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n intentCreationCallback(\n result: PaymentSheet.IntentCreationCallbackParams\n ): void;\n presentPaymentSheet(\n options: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n isPlatformPaySupported(params: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n }): Promise<boolean>;\n createPlatformPayPaymentMethod(\n params: PlatformPay.PaymentMethodParams,\n usesDeprecatedTokenFlow: boolean\n ): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;\n dismissPlatformPay(): Promise<boolean>;\n updatePlatformPaySheet(\n summaryItems: Array<PlatformPay.CartSummaryItem>,\n shippingMethods: Array<PlatformPay.ShippingMethod>,\n errors: Array<PlatformPay.ApplePaySheetError>\n ): Promise<void>;\n confirmPlatformPay(\n clientSecret: string,\n params: PlatformPay.ConfirmParams,\n isPaymentIntent: boolean\n ): Promise<\n PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult\n >;\n configureOrderTracking(\n orderTypeIdentifier: string,\n orderIdentifier: string,\n webServiceUrl: string,\n authenticationToken: string\n ): Promise<void>;\n initCustomerSheet(\n params: CustomerSheetInitParams,\n customerAdapterOverrides: { [Property in keyof CustomerAdapter]: boolean }\n ): Promise<{ error?: StripeError<CustomerSheetError> }>;\n presentCustomerSheet(\n params: CustomerSheetPresentParams\n ): Promise<CustomerSheetResult>;\n retrieveCustomerSheetPaymentOptionSelection(): Promise<CustomerSheetResult>;\n customerAdapterFetchPaymentMethodsCallback(\n paymentMethods: Array<object>\n ): Promise<void>;\n customerAdapterAttachPaymentMethodCallback(\n paymentMethod: object\n ): Promise<void>;\n customerAdapterDetachPaymentMethodCallback(\n paymentMethod: object\n ): Promise<void>;\n customerAdapterSetSelectedPaymentOptionCallback(): Promise<void>;\n customerAdapterFetchSelectedPaymentOptionCallback(\n paymentOption: CustomerPaymentOption | null\n ): Promise<void>;\n customerAdapterSetupIntentClientSecretForCustomerAttachCallback(\n clientSecret: String\n ): Promise<void>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"],"mappings":"gFAAA,yCA0JA,GAAQA,UAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,aAErBA,SAAS"}
1
+ {"version":3,"names":["StripeSdk","NativeModules"],"sources":["NativeStripeSdk.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n PlatformPay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n HandleNextActionForSetupResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n CreateTokenResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n CustomerSheetInitParams,\n CustomerSheetPresentParams,\n CustomerSheetResult,\n CustomerSheetError,\n StripeError,\n CustomerPaymentOption,\n CustomerAdapter,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n handleNextActionForSetup(\n setupIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionForSetupResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n intentCreationCallback(\n result: PaymentSheet.IntentCreationCallbackParams\n ): void;\n presentPaymentSheet(\n options: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: Omit<PaymentMethod.CollectBankAccountParams, 'onEvent'>\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n isPlatformPaySupported(params: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n }): Promise<boolean>;\n createPlatformPayPaymentMethod(\n params: PlatformPay.PaymentMethodParams,\n usesDeprecatedTokenFlow: boolean\n ): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;\n dismissPlatformPay(): Promise<boolean>;\n updatePlatformPaySheet(\n summaryItems: Array<PlatformPay.CartSummaryItem>,\n shippingMethods: Array<PlatformPay.ShippingMethod>,\n errors: Array<PlatformPay.ApplePaySheetError>\n ): Promise<void>;\n confirmPlatformPay(\n clientSecret: string,\n params: PlatformPay.ConfirmParams,\n isPaymentIntent: boolean\n ): Promise<\n PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult\n >;\n configureOrderTracking(\n orderTypeIdentifier: string,\n orderIdentifier: string,\n webServiceUrl: string,\n authenticationToken: string\n ): Promise<void>;\n initCustomerSheet(\n params: CustomerSheetInitParams,\n customerAdapterOverrides: { [Property in keyof CustomerAdapter]: boolean }\n ): Promise<{ error?: StripeError<CustomerSheetError> }>;\n presentCustomerSheet(\n params: CustomerSheetPresentParams\n ): Promise<CustomerSheetResult>;\n retrieveCustomerSheetPaymentOptionSelection(): Promise<CustomerSheetResult>;\n customerAdapterFetchPaymentMethodsCallback(\n paymentMethods: Array<object>\n ): Promise<void>;\n customerAdapterAttachPaymentMethodCallback(\n paymentMethod: object\n ): Promise<void>;\n customerAdapterDetachPaymentMethodCallback(\n paymentMethod: object\n ): Promise<void>;\n customerAdapterSetSelectedPaymentOptionCallback(): Promise<void>;\n customerAdapterFetchSelectedPaymentOptionCallback(\n paymentOption: CustomerPaymentOption | null\n ): Promise<void>;\n customerAdapterSetupIntentClientSecretForCustomerAttachCallback(\n clientSecret: String\n ): Promise<void>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"],"mappings":"gFAAA,yCA0JA,GAAQA,UAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,aAErBA,SAAS"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AddToWalletButtonNative","requireNativeComponent","AddToWalletButton","onComplete","props","value","nativeEvent"],"sources":["AddToWalletButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/static/pay/issuers/apis/push-provisioning/android/downloads/flutter/2022_googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // Optional, only for Android and only for cards that are in the \"yellow path\" (as defined by Google- https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#resolving_yellow_path). Obtain this value via the `isCardInWallet` method.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"],"mappings":"wXAAA,oDACA,yCAOsB,kIAQtB,GAAMA,wBAAuB,CAC3B,GAAAC,mCAAsB,EAAM,mBAAmB,CAAC,CAgE3C,QAASC,kBAAiB,MAAkC,IAA/BC,WAAU,MAAVA,UAAU,CAAKC,KAAK,uDACtD,MACE,8BAAC,uBAAuB,0BAClBA,KAAK,EACT,gBAAgB,CAAE,0BAChBC,KAEE,QACCF,WAAU,CAACE,KAAK,CAACC,WAAW,CAAC,EAAC,6EACnC,CAEN"}
1
+ {"version":3,"names":["AddToWalletButtonNative","requireNativeComponent","AddToWalletButton","onComplete","props","value","nativeEvent"],"sources":["AddToWalletButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/static/pay/issuers/apis/push-provisioning/android/downloads/flutter/2022_googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // Optional, only for Android and only for cards that are in the \"yellow path\" (as defined by Google- https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#resolving_yellow_path). Obtain this value via the `isCardInWallet` method.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"],"mappings":"wXAAA,oDACA,yCAOsB,qIAQtB,GAAMA,wBAAuB,CAC3B,GAAAC,mCAAsB,EAAM,mBAAmB,CAAC,CAgE3C,QAASC,kBAAiB,MAAkC,IAA/BC,WAAU,MAAVA,UAAU,CAAKC,KAAK,uDACtD,MACE,8BAAC,uBAAuB,0BAClBA,KAAK,EACT,gBAAgB,CAAE,0BAChBC,KAEE,QACCF,WAAU,CAACE,KAAK,CAACC,WAAW,CAAC,EAAC,6EACnC,CAEN"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:76,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:76,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddressSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */\n presentationStyle?:\n | 'fullscreen'\n | 'popover'\n | 'pageSheet'\n | 'formSheet'\n | 'automatic'\n | 'overFullScreen';\n /** Controls how the modal animates. iOS only. */\n animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** The values to prepopulate the sheet's fields with. */\n defaultValues?: AddressDetails;\n /** Configuration for additional fields besides the physical address */\n additionalFields?: {\n /** Determines whether the phone number is hidden, required, or optional. Defaults to hidden. */\n phoneNumber?: 'hidden' | 'optional' | 'required';\n /** The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed. */\n checkboxLabel?: string;\n };\n /** A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. */\n allowedCountries?: Array<string>;\n /** A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. */\n autocompleteCountries?: Array<string>;\n /** The title of the primary button displayed at the bottom of the screen. Defaults to \"Save Address\". */\n primaryButtonTitle?: string;\n /** Title displayed at the top of the sheet. Defaults to \"Address\". */\n sheetTitle?: string;\n /** Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. */\n googlePlacesApiKey?: string;\n /** Called when the user submits their information */\n onSubmit: (result: CollectAddressResult) => void;\n /** Called when the user taps the button to close the sheet before submitting their information, or when an error occurs. */\n onError: (error: StripeError<AddressSheetError>) => void;\n}\n\nexport type CollectAddressResult = Required<AddressDetails>;\n\n/**\n *\n *\n * @example\n * ```ts\n * <AddressSheet\n *\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddressSheet({ onSubmit, onError, ...props }: Props) {\n return (\n <AddressSheetNative\n {...props}\n onSubmitAction={(value: NativeSyntheticEvent<CollectAddressResult>) =>\n onSubmit(value.nativeEvent)\n }\n onErrorAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<AddressSheetError>;\n }>\n ) => onError(value.nativeEvent.error)}\n />\n );\n}\n"],"mappings":"8WAAA,oDACA,yCAIsB,qIAQtB,GAAMA,mBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,QAASC,aAAY,MAAyC,IAAtCC,SAAQ,MAARA,QAAQ,CAAEC,OAAO,MAAPA,OAAO,CAAKC,KAAK,uDACxD,MACE,8BAAC,kBAAkB,0BACbA,KAAK,EACT,cAAc,CAAE,wBAACC,KAAiD,QAChEH,SAAQ,CAACG,KAAK,CAACC,WAAW,CAAC,EAC5B,CACD,aAAa,CAAE,uBACbD,KAEE,QACCF,QAAO,CAACE,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,EAAC,6EACtC,CAEN"}
1
+ {"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */\n presentationStyle?:\n | 'fullscreen'\n | 'popover'\n | 'pageSheet'\n | 'formSheet'\n | 'automatic'\n | 'overFullScreen';\n /** Controls how the modal animates. iOS only. */\n animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** The values to prepopulate the sheet's fields with. */\n defaultValues?: AddressDetails;\n /** Configuration for additional fields besides the physical address */\n additionalFields?: {\n /** Determines whether the phone number is hidden, required, or optional. Defaults to hidden. */\n phoneNumber?: 'hidden' | 'optional' | 'required';\n /** The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed. */\n checkboxLabel?: string;\n };\n /** A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. */\n allowedCountries?: Array<string>;\n /** A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. */\n autocompleteCountries?: Array<string>;\n /** The title of the primary button displayed at the bottom of the screen. Defaults to \"Save Address\". */\n primaryButtonTitle?: string;\n /** Title displayed at the top of the sheet. Defaults to \"Address\". */\n sheetTitle?: string;\n /** Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. */\n googlePlacesApiKey?: string;\n /** Called when the user submits their information */\n onSubmit: (result: CollectAddressResult) => void;\n /** Called when the user taps the button to close the sheet before submitting their information, or when an error occurs. */\n onError: (error: StripeError<AddressSheetError>) => void;\n}\n\nexport type CollectAddressResult = Required<AddressDetails>;\n\n/**\n *\n *\n * @example\n * ```ts\n * <AddressSheet\n *\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddressSheet({ onSubmit, onError, ...props }: Props) {\n return (\n <AddressSheetNative\n {...props}\n onSubmitAction={(value: NativeSyntheticEvent<CollectAddressResult>) =>\n onSubmit(value.nativeEvent)\n }\n onErrorAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<AddressSheetError>;\n }>\n ) => onError(value.nativeEvent.error)}\n />\n );\n}\n"],"mappings":"8WAAA,oDACA,yCAIsB,wIAQtB,GAAMA,mBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,QAASC,aAAY,MAAyC,IAAtCC,SAAQ,MAARA,QAAQ,CAAEC,OAAO,MAAPA,OAAO,CAAKC,KAAK,uDACxD,MACE,8BAAC,kBAAkB,0BACbA,KAAK,EACT,cAAc,CAAE,wBAACC,KAAiD,QAChEH,SAAQ,CAACG,KAAK,CAACC,WAAW,CAAC,EAC5B,CACD,aAAa,CAAE,uBACbD,KAEE,QACCF,QAAO,CAACE,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,EAAC,6EACtC,CAEN"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AuBECSDebitFormNative","requireNativeComponent","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"sources":["AuBECSDebitForm.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"],"mappings":"oXAAA,oDACA,yCAKsB,0JAGtB,GAAMA,sBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBAAiB,CAClB,CA4BI,QAASC,gBAAe,MAKrB,IAJRC,WAAU,MAAVA,UAAU,CACVC,WAAW,MAAXA,WAAW,CACXC,SAAS,MAATA,SAAS,CACNC,KAAK,uDAER,MACE,8BAAC,qBAAqB,wBACpB,gBAAgB,CAAE,0BAACC,KAAK,QAAKJ,WAAU,CAACI,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3D,WAAW,CAAEJ,WAAY,CACzB,SAAS,kBAAOC,SAAS,CAAG,EACxBC,KAAK,8EACT,CAEN"}
1
+ {"version":3,"names":["AuBECSDebitFormNative","requireNativeComponent","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"sources":["AuBECSDebitForm.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"],"mappings":"oXAAA,oDACA,yCAKsB,6JAGtB,GAAMA,sBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBAAiB,CAClB,CA4BI,QAASC,gBAAe,MAKrB,IAJRC,WAAU,MAAVA,UAAU,CACVC,WAAW,MAAXA,WAAW,CACXC,SAAS,MAATA,SAAS,CACNC,KAAK,uDAER,MACE,8BAAC,qBAAqB,wBACpB,gBAAgB,CAAE,0BAACC,KAAK,QAAKJ,WAAU,CAACI,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3D,WAAW,CAAEJ,WAAY,CACzB,SAAS,kBAAOC,SAAS,CAAG,EACxBC,KAAK,8EACT,CAEN"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;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] \u26A0\uFE0F 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?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(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 _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,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}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:7}}));});exports.CardField=CardField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;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] \u26A0\uFE0F 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?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(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 _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,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}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:7}}));});exports.CardField=CardField;
2
2
  //# sourceMappingURL=CardField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CardFieldNative","requireNativeComponent","CardField","forwardRef","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","UIManager","dispatchViewManagerCommand","findNodeHandle","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sources":["CardField.tsx"],"sourcesContent":["import type { CardFieldInput, CardBrand } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. Defaults to true.*/\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n /** Applies a disabled state such that user input is not accepted. Defaults to false. */\n disabled?: boolean;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /** The list of preferred networks that should be used to process payments made with a co-branded card.\n * This value will only be used if your user hasn't selected a network themselves. */\n preferredNetworks?: Array<CardBrand>;\n /** The account (if any) for which the funds of the intent are intended. */\n onBehalfOf?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"],"mappings":"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"}
1
+ {"version":3,"names":["CardFieldNative","requireNativeComponent","CardField","forwardRef","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","UIManager","dispatchViewManagerCommand","findNodeHandle","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sources":["CardField.tsx"],"sourcesContent":["import type { CardFieldInput, CardBrand } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. Defaults to true.*/\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n /** Applies a disabled state such that user input is not accepted. Defaults to false. */\n disabled?: boolean;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /** The list of preferred networks that should be used to process payments made with a co-branded card.\n * This value will only be used if your user hasn't selected a network themselves. */\n preferredNetworks?: Array<CardBrand>;\n /** The account (if any) for which the funds of the intent are intended. */\n onBehalfOf?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(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 _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,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},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:168,columnNumber:7}}));});exports.CardForm=CardForm;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(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 _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,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},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:168,columnNumber:7}}));});exports.CardForm=CardForm;
2
2
  //# sourceMappingURL=CardForm.js.map