@stripe/stripe-react-native 0.64.0 → 0.65.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 (168) hide show
  1. package/android/.idea/AndroidProjectSystem.xml +6 -0
  2. package/android/.idea/caches/deviceStreaming.xml +835 -0
  3. package/android/.idea/compiler.xml +6 -0
  4. package/android/.idea/gradle.xml +17 -0
  5. package/android/.idea/migrations.xml +10 -0
  6. package/android/.idea/misc.xml +10 -0
  7. package/android/.idea/runConfigurations.xml +17 -0
  8. package/android/.idea/vcs.xml +6 -0
  9. package/android/build.gradle +2 -2
  10. package/android/detekt/detekt-baseline.xml +146 -0
  11. package/android/detekt/detekt.gradle +45 -0
  12. package/android/detekt/detekt.yml +722 -0
  13. package/android/gradle.properties +1 -1
  14. package/android/local.properties +8 -0
  15. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +0 -1
  16. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +2 -3
  17. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +76 -4
  18. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +0 -4
  19. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +36 -0
  20. package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
  21. package/ios/Mappers.swift +0 -5
  22. package/ios/PaymentMethodMessagingElementConfig.swift +6 -3
  23. package/ios/PaymentMethodMessagingElementView.swift +19 -0
  24. package/ios/StripeSdkImpl.swift +0 -92
  25. package/jest/mock.js +1 -0
  26. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  27. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  28. package/lib/commonjs/components/AddressSheet.js +1 -1
  29. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  30. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  31. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  32. package/lib/commonjs/components/CardField.js +1 -1
  33. package/lib/commonjs/components/CardField.js.map +1 -1
  34. package/lib/commonjs/components/CardForm.js +1 -1
  35. package/lib/commonjs/components/CardForm.js.map +1 -1
  36. package/lib/commonjs/components/PaymentMethodMessagingElement.js +2 -0
  37. package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -0
  38. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  39. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  40. package/lib/commonjs/components/StripeContainer.js +1 -1
  41. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  42. package/lib/commonjs/connect/Components.js +1 -1
  43. package/lib/commonjs/connect/Components.js.map +1 -1
  44. package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
  45. package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
  46. package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
  47. package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
  48. package/lib/commonjs/connect/ModalCloseButton.js +1 -1
  49. package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
  50. package/lib/commonjs/connect/NavigationBar.js +1 -1
  51. package/lib/commonjs/connect/NavigationBar.js.map +1 -1
  52. package/lib/commonjs/helpers.js +1 -1
  53. package/lib/commonjs/hooks/useCheckout.js +2 -0
  54. package/lib/commonjs/hooks/useCheckout.js.map +1 -0
  55. package/lib/commonjs/hooks/useOnramp.js +1 -1
  56. package/lib/commonjs/hooks/useOnramp.js.map +1 -1
  57. package/lib/commonjs/index.js +1 -1
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
  60. package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
  61. package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
  62. package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
  63. package/lib/commonjs/specs/NativeCardField.js +1 -1
  64. package/lib/commonjs/specs/NativeCardField.js.map +1 -1
  65. package/lib/commonjs/specs/NativeCardForm.js +1 -1
  66. package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
  67. package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
  68. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  69. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  70. package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
  71. package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
  72. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
  73. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -1
  74. package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
  75. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  76. package/lib/commonjs/types/Checkout.js +2 -0
  77. package/lib/commonjs/types/Checkout.js.map +1 -0
  78. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  79. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  80. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  81. package/lib/module/components/AddToWalletButton.js +1 -1
  82. package/lib/module/components/AddToWalletButton.js.map +1 -1
  83. package/lib/module/components/AddressSheet.js +1 -1
  84. package/lib/module/components/AddressSheet.js.map +1 -1
  85. package/lib/module/components/AuBECSDebitForm.js +1 -1
  86. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  87. package/lib/module/components/CardField.js +1 -1
  88. package/lib/module/components/CardField.js.map +1 -1
  89. package/lib/module/components/CardForm.js +1 -1
  90. package/lib/module/components/CardForm.js.map +1 -1
  91. package/lib/module/components/PaymentMethodMessagingElement.js +2 -0
  92. package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -0
  93. package/lib/module/components/PlatformPayButton.js +1 -1
  94. package/lib/module/components/PlatformPayButton.js.map +1 -1
  95. package/lib/module/components/StripeContainer.js +1 -1
  96. package/lib/module/components/StripeContainer.js.map +1 -1
  97. package/lib/module/connect/Components.js +1 -1
  98. package/lib/module/connect/Components.js.map +1 -1
  99. package/lib/module/connect/ConnectComponentsProvider.js +1 -1
  100. package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
  101. package/lib/module/connect/EmbeddedComponent.js +1 -1
  102. package/lib/module/connect/EmbeddedComponent.js.map +1 -1
  103. package/lib/module/connect/ModalCloseButton.js +1 -1
  104. package/lib/module/connect/ModalCloseButton.js.map +1 -1
  105. package/lib/module/connect/NavigationBar.js +1 -1
  106. package/lib/module/connect/NavigationBar.js.map +1 -1
  107. package/lib/module/helpers.js +1 -1
  108. package/lib/module/hooks/useCheckout.js +2 -0
  109. package/lib/module/hooks/useCheckout.js.map +1 -0
  110. package/lib/module/hooks/useOnramp.js +1 -1
  111. package/lib/module/hooks/useOnramp.js.map +1 -1
  112. package/lib/module/index.js +1 -1
  113. package/lib/module/index.js.map +1 -1
  114. package/lib/module/specs/NativeAddToWalletButton.js +1 -1
  115. package/lib/module/specs/NativeAddressSheet.js +1 -1
  116. package/lib/module/specs/NativeApplePayButton.js +1 -1
  117. package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
  118. package/lib/module/specs/NativeCardField.js +1 -1
  119. package/lib/module/specs/NativeCardField.js.map +1 -1
  120. package/lib/module/specs/NativeCardForm.js +1 -1
  121. package/lib/module/specs/NativeCardForm.js.map +1 -1
  122. package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
  123. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  124. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  125. package/lib/module/specs/NativeGooglePayButton.js +1 -1
  126. package/lib/module/specs/NativeNavigationBar.js +1 -1
  127. package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
  128. package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -1
  129. package/lib/module/specs/NativeStripeContainer.js +1 -1
  130. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  131. package/lib/module/types/Checkout.js +2 -0
  132. package/lib/module/types/Checkout.js.map +1 -0
  133. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  134. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  135. package/lib/module/types/PaymentSheet.js.map +1 -1
  136. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts +41 -0
  137. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts.map +1 -0
  138. package/lib/typescript/src/hooks/useCheckout.d.ts +21 -0
  139. package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -0
  140. package/lib/typescript/src/hooks/useOnramp.d.ts +1 -0
  141. package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
  142. package/lib/typescript/src/index.d.ts +3 -0
  143. package/lib/typescript/src/index.d.ts.map +1 -1
  144. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +1 -6
  145. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -1
  146. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +13 -0
  147. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  148. package/lib/typescript/src/types/Checkout.d.ts +336 -0
  149. package/lib/typescript/src/types/Checkout.d.ts.map +1 -0
  150. package/lib/typescript/src/types/PaymentMethod.d.ts +1 -5
  151. package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
  152. package/lib/typescript/src/types/PaymentSheet.d.ts +22 -6
  153. package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
  154. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +16 -1
  155. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -1
  156. package/package.json +8 -5
  157. package/src/components/PaymentMethodMessagingElement.tsx +109 -0
  158. package/src/hooks/useCheckout.tsx +168 -0
  159. package/src/hooks/useOnramp.tsx +9 -3
  160. package/src/index.tsx +4 -0
  161. package/src/specs/NativePaymentMethodMessagingElement.ts +0 -7
  162. package/src/specs/NativeStripeSdkModule.ts +50 -0
  163. package/src/types/Checkout.ts +377 -0
  164. package/src/types/PaymentMethod.ts +0 -6
  165. package/src/types/PaymentSheet.ts +29 -6
  166. package/src/types/components/PaymentMethodMessagingElementComponent.tsx +17 -1
  167. package/stripe-react-native.podspec +8 -8
  168. package/android/spotless.gradle +0 -19
@@ -3,4 +3,4 @@ StripeSdk_compileSdkVersion=30
3
3
  StripeSdk_targetSdkVersion=28
4
4
  StripeSdk_minSdkVersion=21
5
5
  # Keep StripeSdk_stripeVersion in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/android/gradle.properties
6
- StripeSdk_stripeVersion=23.4.+
6
+ StripeSdk_stripeVersion=23.6.+
@@ -0,0 +1,8 @@
1
+ ## This file must *NOT* be checked into Version Control Systems,
2
+ # as it contains information specific to your local configuration.
3
+ #
4
+ # Location of the SDK. This is only used by Gradle.
5
+ # For customization when using a Version Control System, please read the
6
+ # header note.
7
+ #Tue Jul 29 21:50:46 PDT 2025
8
+ sdk.dir=/Users/cttsai/Library/Android/sdk
@@ -353,7 +353,6 @@ class PaymentLauncherManager(
353
353
  StripeIntent.NextActionType.AlipayRedirect,
354
354
  StripeIntent.NextActionType.BlikAuthorize,
355
355
  StripeIntent.NextActionType.WeChatPayRedirect,
356
- StripeIntent.NextActionType.UpiAwaitNotification,
357
356
  StripeIntent.NextActionType.CashAppRedirect,
358
357
  StripeIntent.NextActionType.SwishRedirect,
359
358
  StripeIntent.NextActionType.DisplayPromptPayDetails,
@@ -77,14 +77,13 @@ private fun parseFont(
77
77
  "family",
78
78
  context,
79
79
  )
80
- val scaleFactor = map.getDoubleOrNull("scale") ?: 1.0
81
- val textSize: Double = 16 * scaleFactor
80
+ val size = map.getDoubleOrNull("size") ?: 16.0
82
81
 
83
82
  val font =
84
83
  PaymentMethodMessagingElement.Appearance
85
84
  .Font()
86
85
  .fontFamily(fontFamily)
87
- .fontSizeSp(textSize.toFloat())
86
+ .fontSizeSp(size.toFloat())
88
87
 
89
88
  return font
90
89
  }
@@ -33,6 +33,8 @@ import com.reactnativestripesdk.utils.ConfirmPaymentErrorType
33
33
  import com.reactnativestripesdk.utils.CreateTokenErrorType
34
34
  import com.reactnativestripesdk.utils.ErrorType
35
35
  import com.reactnativestripesdk.utils.GooglePayErrorType
36
+ import com.reactnativestripesdk.utils.RetrievePaymentIntentErrorType
37
+ import com.reactnativestripesdk.utils.RetrieveSetupIntentErrorType
36
38
  import com.reactnativestripesdk.utils.StripeUIManager
37
39
  import com.reactnativestripesdk.utils.createCanAddCardResult
38
40
  import com.reactnativestripesdk.utils.createError
@@ -60,6 +62,7 @@ import com.stripe.android.PaymentConfiguration
60
62
  import com.stripe.android.Stripe
61
63
  import com.stripe.android.core.ApiVersion
62
64
  import com.stripe.android.core.AppInfo
65
+ import com.stripe.android.core.reactnative.ReactNativeAnalytics
63
66
  import com.stripe.android.core.reactnative.ReactNativeSdkInternal
64
67
  import com.stripe.android.customersheet.CustomerSheet
65
68
  import com.stripe.android.googlepaylauncher.GooglePayLauncher
@@ -223,6 +226,7 @@ class StripeSdkModule(
223
226
  )
224
227
  }
225
228
 
229
+ @SuppressLint("RestrictedApi")
226
230
  @ReactMethod
227
231
  override fun initialise(
228
232
  params: ReadableMap,
@@ -252,6 +256,11 @@ class StripeSdkModule(
252
256
 
253
257
  PaymentConfiguration.init(reactApplicationContext, publishableKey, stripeAccountId)
254
258
 
259
+ ReactNativeAnalytics.isNewArchitecture = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
260
+ ReactNativeAnalytics.reactNativeVersion =
261
+ with(ReactNativeVersion.VERSION) {
262
+ "${get("major")}.${get("minor")}.${get("patch")}"
263
+ }
255
264
  preventActivityRecreation()
256
265
  setupComposeCompatView()
257
266
 
@@ -689,8 +698,12 @@ class StripeSdkModule(
689
698
  promise: Promise,
690
699
  ) {
691
700
  CoroutineScope(Dispatchers.IO).launch {
692
- val paymentIntent = stripe.retrievePaymentIntentSynchronous(clientSecret)
693
- promise.resolve(createResult("paymentIntent", mapFromPaymentIntentResult(paymentIntent)))
701
+ try {
702
+ val paymentIntent = stripe.retrievePaymentIntentSynchronous(clientSecret)
703
+ promise.resolve(createResult("paymentIntent", mapFromPaymentIntentResult(paymentIntent)))
704
+ } catch (e: Exception) {
705
+ promise.resolve(createError(RetrievePaymentIntentErrorType.Unknown.toString(), e))
706
+ }
694
707
  }
695
708
  }
696
709
 
@@ -700,8 +713,12 @@ class StripeSdkModule(
700
713
  promise: Promise,
701
714
  ) {
702
715
  CoroutineScope(Dispatchers.IO).launch {
703
- val setupIntent = stripe.retrieveSetupIntentSynchronous(clientSecret)
704
- promise.resolve(createResult("setupIntent", mapFromSetupIntentResult(setupIntent)))
716
+ try {
717
+ val setupIntent = stripe.retrieveSetupIntentSynchronous(clientSecret)
718
+ promise.resolve(createResult("setupIntent", mapFromSetupIntentResult(setupIntent)))
719
+ } catch (e: Exception) {
720
+ promise.resolve(createError(RetrieveSetupIntentErrorType.Unknown.toString(), e))
721
+ }
705
722
  }
706
723
  }
707
724
 
@@ -1678,6 +1695,61 @@ class StripeSdkModule(
1678
1695
  // noop, iOS only.
1679
1696
  }
1680
1697
 
1698
+ // Checkout Session stubs — real implementations in a future PR.
1699
+
1700
+ override fun initCheckoutSession(clientSecret: String, configuration: ReadableMap, promise: Promise) {
1701
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1702
+ }
1703
+
1704
+ override fun checkoutUpdateShippingAddress(
1705
+ sessionKey: String,
1706
+ address: ReadableMap,
1707
+ name: String?,
1708
+ phone: String?,
1709
+ promise: Promise,
1710
+ ) {
1711
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1712
+ }
1713
+
1714
+ override fun checkoutUpdateBillingAddress(
1715
+ sessionKey: String,
1716
+ address: ReadableMap,
1717
+ name: String?,
1718
+ phone: String?,
1719
+ promise: Promise,
1720
+ ) {
1721
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1722
+ }
1723
+
1724
+ override fun checkoutApplyPromotionCode(sessionKey: String, code: String, promise: Promise) {
1725
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1726
+ }
1727
+
1728
+ override fun checkoutRemovePromotionCode(sessionKey: String, promise: Promise) {
1729
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1730
+ }
1731
+
1732
+ override fun checkoutUpdateLineItemQuantity(
1733
+ sessionKey: String,
1734
+ lineItemId: String,
1735
+ quantity: Double,
1736
+ promise: Promise,
1737
+ ) {
1738
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1739
+ }
1740
+
1741
+ override fun checkoutSelectShippingOption(sessionKey: String, id: String, promise: Promise) {
1742
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1743
+ }
1744
+
1745
+ override fun checkoutUpdateTaxId(sessionKey: String, type: String, value: String, promise: Promise) {
1746
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1747
+ }
1748
+
1749
+ override fun checkoutRefresh(sessionKey: String, promise: Promise) {
1750
+ promise.reject("NotImplemented", "Checkout is not yet implemented on Android")
1751
+ }
1752
+
1681
1753
  /**
1682
1754
  * Safely get and cast the current activity as an AppCompatActivity. If that fails, the promise
1683
1755
  * provided will be resolved with an error message instructing the user to retry the method.
@@ -144,7 +144,6 @@ internal fun mapPaymentMethodType(type: PaymentMethod.Type?): String =
144
144
  PaymentMethod.Type.Oxxo -> "Oxxo"
145
145
  PaymentMethod.Type.P24 -> "P24"
146
146
  PaymentMethod.Type.SepaDebit -> "SepaDebit"
147
- PaymentMethod.Type.Upi -> "Upi"
148
147
  PaymentMethod.Type.WeChatPay -> "WeChatPay"
149
148
  PaymentMethod.Type.Klarna -> "Klarna"
150
149
  PaymentMethod.Type.USBankAccount -> "USBankAccount"
@@ -176,7 +175,6 @@ internal fun mapToPaymentMethodType(type: String?): PaymentMethod.Type? =
176
175
  "Oxxo" -> PaymentMethod.Type.Oxxo
177
176
  "P24" -> PaymentMethod.Type.P24
178
177
  "SepaDebit" -> PaymentMethod.Type.SepaDebit
179
- "Upi" -> PaymentMethod.Type.Upi
180
178
  "WeChatPay" -> PaymentMethod.Type.WeChatPay
181
179
  "Klarna" -> PaymentMethod.Type.Klarna
182
180
  "USBankAccount" -> PaymentMethod.Type.USBankAccount
@@ -436,7 +434,6 @@ internal fun mapFromPaymentMethod(paymentMethod: PaymentMethod): WritableMap {
436
434
  it.putString("bank", paymentMethod.fpx?.bank)
437
435
  },
438
436
  )
439
- pm.putMap("Upi", Arguments.createMap().also { it.putString("vpa", paymentMethod.upi?.vpa) })
440
437
  pm.putMap(
441
438
  "USBankAccount",
442
439
  Arguments.createMap().also {
@@ -560,7 +557,6 @@ internal fun mapNextAction(
560
557
  NextActionType.CashAppRedirect,
561
558
  NextActionType.BlikAuthorize,
562
559
  NextActionType.UseStripeSdk,
563
- NextActionType.UpiAwaitNotification,
564
560
  NextActionType.DisplayPayNowDetails,
565
561
  NextActionType.DisplayPromptPayDetails,
566
562
  null,
@@ -293,6 +293,42 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
293
293
  @DoNotStrip
294
294
  public abstract void pollAndClearPendingStripeConnectUrls(Promise promise);
295
295
 
296
+ @ReactMethod
297
+ @DoNotStrip
298
+ public abstract void initCheckoutSession(String clientSecret, ReadableMap configuration, Promise promise);
299
+
300
+ @ReactMethod
301
+ @DoNotStrip
302
+ public abstract void checkoutUpdateShippingAddress(String sessionKey, ReadableMap address, @Nullable String name, @Nullable String phone, Promise promise);
303
+
304
+ @ReactMethod
305
+ @DoNotStrip
306
+ public abstract void checkoutUpdateBillingAddress(String sessionKey, ReadableMap address, @Nullable String name, @Nullable String phone, Promise promise);
307
+
308
+ @ReactMethod
309
+ @DoNotStrip
310
+ public abstract void checkoutApplyPromotionCode(String sessionKey, String code, Promise promise);
311
+
312
+ @ReactMethod
313
+ @DoNotStrip
314
+ public abstract void checkoutRemovePromotionCode(String sessionKey, Promise promise);
315
+
316
+ @ReactMethod
317
+ @DoNotStrip
318
+ public abstract void checkoutUpdateLineItemQuantity(String sessionKey, String lineItemId, double quantity, Promise promise);
319
+
320
+ @ReactMethod
321
+ @DoNotStrip
322
+ public abstract void checkoutSelectShippingOption(String sessionKey, String id, Promise promise);
323
+
324
+ @ReactMethod
325
+ @DoNotStrip
326
+ public abstract void checkoutUpdateTaxId(String sessionKey, String type, String value, Promise promise);
327
+
328
+ @ReactMethod
329
+ @DoNotStrip
330
+ public abstract void checkoutRefresh(String sessionKey, Promise promise);
331
+
296
332
  @ReactMethod
297
333
  @DoNotStrip
298
334
  public abstract void addListener(String eventType);
@@ -404,7 +404,7 @@ class PaymentMethodMessagingElementConfigTest {
404
404
  readableMapOf(
405
405
  "font" to
406
406
  readableMapOf(
407
- "scale" to 1.5,
407
+ "size" to 20,
408
408
  ),
409
409
  )
410
410
 
@@ -416,7 +416,7 @@ class PaymentMethodMessagingElementConfigTest {
416
416
  PaymentMethodMessagingElement.Appearance
417
417
  .Font()
418
418
  .fontFamily(null)
419
- .fontSizeSp((16 * 1.5).toFloat())
419
+ .fontSizeSp((20).toFloat())
420
420
  font(font)
421
421
  colors(PaymentMethodMessagingElement.Appearance.Colors())
422
422
  }
@@ -433,7 +433,7 @@ class PaymentMethodMessagingElementConfigTest {
433
433
  "linkTextColor" to "#00FFFF",
434
434
  "font" to
435
435
  readableMapOf(
436
- "scale" to 1.2,
436
+ "size" to 20,
437
437
  ),
438
438
  )
439
439
 
package/ios/Mappers.swift CHANGED
@@ -297,7 +297,6 @@ class Mappers {
297
297
  case STPPaymentMethodType.billie: return "Billie"
298
298
  case STPPaymentMethodType.multibanco: return "Multibanco"
299
299
  case STPPaymentMethodType.OXXO: return "Oxxo"
300
- case STPPaymentMethodType.UPI: return "Upi"
301
300
  case STPPaymentMethodType.afterpayClearpay: return "AfterpayClearpay"
302
301
  case STPPaymentMethodType.klarna: return "Klarna"
303
302
  case STPPaymentMethodType.USBankAccount: return "USBankAccount"
@@ -330,7 +329,6 @@ class Mappers {
330
329
  case "Billie": return STPPaymentMethodType.billie
331
330
  case "Multibanco": return STPPaymentMethodType.multibanco
332
331
  case "Oxxo": return STPPaymentMethodType.OXXO
333
- case "Upi": return STPPaymentMethodType.UPI
334
332
  case "AfterpayClearpay": return STPPaymentMethodType.afterpayClearpay
335
333
  case "Klarna": return STPPaymentMethodType.klarna
336
334
  case "WeChatPay": return STPPaymentMethodType.weChatPay
@@ -701,9 +699,6 @@ class Mappers {
701
699
  "SepaDebit": sepaDebit,
702
700
  "BacsDebit": bacsDebit,
703
701
  "AuBecsDebit": auBECSDebit,
704
- "Upi": [
705
- "vpa": paymentMethod.upi?.vpa
706
- ],
707
702
  "USBankAccount": USBankAccount,
708
703
  ]
709
704
  return method
@@ -29,10 +29,13 @@ internal class PaymentMethodMessagingElementConfig {
29
29
 
30
30
  // Parse font
31
31
  if let fontParams = params["font"] as? NSDictionary {
32
- let scale = fontParams["scale"] as? CGFloat ?? 1
33
- if let fontFamily = fontParams["family"] as? String,
34
- let customFont = UIFont(name: fontFamily, size: UIFont.systemFontSize * scale) {
32
+ let size = fontParams["size"] as? CGFloat
33
+ let family = fontParams["family"] as? String
34
+
35
+ if let family = family, let customFont = UIFont(name: family, size: size ?? UIFont.systemFontSize) {
35
36
  appearance.font = customFont
37
+ } else if let size = size {
38
+ appearance.font = UIFont.systemFont(ofSize: size)
36
39
  }
37
40
  }
38
41
 
@@ -21,6 +21,9 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
21
21
  private var appearanceConfig: PaymentMethodMessagingElement.Appearance?
22
22
  private var lastConfig: NSDictionary?
23
23
 
24
+ // Used to track height updates
25
+ private var previousHeight: CGFloat?
26
+
24
27
  @objc var appearance: NSDictionary? {
25
28
  didSet {
26
29
  if let appearance = appearance {
@@ -67,6 +70,19 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
67
70
  }
68
71
  }
69
72
 
73
+ public override func layoutSubviews() {
74
+ super.layoutSubviews()
75
+
76
+ // Calculate our natural height
77
+ let desiredHeight = systemLayoutSizeFitting(CGSize(width: frame.width, height: UIView.layoutFittingCompressedSize.height)).height
78
+
79
+ // Notify if changed
80
+ if desiredHeight != previousHeight {
81
+ StripeSdkImpl.shared.emitter?.emitPaymentMethodMessagingElementDidUpdateHeight(["height": desiredHeight])
82
+ self.previousHeight = desiredHeight
83
+ }
84
+ }
85
+
70
86
  private func attachPaymentElementIfAvailable() {
71
87
  removePaymentMethodMessagingElement()
72
88
  guard let messagingElement = messagingInstance else {
@@ -76,7 +92,10 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
76
92
  let messagingElementView = messagingElement.view
77
93
  addSubview(messagingElementView)
78
94
  messagingElementView.translatesAutoresizingMaskIntoConstraints = false
95
+ let height = self.messagingInstance?.view.systemLayoutSizeFitting(CGSize(width: self.messagingInstance?.view.bounds.width ?? 0, height: UIView.layoutFittingCompressedSize.height)).height
96
+ self.previousHeight = height ?? 0
79
97
 
98
+ StripeSdkImpl.shared.emitter?.emitPaymentMethodMessagingElementDidUpdateHeight(["height": height ?? 0])
80
99
  NSLayoutConstraint.activate([
81
100
  messagingElementView.topAnchor.constraint(equalTo: topAnchor),
82
101
  messagingElementView.leadingAnchor.constraint(equalTo: leadingAnchor),
@@ -1793,98 +1793,6 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
1793
1793
 
1794
1794
  return coordinator
1795
1795
  }
1796
- #else
1797
- @objc(configureOnramp:resolver:rejecter:)
1798
- public func configureOnramp(config: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1799
- resolveWithCryptoOnrampNotAvailableError(resolve)
1800
- }
1801
-
1802
- @objc(hasLinkAccount:resolver:rejecter:)
1803
- public func hasLinkAccount(email: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1804
- resolveWithCryptoOnrampNotAvailableError(resolve)
1805
- }
1806
-
1807
- @objc(registerLinkUser:resolver:rejecter:)
1808
- public func registerLinkUser(info: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1809
- resolveWithCryptoOnrampNotAvailableError(resolve)
1810
- }
1811
-
1812
- @objc(authenticateUserWithToken:resolver:rejecter:)
1813
- public func authenticateUserWithToken(
1814
- _ linkAuthTokenClientSecret: String,
1815
- resolver resolve: @escaping RCTPromiseResolveBlock,
1816
- rejecter reject: @escaping RCTPromiseRejectBlock
1817
- ) {
1818
- resolveWithCryptoOnrampNotAvailableError(resolve)
1819
- }
1820
-
1821
- @objc(registerWalletAddress:network:resolver:rejecter:)
1822
- public func registerWalletAddress(address: String, network: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1823
- resolveWithCryptoOnrampNotAvailableError(resolve)
1824
- }
1825
-
1826
- @objc(attachKycInfo:resolver:rejecter:)
1827
- public func attachKycInfo(info: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1828
- resolveWithCryptoOnrampNotAvailableError(resolve)
1829
- }
1830
-
1831
- @objc(presentKycInfoVerification:resolver:rejecter:)
1832
- public func presentKycInfoVerification(
1833
- updatedAddressDictionary: NSDictionary?,
1834
- resolver resolve: @escaping RCTPromiseResolveBlock,
1835
- rejecter reject: @escaping RCTPromiseRejectBlock
1836
- ) {
1837
- resolveWithCryptoOnrampNotAvailableError(resolve)
1838
- }
1839
-
1840
- @objc(updatePhoneNumber:resolver:rejecter:)
1841
- public func updatePhoneNumber(phone: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1842
- resolveWithCryptoOnrampNotAvailableError(resolve)
1843
- }
1844
-
1845
- @objc(logout:rejecter:)
1846
- public func logout(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1847
- resolveWithCryptoOnrampNotAvailableError(resolve)
1848
- }
1849
-
1850
- @objc(verifyIdentity:rejecter:)
1851
- public func verifyIdentity(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1852
- resolveWithCryptoOnrampNotAvailableError(resolve)
1853
- }
1854
-
1855
- @objc(collectPaymentMethod:platformPayParams:resolver:rejecter:)
1856
- public func collectPaymentMethod(paymentMethod: String, platformPayParams: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1857
- resolveWithCryptoOnrampNotAvailableError(resolve)
1858
- }
1859
-
1860
- @objc(createCryptoPaymentToken:rejecter:)
1861
- public func createCryptoPaymentToken(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1862
- resolveWithCryptoOnrampNotAvailableError(resolve)
1863
- }
1864
-
1865
- @objc(performCheckout:resolver:rejecter:)
1866
- public func performCheckout(onrampSessionId: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1867
- resolveWithCryptoOnrampNotAvailableError(resolve)
1868
- }
1869
-
1870
- @objc(provideCheckoutClientSecret:)
1871
- public func provideCheckoutClientSecret(clientSecret: String?) {
1872
- // no-op when Onramp is unavailable
1873
- }
1874
-
1875
- @objc(onrampAuthorize:resolver:rejecter:)
1876
- public func onrampAuthorize(linkAuthIntentId: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1877
- resolveWithCryptoOnrampNotAvailableError(resolve)
1878
- }
1879
-
1880
- @objc(getCryptoTokenDisplayData:resolver:rejecter:)
1881
- public func getCryptoTokenDisplayData(token: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
1882
- resolveWithCryptoOnrampNotAvailableError(resolve)
1883
- }
1884
-
1885
- private func resolveWithCryptoOnrampNotAvailableError(_ resolver: @escaping RCTPromiseResolveBlock) {
1886
- resolver(Errors.createError(ErrorType.Failed, "StripeCryptoOnramp is not available. To enable, add the 'stripe-react-native/Onramp' subspec to your Podfile."))
1887
- }
1888
1796
  #endif
1889
1797
 
1890
1798
  @objc(setFinancialConnectionsForceNativeFlow:resolver:rejecter:)
package/jest/mock.js CHANGED
@@ -374,6 +374,7 @@ module.exports = {
374
374
  GooglePayButton: () => 'GooglePayButton',
375
375
  AddToWalletButton: () => 'AddToWalletButton',
376
376
  PlatformPayButton: () => 'PlatformPayButton',
377
+ PaymentMethodMessagingElement: () => 'PaymentMethodMessagingElementView',
377
378
  useStripe: jest.fn(() => mockFunctions),
378
379
  };
379
380
 
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddToWalletButton.default,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/cttsai/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddToWalletButton.default,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,mFAAAC,SAAA,gBAgEhE,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAF,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAS,GAAA,EAACV,wBAAA,CAAAS,OAAuB,CAAAE,MAAA,CAAAC,MAAA,IAClBL,KAAK,EACTM,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CACdC,KAEE,QACC,CAAAR,UAAU,CAACQ,KAAK,CAACC,WAAW,CAAC,EAAC,EACpC,CAAC,CAEN","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,qFAAAC,SAAA,gBAgEhE,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAF,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAS,GAAA,EAACV,wBAAA,CAAAS,OAAuB,CAAAE,MAAA,CAAAC,MAAA,IAClBL,KAAK,EACTM,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CACdC,KAEE,QACC,CAAAR,UAAU,CAACQ,KAAK,CAACC,WAAW,CAAC,EAAC,EACpC,CAAC,CAEN","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddressSheet.default,Object.assign({},props,{onSubmitAction:function onSubmitAction(event){return onSubmit(event.nativeEvent.result);},onErrorAction:function onErrorAction(event){return onError(event.nativeEvent.error);}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/cttsai/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddressSheet.default,Object.assign({},props,{onSubmitAction:function onSubmitAction(event){return onSubmit(event.nativeEvent.result);},onErrorAction:function onErrorAction(event){return onError(event.nativeEvent.error);}}));}
2
2
  //# sourceMappingURL=AddressSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,8EAAAC,SAAA,wBA4DtD,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAyC,IAAtC,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,CAAAF,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAU,GAAA,EAACX,mBAAA,CAAAU,OAAkB,CAAAE,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAK,QAAK,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC,EAAC,CAC9DC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CAAGH,KAAK,QAAK,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACG,KAAK,CAAC,EAAC,EAC5D,CAAC,CAEN","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,gFAAAC,SAAA,wBA4DtD,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAyC,IAAtC,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,CAAAF,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAU,GAAA,EAACX,mBAAA,CAAAU,OAAkB,CAAAE,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAK,QAAK,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC,EAAC,CAC9DC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CAAGH,KAAK,QAAK,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACG,KAAK,CAAC,EAAC,EAC5D,CAAC,CAEN","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAuBECSDebitForm.default,Object.assign({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/cttsai/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAuBECSDebitForm.default,Object.assign({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,iFAAAC,SAAA,0CA6B5D,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAKrB,IAJR,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACNC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAN,IAAA,CAAAF,SAAA,EAER,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACZ,sBAAA,CAAAW,OAAqB,CAAAE,MAAA,CAAAC,MAAA,EACpBC,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CAAGC,KAAK,QAAK,CAAAV,UAAU,CAACU,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3DV,WAAW,CAAEA,WAAY,CACzBC,SAAS,CAAAK,MAAA,CAAAC,MAAA,IAAON,SAAS,CAAG,EACxBC,KAAK,CACV,CAAC,CAEN","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,mFAAAC,SAAA,0CA6B5D,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAKrB,IAJR,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACNC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAN,IAAA,CAAAF,SAAA,EAER,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACZ,sBAAA,CAAAW,OAAqB,CAAAE,MAAA,CAAAC,MAAA,EACpBC,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CAAGC,KAAK,QAAK,CAAAV,UAAU,CAACU,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3DV,WAAW,CAAEA,WAAY,CACzBC,SAAS,CAAAK,MAAA,CAAAC,MAAA,IAAON,SAAS,CAAG,EACxBC,KAAK,CACV,CAAC,CAEN","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/CardField.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardField=exports.CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,autofocus=_ref.autofocus,postalCodeEnabled=_ref.postalCodeEnabled,disabled=_ref.disabled,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn(`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`);}}onCardChange==null||onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null||onFocus(focusedField);}else{onBlur==null||onBlur();}},[onFocus,onBlur]);var focus=function focus(){_NativeCardField.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardField.Commands.blur(inputRef.current);};var clear=function clear(){_NativeCardField.Commands.clear(inputRef.current);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardField.default,Object.assign({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},autofocus:autofocus!=null?autofocus:false,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,disabled:disabled!=null?disabled:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false},props));});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/cttsai/stripe/stripe-react-native/src/components/CardField.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardField=exports.CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,autofocus=_ref.autofocus,postalCodeEnabled=_ref.postalCodeEnabled,disabled=_ref.disabled,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn(`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`);}}onCardChange==null||onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null||onFocus(focusedField);}else{onBlur==null||onBlur();}},[onFocus,onBlur]);var focus=function focus(){_NativeCardField.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardField.Commands.blur(inputRef.current);};var clear=function clear(){_NativeCardField.Commands.clear(inputRef.current);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardField.default,Object.assign({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},autofocus:autofocus!=null?autofocus:false,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,disabled:disabled!=null?disabled:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false},props));});
2
2
  //# sourceMappingURL=CardField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,+IAAAC,KAAA,MAAAC,YAAA,gFAAAP,wBAAAQ,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAV,uBAAA,UAAAA,wBAAAQ,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAA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[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,+IAAAC,KAAA,MAAAC,YAAA,kFAAAP,wBAAAQ,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAV,uBAAA,UAAAA,wBAAAQ,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAA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runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _NativeCardForm=_interopRequireWildcard(require("../specs/NativeCardForm"));var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled"];var _this=this,_jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/CardForm.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardForm=exports.CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,autofocus=_ref.autofocus,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,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] ⚠️ 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||onFormComplete(data);},[onFormComplete]);var focus=function focus(){_NativeCardForm.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardForm.Commands.blur(inputRef.current);};(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);}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardForm.default,Object.assign({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,autofocus:autofocus!=null?autofocus:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false,disabled:disabled!=null?disabled:false,postalCodeEnabled:true},props));});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _NativeCardForm=_interopRequireWildcard(require("../specs/NativeCardForm"));var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled"];var _this=this,_jsxFileName="/Users/cttsai/stripe/stripe-react-native/src/components/CardForm.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardForm=exports.CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,autofocus=_ref.autofocus,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,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] ⚠️ 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||onFormComplete(data);},[onFormComplete]);var focus=function focus(){_NativeCardForm.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardForm.Commands.blur(inputRef.current);};(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);}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardForm.default,Object.assign({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,autofocus:autofocus!=null?autofocus:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false,disabled:disabled!=null?disabled:false,postalCodeEnabled:true},props));});
2
2
  //# sourceMappingURL=CardForm.js.map