@stripe/stripe-react-native 0.41.0 → 0.43.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 (314) hide show
  1. package/.husky/pre-commit +0 -3
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +3 -0
  4. package/android/.gradle/8.11.1/checksums/checksums.lock +0 -0
  5. package/android/.gradle/8.11.1/checksums/md5-checksums.bin +0 -0
  6. package/android/.gradle/8.11.1/checksums/sha1-checksums.bin +0 -0
  7. package/android/.gradle/8.11.1/executionHistory/executionHistory.lock +0 -0
  8. package/android/.gradle/8.11.1/fileChanges/last-build.bin +0 -0
  9. package/android/.gradle/8.11.1/fileHashes/fileHashes.lock +0 -0
  10. package/android/.gradle/8.11.1/gc.properties +0 -0
  11. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  12. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  13. package/android/.gradle/vcs-1/gc.properties +0 -0
  14. package/android/build.gradle +7 -1
  15. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  16. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  17. package/android/gradle.properties +4 -1
  18. package/android/gradlew +249 -0
  19. package/android/gradlew.bat +92 -0
  20. package/android/spotless.gradle +19 -0
  21. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +30 -34
  22. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +20 -10
  23. package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +12 -13
  24. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +242 -105
  25. package/android/src/main/java/com/reactnativestripesdk/CardFieldViewManager.kt +58 -20
  26. package/android/src/main/java/com/reactnativestripesdk/CardFocusEvent.kt +8 -11
  27. package/android/src/main/java/com/reactnativestripesdk/CardFormCompleteEvent.kt +10 -12
  28. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +135 -87
  29. package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +57 -22
  30. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +53 -23
  31. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +125 -83
  32. package/android/src/main/java/com/reactnativestripesdk/FormCompleteEvent.kt +9 -11
  33. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +16 -9
  34. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +36 -28
  35. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +67 -43
  36. package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +21 -16
  37. package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +101 -56
  38. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +244 -166
  39. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +183 -123
  40. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +181 -57
  41. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +402 -258
  42. package/android/src/main/java/com/reactnativestripesdk/StripeContainerManager.kt +11 -4
  43. package/android/src/main/java/com/reactnativestripesdk/StripeContainerView.kt +5 -1
  44. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +654 -299
  45. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +12 -14
  46. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +42 -37
  47. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetEvent.kt +12 -11
  48. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +29 -29
  49. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +50 -18
  50. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +227 -147
  51. package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +15 -18
  52. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +33 -15
  53. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +63 -37
  54. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent.kt +9 -13
  55. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider.kt +15 -17
  56. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +76 -60
  57. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +71 -47
  58. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +117 -51
  59. package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +4 -3
  60. package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +39 -0
  61. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +337 -250
  62. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -11
  63. package/ios/CustomerSheet/CustomerSheetUtils.swift +3 -1
  64. package/ios/FinancialConnections.swift +18 -2
  65. package/ios/Mappers.swift +23 -0
  66. package/ios/PaymentMethodFactory.swift +31 -29
  67. package/ios/StripeSdk+CustomerSheet.swift +2 -1
  68. package/ios/StripeSdk+PaymentSheet.swift +42 -0
  69. package/ios/StripeSdk.m +2 -0
  70. package/ios/StripeSdk.swift +116 -24
  71. package/lib/commonjs/NativeStripeSdk.js +1 -1
  72. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  73. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  74. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  75. package/lib/commonjs/components/AddressSheet.js +1 -1
  76. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  77. package/lib/commonjs/components/ApplePayButtonNative.js +1 -1
  78. package/lib/commonjs/components/ApplePayButtonNative.js.map +1 -1
  79. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  80. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  81. package/lib/commonjs/components/CardField.js +1 -1
  82. package/lib/commonjs/components/CardField.js.map +1 -1
  83. package/lib/commonjs/components/CardForm.js +1 -1
  84. package/lib/commonjs/components/CardForm.js.map +1 -1
  85. package/lib/commonjs/components/CustomerSheet.js +1 -1
  86. package/lib/commonjs/components/CustomerSheet.js.map +1 -1
  87. package/lib/commonjs/components/GooglePayButtonNative.js +1 -1
  88. package/lib/commonjs/components/GooglePayButtonNative.js.map +1 -1
  89. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  90. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  91. package/lib/commonjs/components/StripeContainer.js +1 -1
  92. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  93. package/lib/commonjs/components/StripeProvider.js +1 -1
  94. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  95. package/lib/commonjs/functions.js +1 -1
  96. package/lib/commonjs/functions.js.map +1 -1
  97. package/lib/commonjs/helpers.js +1 -1
  98. package/lib/commonjs/helpers.js.map +1 -1
  99. package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
  100. package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
  101. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +1 -1
  102. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
  103. package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
  104. package/lib/commonjs/hooks/usePlatformPay.js.map +1 -1
  105. package/lib/commonjs/hooks/useStripe.js +1 -1
  106. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  107. package/lib/commonjs/index.js.map +1 -1
  108. package/lib/commonjs/package.json +1 -0
  109. package/lib/commonjs/plugin/withStripe.js +1 -1
  110. package/lib/commonjs/plugin/withStripe.js.map +1 -1
  111. package/lib/commonjs/types/ApplePay.js.map +1 -1
  112. package/lib/commonjs/types/Common.js +1 -1
  113. package/lib/commonjs/types/Common.js.map +1 -1
  114. package/lib/commonjs/types/CustomerSheet.js.map +1 -1
  115. package/lib/commonjs/types/Errors.js +1 -1
  116. package/lib/commonjs/types/Errors.js.map +1 -1
  117. package/lib/commonjs/types/FinancialConnections.js +1 -1
  118. package/lib/commonjs/types/FinancialConnections.js.map +1 -1
  119. package/lib/commonjs/types/NextAction.js.map +1 -1
  120. package/lib/commonjs/types/PaymentIntent.js +1 -1
  121. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  122. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  123. package/lib/commonjs/types/PaymentSheet.js +1 -1
  124. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  125. package/lib/commonjs/types/PlatformPay.js +1 -1
  126. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  127. package/lib/commonjs/types/PushProvisioning.js +1 -1
  128. package/lib/commonjs/types/PushProvisioning.js.map +1 -1
  129. package/lib/commonjs/types/SetupIntent.js +1 -1
  130. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  131. package/lib/commonjs/types/ThreeDSecure.js +1 -1
  132. package/lib/commonjs/types/ThreeDSecure.js.map +1 -1
  133. package/lib/commonjs/types/Token.js.map +1 -1
  134. package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
  135. package/lib/commonjs/types/components/AuBECSDebitFormComponent.js.map +1 -1
  136. package/lib/commonjs/types/components/CardFieldInput.js +1 -1
  137. package/lib/commonjs/types/components/CardFieldInput.js.map +1 -1
  138. package/lib/commonjs/types/components/CardFormView.js.map +1 -1
  139. package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -1
  140. package/lib/commonjs/types/index.js +1 -1
  141. package/lib/commonjs/types/index.js.map +1 -1
  142. package/lib/module/NativeStripeSdk.js +1 -1
  143. package/lib/module/NativeStripeSdk.js.map +1 -1
  144. package/lib/module/components/AddToWalletButton.js +1 -1
  145. package/lib/module/components/AddToWalletButton.js.map +1 -1
  146. package/lib/module/components/AddressSheet.js +1 -1
  147. package/lib/module/components/AddressSheet.js.map +1 -1
  148. package/lib/module/components/ApplePayButtonNative.js +1 -1
  149. package/lib/module/components/ApplePayButtonNative.js.map +1 -1
  150. package/lib/module/components/AuBECSDebitForm.js +1 -1
  151. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  152. package/lib/module/components/CardField.js +1 -1
  153. package/lib/module/components/CardField.js.map +1 -1
  154. package/lib/module/components/CardForm.js +1 -1
  155. package/lib/module/components/CardForm.js.map +1 -1
  156. package/lib/module/components/CustomerSheet.js +1 -1
  157. package/lib/module/components/CustomerSheet.js.map +1 -1
  158. package/lib/module/components/GooglePayButtonNative.js +1 -1
  159. package/lib/module/components/GooglePayButtonNative.js.map +1 -1
  160. package/lib/module/components/PlatformPayButton.js +1 -1
  161. package/lib/module/components/PlatformPayButton.js.map +1 -1
  162. package/lib/module/components/StripeContainer.js +1 -1
  163. package/lib/module/components/StripeContainer.js.map +1 -1
  164. package/lib/module/components/StripeProvider.js +1 -1
  165. package/lib/module/components/StripeProvider.js.map +1 -1
  166. package/lib/module/functions.js +1 -1
  167. package/lib/module/functions.js.map +1 -1
  168. package/lib/module/helpers.js +1 -1
  169. package/lib/module/helpers.js.map +1 -1
  170. package/lib/module/hooks/useConfirmPayment.js.map +1 -1
  171. package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
  172. package/lib/module/hooks/useFinancialConnectionsSheet.js +1 -1
  173. package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
  174. package/lib/module/hooks/usePaymentSheet.js.map +1 -1
  175. package/lib/module/hooks/usePlatformPay.js.map +1 -1
  176. package/lib/module/hooks/useStripe.js +1 -1
  177. package/lib/module/hooks/useStripe.js.map +1 -1
  178. package/lib/module/index.js.map +1 -1
  179. package/lib/module/package.json +1 -0
  180. package/lib/module/plugin/withStripe.js +1 -1
  181. package/lib/module/plugin/withStripe.js.map +1 -1
  182. package/lib/module/types/ApplePay.js.map +1 -1
  183. package/lib/module/types/Common.js +1 -1
  184. package/lib/module/types/Common.js.map +1 -1
  185. package/lib/module/types/CustomerSheet.js.map +1 -1
  186. package/lib/module/types/Errors.js +1 -1
  187. package/lib/module/types/Errors.js.map +1 -1
  188. package/lib/module/types/FinancialConnections.js +1 -1
  189. package/lib/module/types/FinancialConnections.js.map +1 -1
  190. package/lib/module/types/NextAction.js.map +1 -1
  191. package/lib/module/types/PaymentIntent.js +1 -1
  192. package/lib/module/types/PaymentIntent.js.map +1 -1
  193. package/lib/module/types/PaymentMethod.js.map +1 -1
  194. package/lib/module/types/PaymentSheet.js +1 -1
  195. package/lib/module/types/PaymentSheet.js.map +1 -1
  196. package/lib/module/types/PlatformPay.js +1 -1
  197. package/lib/module/types/PlatformPay.js.map +1 -1
  198. package/lib/module/types/PushProvisioning.js +1 -1
  199. package/lib/module/types/PushProvisioning.js.map +1 -1
  200. package/lib/module/types/SetupIntent.js +1 -1
  201. package/lib/module/types/SetupIntent.js.map +1 -1
  202. package/lib/module/types/ThreeDSecure.js +1 -1
  203. package/lib/module/types/ThreeDSecure.js.map +1 -1
  204. package/lib/module/types/Token.js.map +1 -1
  205. package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
  206. package/lib/module/types/components/AuBECSDebitFormComponent.js.map +1 -1
  207. package/lib/module/types/components/CardFieldInput.js +1 -1
  208. package/lib/module/types/components/CardFieldInput.js.map +1 -1
  209. package/lib/module/types/components/CardFormView.js.map +1 -1
  210. package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -1
  211. package/lib/module/types/index.js +1 -1
  212. package/lib/module/types/index.js.map +1 -1
  213. package/lib/typescript/src/NativeStripeSdk.d.ts +5 -4
  214. package/lib/typescript/src/NativeStripeSdk.d.ts.map +1 -0
  215. package/lib/typescript/src/components/AddToWalletButton.d.ts +3 -1
  216. package/lib/typescript/src/components/AddToWalletButton.d.ts.map +1 -0
  217. package/lib/typescript/src/components/AddressSheet.d.ts +4 -2
  218. package/lib/typescript/src/components/AddressSheet.d.ts.map +1 -0
  219. package/lib/typescript/src/components/ApplePayButtonNative.d.ts +1 -0
  220. package/lib/typescript/src/components/ApplePayButtonNative.d.ts.map +1 -0
  221. package/lib/typescript/src/components/AuBECSDebitForm.d.ts +3 -1
  222. package/lib/typescript/src/components/AuBECSDebitForm.d.ts.map +1 -0
  223. package/lib/typescript/src/components/CardField.d.ts +1 -0
  224. package/lib/typescript/src/components/CardField.d.ts.map +1 -0
  225. package/lib/typescript/src/components/CardForm.d.ts +1 -0
  226. package/lib/typescript/src/components/CardForm.d.ts.map +1 -0
  227. package/lib/typescript/src/components/CustomerSheet.d.ts +2 -1
  228. package/lib/typescript/src/components/CustomerSheet.d.ts.map +1 -0
  229. package/lib/typescript/src/components/GooglePayButtonNative.d.ts +1 -0
  230. package/lib/typescript/src/components/GooglePayButtonNative.d.ts.map +1 -0
  231. package/lib/typescript/src/components/PlatformPayButton.d.ts +3 -1
  232. package/lib/typescript/src/components/PlatformPayButton.d.ts.map +1 -0
  233. package/lib/typescript/src/components/StripeContainer.d.ts +2 -1
  234. package/lib/typescript/src/components/StripeContainer.d.ts.map +1 -0
  235. package/lib/typescript/src/components/StripeProvider.d.ts +3 -2
  236. package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -0
  237. package/lib/typescript/src/functions.d.ts +12 -7
  238. package/lib/typescript/src/functions.d.ts.map +1 -0
  239. package/lib/typescript/src/helpers.d.ts +1 -0
  240. package/lib/typescript/src/helpers.d.ts.map +1 -0
  241. package/lib/typescript/src/hooks/useConfirmPayment.d.ts +2 -1
  242. package/lib/typescript/src/hooks/useConfirmPayment.d.ts.map +1 -0
  243. package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts +1 -0
  244. package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts.map +1 -0
  245. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +5 -2
  246. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts.map +1 -0
  247. package/lib/typescript/src/hooks/usePaymentSheet.d.ts +2 -1
  248. package/lib/typescript/src/hooks/usePaymentSheet.d.ts.map +1 -0
  249. package/lib/typescript/src/hooks/usePlatformPay.d.ts +4 -3
  250. package/lib/typescript/src/hooks/usePlatformPay.d.ts.map +1 -0
  251. package/lib/typescript/src/hooks/useStripe.d.ts +11 -8
  252. package/lib/typescript/src/hooks/useStripe.d.ts.map +1 -0
  253. package/lib/typescript/src/index.d.ts +1 -0
  254. package/lib/typescript/src/index.d.ts.map +1 -0
  255. package/lib/typescript/src/plugin/withStripe.d.ts +2 -1
  256. package/lib/typescript/src/plugin/withStripe.d.ts.map +1 -0
  257. package/lib/typescript/src/types/ApplePay.d.ts +6 -5
  258. package/lib/typescript/src/types/ApplePay.d.ts.map +1 -0
  259. package/lib/typescript/src/types/Common.d.ts +4 -1
  260. package/lib/typescript/src/types/Common.d.ts.map +1 -0
  261. package/lib/typescript/src/types/CustomerSheet.d.ts +12 -4
  262. package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -0
  263. package/lib/typescript/src/types/Errors.d.ts +2 -1
  264. package/lib/typescript/src/types/Errors.d.ts.map +1 -0
  265. package/lib/typescript/src/types/FinancialConnections.d.ts +82 -14
  266. package/lib/typescript/src/types/FinancialConnections.d.ts.map +1 -0
  267. package/lib/typescript/src/types/NextAction.d.ts +9 -8
  268. package/lib/typescript/src/types/NextAction.d.ts.map +1 -0
  269. package/lib/typescript/src/types/PaymentIntent.d.ts +41 -14
  270. package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -0
  271. package/lib/typescript/src/types/PaymentMethod.d.ts +27 -15
  272. package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -0
  273. package/lib/typescript/src/types/PaymentSheet.d.ts +72 -22
  274. package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -0
  275. package/lib/typescript/src/types/PlatformPay.d.ts +22 -21
  276. package/lib/typescript/src/types/PlatformPay.d.ts.map +1 -0
  277. package/lib/typescript/src/types/PushProvisioning.d.ts +5 -4
  278. package/lib/typescript/src/types/PushProvisioning.d.ts.map +1 -0
  279. package/lib/typescript/src/types/SetupIntent.d.ts +4 -3
  280. package/lib/typescript/src/types/SetupIntent.d.ts.map +1 -0
  281. package/lib/typescript/src/types/ThreeDSecure.d.ts +1 -0
  282. package/lib/typescript/src/types/ThreeDSecure.d.ts.map +1 -0
  283. package/lib/typescript/src/types/Token.d.ts +10 -9
  284. package/lib/typescript/src/types/Token.d.ts.map +1 -0
  285. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +3 -2
  286. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts.map +1 -0
  287. package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts +1 -0
  288. package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts.map +1 -0
  289. package/lib/typescript/src/types/components/CardFieldInput.d.ts +8 -5
  290. package/lib/typescript/src/types/components/CardFieldInput.d.ts.map +1 -0
  291. package/lib/typescript/src/types/components/CardFormView.d.ts +9 -6
  292. package/lib/typescript/src/types/components/CardFormView.d.ts.map +1 -0
  293. package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +1 -0
  294. package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts.map +1 -0
  295. package/lib/typescript/src/types/index.d.ts +24 -23
  296. package/lib/typescript/src/types/index.d.ts.map +1 -0
  297. package/package.json +33 -42
  298. package/src/NativeStripeSdk.tsx +5 -3
  299. package/src/components/CardField.tsx +1 -1
  300. package/src/components/CardForm.tsx +12 -9
  301. package/src/components/CustomerSheet.tsx +4 -6
  302. package/src/components/StripeProvider.tsx +17 -0
  303. package/src/functions.ts +70 -16
  304. package/src/hooks/useFinancialConnectionsSheet.tsx +12 -4
  305. package/src/hooks/useStripe.tsx +10 -4
  306. package/src/types/Common.ts +3 -0
  307. package/src/types/CustomerSheet.ts +7 -0
  308. package/src/types/FinancialConnections.ts +72 -0
  309. package/src/types/PaymentIntent.ts +30 -1
  310. package/src/types/PaymentMethod.ts +13 -1
  311. package/src/types/PaymentSheet.ts +65 -5
  312. package/src/types/components/CardFieldInput.ts +8 -4
  313. package/src/types/components/CardFormView.ts +8 -4
  314. package/stripe-react-native.podspec +2 -1
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport * from './CustomerSheet';\nexport type { Address, BillingDetails, AddressDetails } from './Common';\nexport { CardBrand } from './Common';\nexport { PaymentMethodLayout } from './PaymentSheet';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type HandleNextActionForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"],"mappings":"k2BAeA,4DAAuC,0BACvC,sEAAiD,oCACjD,sEAAiD,oCACjD,oEAA+C,kCAC/C,kEAA6C,gCAC7C,oEAA+C,kCAC/C,uGAAkF,0DAClF,mFAA8D,sCAC9D,+EAA0D,kCAC1D,sDAAiC,oBACjC,oFAA+D,kDAC/D,kEAA6C,gCAiB7C,mYACA,iVACA,oXAEA,gCAAqC"}
1
+ {"version":3,"names":["ApplePay","_interopRequireWildcard","require","exports","PaymentIntent","PaymentMethod","PaymentSheet","SetupIntent","ThreeDSecure","AuBECSDebitFormComponent","CardFieldInput","CardFormView","Token","FinancialConnections","PlatformPay","_PushProvisioning","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","defineProperty","enumerable","get","_Errors","_CustomerSheet","_Common","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"k2BAeA,IAAAA,QAAA,CAAAC,uBAAA,CAAAC,OAAA,gBAAuCC,OAAA,CAAAH,QAAA,CAAAA,QAAA,CACvC,IAAAI,aAAA,CAAAH,uBAAA,CAAAC,OAAA,qBAAiDC,OAAA,CAAAC,aAAA,CAAAA,aAAA,CACjD,IAAAC,aAAA,CAAAJ,uBAAA,CAAAC,OAAA,qBAAiDC,OAAA,CAAAE,aAAA,CAAAA,aAAA,CACjD,IAAAC,YAAA,CAAAL,uBAAA,CAAAC,OAAA,oBAA+CC,OAAA,CAAAG,YAAA,CAAAA,YAAA,CAC/C,IAAAC,WAAA,CAAAN,uBAAA,CAAAC,OAAA,mBAA6CC,OAAA,CAAAI,WAAA,CAAAA,WAAA,CAC7C,IAAAC,YAAA,CAAAP,uBAAA,CAAAC,OAAA,oBAA+CC,OAAA,CAAAK,YAAA,CAAAA,YAAA,CAC/C,IAAAC,wBAAA,CAAAR,uBAAA,CAAAC,OAAA,2CAAkFC,OAAA,CAAAM,wBAAA,CAAAA,wBAAA,CAClF,IAAAC,cAAA,CAAAT,uBAAA,CAAAC,OAAA,iCAA8DC,OAAA,CAAAO,cAAA,CAAAA,cAAA,CAC9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AAAC,GAAA,EAAA5B,MAAA,CAAAQ,cAAA,CAAAc,CAAA,CAAAI,CAAA,CAAAC,CAAA,EAAAL,CAAA,CAAAI,CAAA,EAAAX,CAAA,CAAAW,CAAA,UAAAJ,CAAA,CAAAF,OAAA,CAAAL,CAAA,CAAAG,CAAA,EAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,CAAAO,CAAA,EAAAA,CAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var StripeSdk=_reactNative.NativeModules.StripeSdk;var _default=StripeSdk;exports.default=_default;
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var StripeSdk=_reactNative.NativeModules.StripeSdk;var _default=exports.default=StripeSdk;
2
2
  //# sourceMappingURL=NativeStripeSdk.js.map
@@ -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":["_reactNative","require","StripeSdk","NativeModules","_default","exports","default"],"sourceRoot":"../../src","sources":["NativeStripeSdk.tsx"],"mappings":"gFAAA,IAAAA,YAAA,CAAAC,OAAA,iBA4JA,GAAQ,CAAAC,SAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,IAAAE,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAErBJ,SAAS","ignoreList":[]}
@@ -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 _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");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(0,_jsxRuntime.jsx)(AddToWalletButtonNative,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
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":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButtonNative","requireNativeComponent","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,YAAA,CAAAD,OAAA,iBAOsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,4FAAAC,SAAA,gBAQtB,GAAM,CAAAC,uBAAuB,CAC3B,GAAAC,mCAAsB,EAAM,mBAAmB,CAAC,CAgE3C,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAJ,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACR,uBAAuB,CAAAS,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 _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 _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");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(0,_jsxRuntime.jsx)(AddressSheetNative,Object.assign({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);}}));}
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":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AddressSheetNative","requireNativeComponent","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","value","nativeEvent","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAIsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,uFAAAC,SAAA,wBAQtB,GAAM,CAAAC,kBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,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,CAAAJ,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAY,GAAA,EAACT,kBAAkB,CAAAU,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAiD,QAChE,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAAC,EAC5B,CACDC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CACXF,KAEE,QACC,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACE,KAAK,CAAC,EAAC,EACvC,CAAC,CAEN","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');var _default=ApplePayButtonNative;exports.default=_default;
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');var _default=exports.default=ApplePayButtonNative;
2
2
  //# sourceMappingURL=ApplePayButtonNative.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApplePayButtonNative","requireNativeComponent"],"sources":["ApplePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type * as ApplePayButtonComponent from '../types/components/ApplePayButtonComponent';\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\nexport default ApplePayButtonNative;\n"],"mappings":"gFAAA,yCAEA,GAAMA,qBAAoB,CACxB,GAAAC,mCAAsB,EAAsC,gBAAgB,CAAC,CAAC,aACjED,oBAAoB"}
1
+ {"version":3,"names":["_reactNative","require","ApplePayButtonNative","requireNativeComponent","_default","exports","default"],"sourceRoot":"../../../src","sources":["components/ApplePayButtonNative.tsx"],"mappings":"gFAAA,IAAAA,YAAA,CAAAC,OAAA,iBAEA,GAAM,CAAAC,oBAAoB,CACxB,GAAAC,mCAAsB,EAAsC,gBAAgB,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CACjEJ,oBAAoB","ignoreList":[]}
@@ -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 _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");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(0,_jsxRuntime.jsx)(AuBECSDebitFormNative,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":["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":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitFormNative","requireNativeComponent","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,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAKsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,0FAAAC,SAAA,0CAGtB,GAAM,CAAAC,qBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBACF,CAAC,CA4BI,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,CAAAJ,SAAA,EAER,MACE,GAAAF,WAAA,CAAAa,GAAA,EAACV,qBAAqB,CAAAW,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 _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 _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");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(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');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,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] ⚠️ 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(){_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(0,_jsxRuntime.jsx)(CardFieldNative,Object.assign({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));});
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":"qWACA,qDAOA,yCASA,mCAKoB,itCAEpB,GAAMA,gBAAe,CACnB,GAAAC,mCAAsB,EAA6B,WAAW,CAAC,CAoD1D,GAAMC,UAAS,CAAG,GAAAC,iBAAU,EACjC,cAWEC,GAAG,CACA,IAVDC,aAAY,MAAZA,YAAY,CACZC,OAAO,MAAPA,OAAO,CACPC,MAAM,MAANA,MAAM,CACNC,SAAS,MAATA,SAAS,CACTC,YAAY,MAAZA,YAAY,CACZC,iBAAiB,MAAjBA,iBAAiB,CACj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jB,CAAC,CAAE,CAAC/B,QAAQ,CAAC,CAAC,CAEd,MACE,8BAAC,eAAe,wBACd,GAAG,CAAEA,QAAS,CACd,YAAY,CAAEE,mBAAoB,CAClC,aAAa,CAAEqB,cAAe,CAC9B,iBAAiB,CAAE1B,iBAAiB,OAAjBA,iBAAiB,CAAI,IAAK,CAC7C,WAAW,CAAEC,WAAW,OAAXA,WAAW,CAAI,IAAK,CACjC,SAAS,CAAE,CACTyC,eAAe,CAAE5C,SAAS,cAATA,SAAS,CAAE4C,eAAe,CAC3CC,WAAW,CAAE7C,SAAS,cAATA,SAAS,CAAE6C,WAAW,CACnCC,WAAW,CAAE9C,SAAS,cAATA,SAAS,CAAE8C,WAAW,CACnCC,YAAY,CAAE/C,SAAS,cAATA,SAAS,CAAE+C,YAAY,CACrCC,WAAW,CAAEhD,SAAS,cAATA,SAAS,CAAEgD,WAAW,CACnCC,QAAQ,CAAEjD,SAAS,cAATA,SAAS,CAAEiD,QAAQ,CAC7BC,gBAAgB,CAAElD,SAAS,cAATA,SAAS,CAAEkD,gBAAgB,CAC7CC,SAAS,CAAEnD,SAAS,cAATA,SAAS,CAAEmD,SAAS,CAC/BC,cAAc,CAAEpD,SAAS,cAATA,SAAS,CAAEoD,cAAc,CACzCC,UAAU,CAAErD,SAAS,cAATA,SAAS,CAAEqD,UACzB,CAAE,CACF,YAAY,CAAE,CACZ9B,MAAM,CAAEtB,YAAY,cAAZA,YAAY,CAAEsB,MAAM,CAC5B+B,UAAU,CAAErD,YAAY,cAAZA,YAAY,CAAEqD,UAAU,CACpC9B,GAAG,CAAEvB,YAAY,cAAZA,YAAY,CAAEuB,GAAG,CACtBF,UAAU,CAAErB,YAAY,cAAZA,YAAY,CAAEqB,UAC5B,CAAE,EACElB,KAAK,gFACT,CAEN,CAAC,CACF,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_helpers","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardFieldNative","requireNativeComponent","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","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","UIManager","dispatchViewManagerCommand","findNodeHandle","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":"qRACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,QAAA,CAAAF,OAAA,eAKoB,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,sGAAAC,KAAA,MAAAC,YAAA,yFAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,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ime/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 _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=exports.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] ⚠️ 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(){_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(0,_jsxRuntime.jsx)(CardFormNative,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},props));});
2
2
  //# sourceMappingURL=CardForm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CardFormNative","requireNativeComponent","CardForm","forwardRef","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","useRef","onFormCompleteHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","findNodeHandle","current","blur","useImperativeHandle","onFocusHandler","focusedField","focusInput","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sources":["CardForm.tsx"],"sourcesContent":["import type { CardFormView, 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 CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n /** Applies a disabled state such that user input is not accepted. Defaults to false. */\n disabled?: boolean;\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\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 // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` 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 Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && 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 onFormComplete?.(data);\n },\n [onFormComplete]\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 useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\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 <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\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 // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={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AEwC,eAAe,CAC3CC,WAAW,CAAEzC,SAAS,cAATA,SAAS,CAAEyC,WAAW,CACnCC,WAAW,CAAE1C,SAAS,cAATA,SAAS,CAAE0C,WAAW,CACnCC,YAAY,CAAE3C,SAAS,cAATA,SAAS,CAAE2C,YAAY,CACrCC,WAAW,CAAE5C,SAAS,cAATA,SAAS,CAAE4C,WAAW,CACnCC,QAAQ,CAAE7C,SAAS,cAATA,SAAS,CAAE6C,QAAQ,CAC7BC,gBAAgB,CAAE9C,SAAS,cAATA,SAAS,CAAE8C,gBAAgB,CAC7CC,SAAS,CAAE/C,SAAS,cAATA,SAAS,CAAE+C,SAAS,CAC/BC,cAAc,CAAEhD,SAAS,cAATA,SAAS,CAAEgD,cAAc,CACzCC,UAAU,CAAEjD,SAAS,cAATA,SAAS,CAAEiD,UAGzB,CAAE,CACF,YAAY,CAAE,CACZ7B,MAAM,CAAEnB,YAAY,cAAZA,YAAY,CAAEmB,MAAM,CAC5B8B,UAAU,CAAEjD,YAAY,cAAZA,YAAY,CAAEiD,UAAU,CACpC7B,GAAG,CAAEpB,YAAY,cAAZA,YAAY,CAAEoB,GAAG,CACtBH,UAAU,CAAEjB,YAAY,cAAZA,YAAY,CAAEiB,UAC5B,CAAE,CACF,aAAa,kBACPhB,aAAa,OAAbA,aAAa,CAAI,CAAC,CAAC,CACvB,CACF,aAAa,CAAE8B,cAAe,EAE1B7B,KAAK,gFACT,CAEN,CAAC,CACF,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_helpers","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardFormNative","requireNativeComponent","CardForm","exports","forwardRef","_ref","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","_objectWithoutProperties2","inputRef","useRef","onFormCompleteHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","findNodeHandle","current","blur","useImperativeHandle","onFocusHandler","focusedField","focusInput","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration","onFocusChange"],"sourceRoot":"../../../src","sources":["components/CardForm.tsx"],"mappings":"oRACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,QAAA,CAAAF,OAAA,eAKoB,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,mEAAAC,KAAA,MAAAC,YAAA,wFAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,CAAA,IAAAd,CAAA,gBAAAc,CAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,CAAA,OAAAG,CAAA,CAAAP,CAAA,CAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,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ACpC/B,GAAG,CAAEpB,YAAY,cAAZA,YAAY,CAAEoB,GAAG,CACtBF,UAAU,CAAElB,YAAY,cAAZA,YAAY,CAAEkB,UAC5B,CAAE,CACFjB,aAAa,CAAAlB,MAAA,CAAAyD,MAAA,IACPvC,aAAa,OAAbA,aAAa,CAAI,CAAC,CAAC,CACvB,CACFmD,aAAa,CAAErB,cAAe,EAE1B7B,KAAK,CACV,CAAC,CAEN,CACF,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CustomerSheet=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var eventEmitter=new _reactNative.NativeEventEmitter(_reactNative.NativeModules.StripeSdk);var fetchPaymentMethodsCallback=null;var attachPaymentMethodCallback=null;var detachPaymentMethodCallback=null;var setSelectedPaymentOptionCallback=null;var fetchSelectedPaymentOptionCallback=null;var setupIntentClientSecretForCustomerAttachCallback=null;var initialize=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var customerAdapterOverrides={};if(params.customerAdapter){customerAdapterOverrides=configureCustomerAdapterEventListeners(params.customerAdapter);}try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.initCustomerSheet(params,customerAdapterOverrides),error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initialize(_x){return _ref.apply(this,arguments);};}();var configureCustomerAdapterEventListeners=function configureCustomerAdapterEventListeners(customerAdapter){if(customerAdapter.fetchPaymentMethods){var _fetchPaymentMethodsC;(_fetchPaymentMethodsC=fetchPaymentMethodsCallback)==null?void 0:_fetchPaymentMethodsC.remove();fetchPaymentMethodsCallback=eventEmitter.addListener('onCustomerAdapterFetchPaymentMethodsCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.fetchPaymentMethods){var paymentMethods=yield customerAdapter.fetchPaymentMethods();yield _NativeStripeSdk.default.customerAdapterFetchPaymentMethodsCallback(paymentMethods);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `fetchPaymentMethods` on your CustomerAdapter, but no matching method was found.');}}));}if(customerAdapter.attachPaymentMethod){var _attachPaymentMethodC;(_attachPaymentMethodC=attachPaymentMethodCallback)==null?void 0:_attachPaymentMethodC.remove();attachPaymentMethodCallback=eventEmitter.addListener('onCustomerAdapterAttachPaymentMethodCallback',function(){var _ref4=(0,_asyncToGenerator2.default)(function*(_ref3){var paymentMethodId=_ref3.paymentMethodId;if(customerAdapter.attachPaymentMethod){var paymentMethod=yield customerAdapter.attachPaymentMethod(paymentMethodId);yield _NativeStripeSdk.default.customerAdapterAttachPaymentMethodCallback(paymentMethod);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `attachPaymentMethod` on your CustomerAdapter, but no matching method was found.');}});return function(_x2){return _ref4.apply(this,arguments);};}());}if(customerAdapter.detachPaymentMethod){var _detachPaymentMethodC;(_detachPaymentMethodC=detachPaymentMethodCallback)==null?void 0:_detachPaymentMethodC.remove();detachPaymentMethodCallback=eventEmitter.addListener('onCustomerAdapterDetachPaymentMethodCallback',function(){var _ref6=(0,_asyncToGenerator2.default)(function*(_ref5){var paymentMethodId=_ref5.paymentMethodId;if(customerAdapter.detachPaymentMethod){var paymentMethod=yield customerAdapter.detachPaymentMethod(paymentMethodId);yield _NativeStripeSdk.default.customerAdapterDetachPaymentMethodCallback(paymentMethod);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `detachPaymentMethod` on your CustomerAdapter, but no matching method was found.');}});return function(_x3){return _ref6.apply(this,arguments);};}());}if(customerAdapter.setSelectedPaymentOption){var _setSelectedPaymentOp;(_setSelectedPaymentOp=setSelectedPaymentOptionCallback)==null?void 0:_setSelectedPaymentOp.remove();setSelectedPaymentOptionCallback=eventEmitter.addListener('onCustomerAdapterSetSelectedPaymentOptionCallback',function(){var _ref8=(0,_asyncToGenerator2.default)(function*(_ref7){var paymentOption=_ref7.paymentOption;if(customerAdapter.setSelectedPaymentOption){yield customerAdapter.setSelectedPaymentOption(paymentOption);yield _NativeStripeSdk.default.customerAdapterSetSelectedPaymentOptionCallback();}else{throw new Error('[@stripe/stripe-react-native] Tried to call `setSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.');}});return function(_x4){return _ref8.apply(this,arguments);};}());}if(customerAdapter.fetchSelectedPaymentOption){var _fetchSelectedPayment;(_fetchSelectedPayment=fetchSelectedPaymentOptionCallback)==null?void 0:_fetchSelectedPayment.remove();fetchSelectedPaymentOptionCallback=eventEmitter.addListener('onCustomerAdapterFetchSelectedPaymentOptionCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.fetchSelectedPaymentOption){var paymentOption=yield customerAdapter.fetchSelectedPaymentOption();yield _NativeStripeSdk.default.customerAdapterFetchSelectedPaymentOptionCallback(paymentOption);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `fetchSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.');}}));}if(customerAdapter.setupIntentClientSecretForCustomerAttach){var _setupIntentClientSec;(_setupIntentClientSec=setupIntentClientSecretForCustomerAttachCallback)==null?void 0:_setupIntentClientSec.remove();setupIntentClientSecretForCustomerAttachCallback=eventEmitter.addListener('onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.setupIntentClientSecretForCustomerAttach){var clientSecret=yield customerAdapter.setupIntentClientSecretForCustomerAttach();yield _NativeStripeSdk.default.customerAdapterSetupIntentClientSecretForCustomerAttachCallback(clientSecret);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `setupIntentClientSecretForCustomerAttach` on your CustomerAdapter, but no matching method was found.');}}));}return{fetchPaymentMethods:!!customerAdapter.fetchPaymentMethods,attachPaymentMethod:!!customerAdapter.attachPaymentMethod,detachPaymentMethod:!!customerAdapter.detachPaymentMethod,setSelectedPaymentOption:!!customerAdapter.setSelectedPaymentOption,fetchSelectedPaymentOption:!!customerAdapter.fetchSelectedPaymentOption,setupIntentClientSecretForCustomerAttach:!!customerAdapter.setupIntentClientSecretForCustomerAttach};};var present=function(){var _ref11=(0,_asyncToGenerator2.default)(function*(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};try{return yield _NativeStripeSdk.default.presentCustomerSheet(params);}catch(error){return{error:error};}});return function present(){return _ref11.apply(this,arguments);};}();var retrievePaymentOptionSelection=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(){try{return yield _NativeStripeSdk.default.retrieveCustomerSheetPaymentOptionSelection();}catch(error){return{error:error};}});return function retrievePaymentOptionSelection(){return _ref12.apply(this,arguments);};}();function Component(_ref13){var visible=_ref13.visible,presentationStyle=_ref13.presentationStyle,animationStyle=_ref13.animationStyle,style=_ref13.style,appearance=_ref13.appearance,setupIntentClientSecret=_ref13.setupIntentClientSecret,customerId=_ref13.customerId,customerEphemeralKeySecret=_ref13.customerEphemeralKeySecret,merchantDisplayName=_ref13.merchantDisplayName,headerTextForSelectionScreen=_ref13.headerTextForSelectionScreen,defaultBillingDetails=_ref13.defaultBillingDetails,billingDetailsCollectionConfiguration=_ref13.billingDetailsCollectionConfiguration,returnURL=_ref13.returnURL,removeSavedPaymentMethodMessage=_ref13.removeSavedPaymentMethodMessage,applePayEnabled=_ref13.applePayEnabled,googlePayEnabled=_ref13.googlePayEnabled,timeout=_ref13.timeout,onResult=_ref13.onResult,customerAdapter=_ref13.customerAdapter;_react.default.useEffect(function(){if(visible){initialize({style:style,appearance:appearance,setupIntentClientSecret:setupIntentClientSecret,customerId:customerId,customerEphemeralKeySecret:customerEphemeralKeySecret,merchantDisplayName:merchantDisplayName,headerTextForSelectionScreen:headerTextForSelectionScreen,defaultBillingDetails:defaultBillingDetails,billingDetailsCollectionConfiguration:billingDetailsCollectionConfiguration,returnURL:returnURL,removeSavedPaymentMethodMessage:removeSavedPaymentMethodMessage,applePayEnabled:applePayEnabled,googlePayEnabled:googlePayEnabled,customerAdapter:customerAdapter}).then(function(initResult){if(initResult.error){onResult(initResult);}else{present({timeout:timeout,presentationStyle:presentationStyle,animationStyle:animationStyle}).then(function(presentResult){onResult(presentResult);});}});}},[visible]);return null;}var CustomerSheet={Component:Component,initialize:initialize,present:present,retrievePaymentOptionSelection:retrievePaymentOptionSelection};exports.CustomerSheet=CustomerSheet;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CustomerSheet=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var eventEmitter=new _reactNative.NativeEventEmitter(_reactNative.NativeModules.StripeSdk);var fetchPaymentMethodsCallback=null;var attachPaymentMethodCallback=null;var detachPaymentMethodCallback=null;var setSelectedPaymentOptionCallback=null;var fetchSelectedPaymentOptionCallback=null;var setupIntentClientSecretForCustomerAttachCallback=null;var initialize=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var customerAdapterOverrides={};if(params.customerAdapter){customerAdapterOverrides=configureCustomerAdapterEventListeners(params.customerAdapter);}try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.initCustomerSheet(params,customerAdapterOverrides),error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initialize(_x){return _ref.apply(this,arguments);};}();var configureCustomerAdapterEventListeners=function configureCustomerAdapterEventListeners(customerAdapter){if(customerAdapter.fetchPaymentMethods){var _fetchPaymentMethodsC;(_fetchPaymentMethodsC=fetchPaymentMethodsCallback)==null||_fetchPaymentMethodsC.remove();fetchPaymentMethodsCallback=eventEmitter.addListener('onCustomerAdapterFetchPaymentMethodsCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.fetchPaymentMethods){var paymentMethods=yield customerAdapter.fetchPaymentMethods();yield _NativeStripeSdk.default.customerAdapterFetchPaymentMethodsCallback(paymentMethods);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `fetchPaymentMethods` on your CustomerAdapter, but no matching method was found.');}}));}if(customerAdapter.attachPaymentMethod){var _attachPaymentMethodC;(_attachPaymentMethodC=attachPaymentMethodCallback)==null||_attachPaymentMethodC.remove();attachPaymentMethodCallback=eventEmitter.addListener('onCustomerAdapterAttachPaymentMethodCallback',function(){var _ref4=(0,_asyncToGenerator2.default)(function*(_ref3){var paymentMethodId=_ref3.paymentMethodId;if(customerAdapter.attachPaymentMethod){var paymentMethod=yield customerAdapter.attachPaymentMethod(paymentMethodId);yield _NativeStripeSdk.default.customerAdapterAttachPaymentMethodCallback(paymentMethod);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `attachPaymentMethod` on your CustomerAdapter, but no matching method was found.');}});return function(_x2){return _ref4.apply(this,arguments);};}());}if(customerAdapter.detachPaymentMethod){var _detachPaymentMethodC;(_detachPaymentMethodC=detachPaymentMethodCallback)==null||_detachPaymentMethodC.remove();detachPaymentMethodCallback=eventEmitter.addListener('onCustomerAdapterDetachPaymentMethodCallback',function(){var _ref6=(0,_asyncToGenerator2.default)(function*(_ref5){var paymentMethodId=_ref5.paymentMethodId;if(customerAdapter.detachPaymentMethod){var paymentMethod=yield customerAdapter.detachPaymentMethod(paymentMethodId);yield _NativeStripeSdk.default.customerAdapterDetachPaymentMethodCallback(paymentMethod);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `detachPaymentMethod` on your CustomerAdapter, but no matching method was found.');}});return function(_x3){return _ref6.apply(this,arguments);};}());}if(customerAdapter.setSelectedPaymentOption){var _setSelectedPaymentOp;(_setSelectedPaymentOp=setSelectedPaymentOptionCallback)==null||_setSelectedPaymentOp.remove();setSelectedPaymentOptionCallback=eventEmitter.addListener('onCustomerAdapterSetSelectedPaymentOptionCallback',function(){var _ref8=(0,_asyncToGenerator2.default)(function*(_ref7){var paymentOption=_ref7.paymentOption;if(customerAdapter.setSelectedPaymentOption){yield customerAdapter.setSelectedPaymentOption(paymentOption);yield _NativeStripeSdk.default.customerAdapterSetSelectedPaymentOptionCallback();}else{throw new Error('[@stripe/stripe-react-native] Tried to call `setSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.');}});return function(_x4){return _ref8.apply(this,arguments);};}());}if(customerAdapter.fetchSelectedPaymentOption){var _fetchSelectedPayment;(_fetchSelectedPayment=fetchSelectedPaymentOptionCallback)==null||_fetchSelectedPayment.remove();fetchSelectedPaymentOptionCallback=eventEmitter.addListener('onCustomerAdapterFetchSelectedPaymentOptionCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.fetchSelectedPaymentOption){var paymentOption=yield customerAdapter.fetchSelectedPaymentOption();yield _NativeStripeSdk.default.customerAdapterFetchSelectedPaymentOptionCallback(paymentOption);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `fetchSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.');}}));}if(customerAdapter.setupIntentClientSecretForCustomerAttach){var _setupIntentClientSec;(_setupIntentClientSec=setupIntentClientSecretForCustomerAttachCallback)==null||_setupIntentClientSec.remove();setupIntentClientSecretForCustomerAttachCallback=eventEmitter.addListener('onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback',(0,_asyncToGenerator2.default)(function*(){if(customerAdapter.setupIntentClientSecretForCustomerAttach){var clientSecret=yield customerAdapter.setupIntentClientSecretForCustomerAttach();yield _NativeStripeSdk.default.customerAdapterSetupIntentClientSecretForCustomerAttachCallback(clientSecret);}else{throw new Error('[@stripe/stripe-react-native] Tried to call `setupIntentClientSecretForCustomerAttach` on your CustomerAdapter, but no matching method was found.');}}));}return{fetchPaymentMethods:!!customerAdapter.fetchPaymentMethods,attachPaymentMethod:!!customerAdapter.attachPaymentMethod,detachPaymentMethod:!!customerAdapter.detachPaymentMethod,setSelectedPaymentOption:!!customerAdapter.setSelectedPaymentOption,fetchSelectedPaymentOption:!!customerAdapter.fetchSelectedPaymentOption,setupIntentClientSecretForCustomerAttach:!!customerAdapter.setupIntentClientSecretForCustomerAttach};};var present=function(){var _ref11=(0,_asyncToGenerator2.default)(function*(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};try{return yield _NativeStripeSdk.default.presentCustomerSheet(params);}catch(error){return{error:error};}});return function present(){return _ref11.apply(this,arguments);};}();var retrievePaymentOptionSelection=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(){try{return yield _NativeStripeSdk.default.retrieveCustomerSheetPaymentOptionSelection();}catch(error){return{error:error};}});return function retrievePaymentOptionSelection(){return _ref12.apply(this,arguments);};}();function Component(_ref13){var visible=_ref13.visible,presentationStyle=_ref13.presentationStyle,animationStyle=_ref13.animationStyle,style=_ref13.style,appearance=_ref13.appearance,setupIntentClientSecret=_ref13.setupIntentClientSecret,customerId=_ref13.customerId,customerEphemeralKeySecret=_ref13.customerEphemeralKeySecret,merchantDisplayName=_ref13.merchantDisplayName,headerTextForSelectionScreen=_ref13.headerTextForSelectionScreen,defaultBillingDetails=_ref13.defaultBillingDetails,billingDetailsCollectionConfiguration=_ref13.billingDetailsCollectionConfiguration,returnURL=_ref13.returnURL,removeSavedPaymentMethodMessage=_ref13.removeSavedPaymentMethodMessage,applePayEnabled=_ref13.applePayEnabled,googlePayEnabled=_ref13.googlePayEnabled,timeout=_ref13.timeout,onResult=_ref13.onResult,customerAdapter=_ref13.customerAdapter;_react.default.useEffect(function(){if(visible){initialize({style:style,appearance:appearance,setupIntentClientSecret:setupIntentClientSecret,customerId:customerId,customerEphemeralKeySecret:customerEphemeralKeySecret,merchantDisplayName:merchantDisplayName,headerTextForSelectionScreen:headerTextForSelectionScreen,defaultBillingDetails:defaultBillingDetails,billingDetailsCollectionConfiguration:billingDetailsCollectionConfiguration,returnURL:returnURL,removeSavedPaymentMethodMessage:removeSavedPaymentMethodMessage,applePayEnabled:applePayEnabled,googlePayEnabled:googlePayEnabled,customerAdapter:customerAdapter}).then(function(initResult){if(initResult.error){onResult(initResult);}else{present({timeout:timeout,presentationStyle:presentationStyle,animationStyle:animationStyle}).then(function(presentResult){onResult(presentResult);});}});}},[visible]);return null;}var CustomerSheet=exports.CustomerSheet={Component:Component,initialize:initialize,present:present,retrievePaymentOptionSelection:retrievePaymentOptionSelection};
2
2
  //# sourceMappingURL=CustomerSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["eventEmitter","NativeEventEmitter","NativeModules","StripeSdk","fetchPaymentMethodsCallback","attachPaymentMethodCallback","detachPaymentMethodCallback","setSelectedPaymentOptionCallback","fetchSelectedPaymentOptionCallback","setupIntentClientSecretForCustomerAttachCallback","initialize","params","customerAdapterOverrides","customerAdapter","configureCustomerAdapterEventListeners","NativeStripeSdk","initCustomerSheet","error","fetchPaymentMethods","remove","addListener","paymentMethods","customerAdapterFetchPaymentMethodsCallback","Error","attachPaymentMethod","paymentMethodId","paymentMethod","customerAdapterAttachPaymentMethodCallback","detachPaymentMethod","customerAdapterDetachPaymentMethodCallback","setSelectedPaymentOption","paymentOption","customerAdapterSetSelectedPaymentOptionCallback","fetchSelectedPaymentOption","customerAdapterFetchSelectedPaymentOptionCallback","setupIntentClientSecretForCustomerAttach","clientSecret","customerAdapterSetupIntentClientSecretForCustomerAttachCallback","present","presentCustomerSheet","retrievePaymentOptionSelection","retrieveCustomerSheetPaymentOptionSelection","Component","visible","presentationStyle","animationStyle","style","appearance","setupIntentClientSecret","customerId","customerEphemeralKeySecret","merchantDisplayName","headerTextForSelectionScreen","defaultBillingDetails","billingDetailsCollectionConfiguration","returnURL","removeSavedPaymentMethodMessage","applePayEnabled","googlePayEnabled","timeout","onResult","React","useEffect","then","initResult","presentResult","CustomerSheet"],"sources":["CustomerSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n NativeEventEmitter,\n NativeModules,\n EmitterSubscription,\n} from 'react-native';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport type {\n CustomerSheetInitParams,\n CustomerSheetPresentParams,\n CustomerSheetResult,\n CustomerSheetError,\n StripeError,\n CustomerAdapter,\n} from '../types';\n\nconst eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);\nlet fetchPaymentMethodsCallback: EmitterSubscription | null = null;\nlet attachPaymentMethodCallback: EmitterSubscription | null = null;\nlet detachPaymentMethodCallback: EmitterSubscription | null = null;\nlet setSelectedPaymentOptionCallback: EmitterSubscription | null = null;\nlet fetchSelectedPaymentOptionCallback: EmitterSubscription | null = null;\nlet setupIntentClientSecretForCustomerAttachCallback: EmitterSubscription | null =\n null;\n\n/** Initialize an instance of Customer Sheet with your desired configuration. */\nconst initialize = async (\n params: CustomerSheetInitParams\n): Promise<{ error?: StripeError<CustomerSheetError> }> => {\n let customerAdapterOverrides = {};\n if (params.customerAdapter) {\n customerAdapterOverrides = configureCustomerAdapterEventListeners(\n params.customerAdapter\n );\n }\n\n try {\n const { error } = await NativeStripeSdk.initCustomerSheet(\n params,\n customerAdapterOverrides\n );\n if (error) {\n return { error };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nconst configureCustomerAdapterEventListeners = (\n customerAdapter: CustomerAdapter\n): { [Property in keyof CustomerAdapter]: boolean } => {\n if (customerAdapter.fetchPaymentMethods) {\n fetchPaymentMethodsCallback?.remove();\n fetchPaymentMethodsCallback = eventEmitter.addListener(\n 'onCustomerAdapterFetchPaymentMethodsCallback',\n async () => {\n if (customerAdapter.fetchPaymentMethods) {\n const paymentMethods = await customerAdapter.fetchPaymentMethods();\n await NativeStripeSdk.customerAdapterFetchPaymentMethodsCallback(\n paymentMethods\n );\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `fetchPaymentMethods` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n if (customerAdapter.attachPaymentMethod) {\n attachPaymentMethodCallback?.remove();\n attachPaymentMethodCallback = eventEmitter.addListener(\n 'onCustomerAdapterAttachPaymentMethodCallback',\n async ({ paymentMethodId }: { paymentMethodId: string }) => {\n if (customerAdapter.attachPaymentMethod) {\n const paymentMethod = await customerAdapter.attachPaymentMethod(\n paymentMethodId\n );\n await NativeStripeSdk.customerAdapterAttachPaymentMethodCallback(\n paymentMethod\n );\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `attachPaymentMethod` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n if (customerAdapter.detachPaymentMethod) {\n detachPaymentMethodCallback?.remove();\n detachPaymentMethodCallback = eventEmitter.addListener(\n 'onCustomerAdapterDetachPaymentMethodCallback',\n async ({ paymentMethodId }: { paymentMethodId: string }) => {\n if (customerAdapter.detachPaymentMethod) {\n const paymentMethod = await customerAdapter.detachPaymentMethod(\n paymentMethodId\n );\n await NativeStripeSdk.customerAdapterDetachPaymentMethodCallback(\n paymentMethod\n );\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `detachPaymentMethod` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n if (customerAdapter.setSelectedPaymentOption) {\n setSelectedPaymentOptionCallback?.remove();\n setSelectedPaymentOptionCallback = eventEmitter.addListener(\n 'onCustomerAdapterSetSelectedPaymentOptionCallback',\n async ({ paymentOption }: { paymentOption: string }) => {\n if (customerAdapter.setSelectedPaymentOption) {\n await customerAdapter.setSelectedPaymentOption(paymentOption);\n await NativeStripeSdk.customerAdapterSetSelectedPaymentOptionCallback();\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `setSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n if (customerAdapter.fetchSelectedPaymentOption) {\n fetchSelectedPaymentOptionCallback?.remove();\n fetchSelectedPaymentOptionCallback = eventEmitter.addListener(\n 'onCustomerAdapterFetchSelectedPaymentOptionCallback',\n async () => {\n if (customerAdapter.fetchSelectedPaymentOption) {\n const paymentOption =\n await customerAdapter.fetchSelectedPaymentOption();\n await NativeStripeSdk.customerAdapterFetchSelectedPaymentOptionCallback(\n paymentOption\n );\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `fetchSelectedPaymentOption` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n if (customerAdapter.setupIntentClientSecretForCustomerAttach) {\n setupIntentClientSecretForCustomerAttachCallback?.remove();\n setupIntentClientSecretForCustomerAttachCallback = eventEmitter.addListener(\n 'onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback',\n async () => {\n if (customerAdapter.setupIntentClientSecretForCustomerAttach) {\n const clientSecret =\n await customerAdapter.setupIntentClientSecretForCustomerAttach();\n await NativeStripeSdk.customerAdapterSetupIntentClientSecretForCustomerAttachCallback(\n clientSecret\n );\n } else {\n throw new Error(\n '[@stripe/stripe-react-native] Tried to call `setupIntentClientSecretForCustomerAttach` on your CustomerAdapter, but no matching method was found.'\n );\n }\n }\n );\n }\n\n return {\n fetchPaymentMethods: !!customerAdapter.fetchPaymentMethods,\n attachPaymentMethod: !!customerAdapter.attachPaymentMethod,\n detachPaymentMethod: !!customerAdapter.detachPaymentMethod,\n setSelectedPaymentOption: !!customerAdapter.setSelectedPaymentOption,\n fetchSelectedPaymentOption: !!customerAdapter.fetchSelectedPaymentOption,\n setupIntentClientSecretForCustomerAttach:\n !!customerAdapter.setupIntentClientSecretForCustomerAttach,\n };\n};\n\n/** Launches the Customer Sheet UI. */\nconst present = async (\n params: CustomerSheetPresentParams = {}\n): Promise<CustomerSheetResult> => {\n try {\n return await NativeStripeSdk.presentCustomerSheet(params);\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * You can use this to obtain the selected payment method without presenting the CustomerSheet.\n * This will return an error if you have not called `.initialize`\n */\nconst retrievePaymentOptionSelection =\n async (): Promise<CustomerSheetResult> => {\n try {\n return await NativeStripeSdk.retrieveCustomerSheetPaymentOptionSelection();\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * Props\n */\nexport type Props = {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Called when the user submits, dismisses, or cancels the sheet, or when an error occurs. */\n onResult: (result: CustomerSheetResult) => void;\n} & CustomerSheetInitParams &\n CustomerSheetPresentParams;\n\n/**\n * A component wrapper around the Customer Sheet functions. Upon passing `true` to the `visible` prop,\n * Customer Sheet will call `initialize` and `present`, and the result(s) will be passed through to the\n * onResult callback.\n *\n * @example\n * ```ts\n * const [selectedPaymentOption, setSelectedPaymentOption] = React.useState(null);\n * const [customerSheetVisible, setCustomerSheetVisible] = React.useState(false);\n *\n * return (\n * <CustomerSheet\n * visible={customerSheetVisible}\n * customerEphemeralKeySecret={ephemeralKeySecret}\n * customerId={customer}\n * returnURL={'stripe-example://stripe-redirect'}\n * onResult={({ error, paymentOption, paymentMethod }) => {\n * setCustomerSheetVisible(false);\n * if (error) {\n * Alert.alert(error.code, error.localizedMessage);\n * }\n * if (paymentOption) {\n * setSelectedPaymentOption(paymentOption);\n * console.log(JSON.stringify(paymentOption, null, 2));\n * }\n * if (paymentMethod) {\n * console.log(JSON.stringify(paymentMethod, null, 2));\n * }\n * }}\n * />\n * );\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nfunction Component({\n visible,\n presentationStyle,\n animationStyle,\n style,\n appearance,\n setupIntentClientSecret,\n customerId,\n customerEphemeralKeySecret,\n merchantDisplayName,\n headerTextForSelectionScreen,\n defaultBillingDetails,\n billingDetailsCollectionConfiguration,\n returnURL,\n removeSavedPaymentMethodMessage,\n applePayEnabled,\n googlePayEnabled,\n timeout,\n onResult,\n customerAdapter,\n}: Props) {\n React.useEffect(() => {\n if (visible) {\n initialize({\n style,\n appearance,\n setupIntentClientSecret,\n customerId,\n customerEphemeralKeySecret,\n merchantDisplayName,\n headerTextForSelectionScreen,\n defaultBillingDetails,\n billingDetailsCollectionConfiguration,\n returnURL,\n removeSavedPaymentMethodMessage,\n applePayEnabled,\n googlePayEnabled,\n customerAdapter,\n }).then((initResult) => {\n if (initResult.error) {\n onResult(initResult);\n } else {\n present({\n timeout,\n presentationStyle,\n animationStyle,\n }).then((presentResult) => {\n onResult(presentResult);\n });\n }\n });\n }\n // Only run this hook when visible prop changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n return null;\n}\n\n/**\n * The Customer Sheet is a prebuilt UI component that lets your customers manage their saved payment methods.\n */\nexport const CustomerSheet = {\n Component,\n initialize,\n present,\n retrievePaymentOptionSelection,\n};\n"],"mappings":"2QAAA,oDACA,yCAKA,2EAUA,GAAMA,aAAY,CAAG,GAAIC,gCAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC,CACpE,GAAIC,4BAAuD,CAAG,IAAI,CAClE,GAAIC,4BAAuD,CAAG,IAAI,CAClE,GAAIC,4BAAuD,CAAG,IAAI,CAClE,GAAIC,iCAA4D,CAAG,IAAI,CACvE,GAAIC,mCAA8D,CAAG,IAAI,CACzE,GAAIC,iDAA4E,CAC9E,IAAI,CAGN,GAAMC,WAAU,oDAAG,UACjBC,MAA+B,CAC0B,CACzD,GAAIC,yBAAwB,CAAG,CAAC,CAAC,CACjC,GAAID,MAAM,CAACE,eAAe,CAAE,CAC1BD,wBAAwB,CAAGE,sCAAsC,CAC/DH,MAAM,CAACE,eAAe,CACvB,CACH,CAEA,GAAI,CACF,+BAAwBE,yBAAe,CAACC,iBAAiB,CACvDL,MAAM,CACNC,wBAAwB,CACzB,CAHOK,KAAK,uBAALA,KAAK,CAIb,GAAIA,KAAK,CAAE,CACT,MAAO,CAAEA,KAAK,CAALA,KAAM,CAAC,CAClB,CACA,MAAO,CAAC,CAAC,CACX,CAAE,MAAOA,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBAxBKP,WAAU,4CAwBf,CAED,GAAMI,uCAAsC,CAAG,QAAzCA,uCAAsC,CAC1CD,eAAgC,CACqB,CACrD,GAAIA,eAAe,CAACK,mBAAmB,CAAE,2BACvC,uBAAAd,2BAA2B,eAA3B,sBAA6Be,MAAM,EAAE,CACrCf,2BAA2B,CAAGJ,YAAY,CAAC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B,QAAhBA,gBAAgB,CAChBC,OAAO,QAAPA,OAAO,CACPC,QAAQ,QAARA,QAAQ,CACR/C,eAAe,QAAfA,eAAe,CAEfgD,cAAK,CAACC,SAAS,CAAC,UAAM,CACpB,GAAInB,OAAO,CAAE,CACXjC,UAAU,CAAC,CACToC,KAAK,CAALA,KAAK,CACLC,UAAU,CAAVA,UAAU,CACVC,uBAAuB,CAAvBA,uBAAuB,CACvBC,UAAU,CAAVA,UAAU,CACVC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,mBAAmB,CAAnBA,mBAAmB,CACnBC,4BAA4B,CAA5BA,4BAA4B,CAC5BC,qBAAqB,CAArBA,qBAAqB,CACrBC,qCAAqC,CAArCA,qCAAqC,CACrCC,SAAS,CAATA,SAAS,CACTC,+BAA+B,CAA/BA,+BAA+B,CAC/BC,eAAe,CAAfA,eAAe,CACfC,gBAAgB,CAAhBA,gBAAgB,CAChB7C,eAAe,CAAfA,eACF,CAAC,CAAC,CAACkD,IAAI,CAAC,SAACC,UAAU,CAAK,CACtB,GAAIA,UAAU,CAAC/C,KAAK,CAAE,CACpB2C,QAAQ,CAACI,UAAU,CAAC,CACtB,CAAC,IAAM,CACL1B,OAAO,CAAC,CACNqB,OAAO,CAAPA,OAAO,CACPf,iBAAiB,CAAjBA,iBAAiB,CACjBC,cAAc,CAAdA,cACF,CAAC,CAAC,CAACkB,IAAI,CAAC,SAACE,aAAa,CAAK,CACzBL,QAAQ,CAACK,aAAa,CAAC,CACzB,CAAC,CAAC,CACJ,CACF,CAAC,CAAC,CACJ,CAGF,CAAC,CAAE,CAACtB,OAAO,CAAC,CAAC,CAEb,MAAO,KAAI,CACb,CAKO,GAAMuB,cAAa,CAAG,CAC3BxB,SAAS,CAATA,SAAS,CACThC,UAAU,CAAVA,UAAU,CACV4B,OAAO,CAAPA,OAAO,CACPE,8BAA8B,CAA9BA,8BACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_NativeStripeSdk","eventEmitter","NativeEventEmitter","NativeModules","StripeSdk","fetchPaymentMethodsCallback","attachPaymentMethodCallback","detachPaymentMethodCallback","setSelectedPaymentOptionCallback","fetchSelectedPaymentOptionCallback","setupIntentClientSecretForCustomerAttachCallback","initialize","_ref","_asyncToGenerator2","default","params","customerAdapterOverrides","customerAdapter","configureCustomerAdapterEventListeners","_yield$NativeStripeSd","NativeStripeSdk","initCustomerSheet","error","_x","apply","arguments","fetchPaymentMethods","_fetchPaymentMethodsC","remove","addListener","paymentMethods","customerAdapterFetchPaymentMethodsCallback","Error","attachPaymentMethod","_attachPaymentMethodC","_ref4","_ref3","paymentMethodId","paymentMethod","customerAdapterAttachPaymentMethodCallback","_x2","detachPaymentMethod","_detachPaymentMethodC","_ref6","_ref5","customerAdapterDetachPaymentMethodCallback","_x3","setSelectedPaymentOption","_setSelectedPaymentOp","_ref8","_ref7","paymentOption","customerAdapterSetSelectedPaymentOptionCallback","_x4","fetchSelectedPaymentOption","_fetchSelectedPayment","customerAdapterFetchSelectedPaymentOptionCallback","setupIntentClientSecretForCustomerAttach","_setupIntentClientSec","clientSecret","customerAdapterSetupIntentClientSecretForCustomerAttachCallback","present","_ref11","length","undefined","presentCustomerSheet","retrievePaymentOptionSelection","_ref12","retrieveCustomerSheetPaymentOptionSelection","Component","_ref13","visible","presentationStyle","animationStyle","style","appearance","setupIntentClientSecret","customerId","customerEphemeralKeySecret","merchantDisplayName","headerTextForSelectionScreen","defaultBillingDetails","billingDetailsCollectionConfiguration","returnURL","removeSavedPaymentMethodMessage","applePayEnabled","googlePayEnabled","timeout","onResult","React","useEffect","then","initResult","presentResult","CustomerSheet","exports"],"sourceRoot":"../../../src","sources":["components/CustomerSheet.tsx"],"mappings":"2QAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAKA,IAAAE,gBAAA,CAAAH,sBAAA,CAAAC,OAAA,wBAUA,GAAM,CAAAG,YAAY,CAAG,GA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CAKO,GAAM,CAAAuB,aAAa,CAAAC,OAAA,CAAAD,aAAA,CAAG,CAC3BzB,SAAS,CAATA,SAAS,CACT1D,UAAU,CAAVA,UAAU,CACVkD,OAAO,CAAPA,OAAO,CACPK,8BAA8B,CAA9BA,8BACF,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');var _default=GooglePayButtonNative;exports.default=_default;
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');var _default=exports.default=GooglePayButtonNative;
2
2
  //# sourceMappingURL=GooglePayButtonNative.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GooglePayButtonNative","requireNativeComponent"],"sources":["GooglePayButtonNative.tsx"],"sourcesContent":["import { requireNativeComponent } from 'react-native';\nimport type * as GooglePayButtonComponent from '../types/components/GooglePayButtonComponent';\nconst GooglePayButtonNative =\n requireNativeComponent<GooglePayButtonComponent.NativeProps>(\n 'GooglePayButton'\n );\nexport default GooglePayButtonNative;\n"],"mappings":"gFAAA,yCAEA,GAAMA,sBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBAAiB,CAClB,CAAC,aACWD,qBAAqB"}
1
+ {"version":3,"names":["_reactNative","require","GooglePayButtonNative","requireNativeComponent","_default","exports","default"],"sourceRoot":"../../../src","sources":["components/GooglePayButtonNative.tsx"],"mappings":"gFAAA,IAAAA,YAAA,CAAAC,OAAA,iBAEA,GAAM,CAAAC,qBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CACWJ,qBAAqB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;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 _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,appearance:appearance,borderRadius:borderRadius,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:165,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],children:_reactNative.Platform.OS==='ios'?(0,_jsxRuntime.jsx)(_ApplePayButtonNative.default,Object.assign({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props)):(0,_jsxRuntime.jsx)(_GooglePayButtonNative.default,Object.assign({type:type,appearance:appearance,borderRadius:borderRadius,style:styles.nativeButtonStyle},props))});}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
2
2
  //# sourceMappingURL=PlatformPayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PlatformPayButton","type","ButtonType","Default","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style","props","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","orderTrackingCallback","NativeStripeSdk","configureOrderTracking","styles","notDisabled","Platform","OS","nativeButtonStyle","StyleSheet","create","flex","opacity"],"sources":["PlatformPayButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n TouchableOpacity,\n StyleSheet,\n Platform,\n NativeSyntheticEvent,\n} from 'react-native';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n ButtonType,\n ButtonStyle,\n ShippingMethod,\n ShippingContact,\n} from '../types/PlatformPay';\nimport GooglePayButtonNative from './GooglePayButtonNative';\nimport ApplePayButtonNative from './ApplePayButtonNative';\n\n/**\n * PlatformPayButton Component Props\n */\nexport interface Props extends AccessibilityProps {\n /** Sets the text displayed by the button. */\n type?: ButtonType;\n /** Sets the coloring of the button. */\n appearance?: ButtonStyle;\n /** Sets the border radius of the button. */\n borderRadius?: number;\n /** Function called whenever the button is pressed. */\n onPress(): void;\n /** Set to `true` to disable the button from being pressed & apply a slight opacity to indicate that it is unpressable. Defaults to false. */\n disabled?: boolean;\n /**\n * This callback is triggered whenever the user selects a shipping method in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingMethod` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingMethodSelected?: (event: {\n shippingMethod: ShippingMethod;\n }) => void;\n /**\n * This callback is triggered whenever the user selects a shipping contact in the Apple Pay sheet IF\n * ContactField.PostalAddress was included in the requiredShippingAddressFields array.\n * It receives one parameter: an `event` object with a `shippingContact` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingContactSelected?: (event: {\n shippingContact: ShippingContact;\n }) => void;\n /**\n * This callback is triggered whenever the user inputs a coupon code in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `couponCode` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onCouponCodeEntered?: (event: { couponCode: string }) => void;\n /** Callback function for setting the order details (retrieved from your server) to give users the\n * ability to track and manage their purchases in Wallet. Stripe calls your implementation after the\n * payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion`\n * function, or else the Apple Pay sheet will hang.*/\n setOrderTracking?: (\n completion: (\n orderIdentifier: string,\n orderTypeIdentifier: string,\n authenticationToken: string,\n webServiceUrl: string\n ) => void\n ) => void;\n testID?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * PlatformPayButton Component. Display the platform-specific native wallet pay button: Apple Pay on iOS, and Google Pay on Android.\n *\n * @example\n * ```ts\n * <PlatformPayButton\n * onPress={pay}\n * type={PlatformPay.ButtonType.Subscribe}\n * appearance={PlatformPay.ButtonStyle.WhiteOutline}\n * borderRadius={4}\n * disabled={!isApplePaySupported}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function PlatformPayButton({\n type = ButtonType.Default,\n appearance = ButtonStyle.Automatic,\n onPress,\n disabled,\n borderRadius,\n onShippingMethodSelected,\n onShippingContactSelected,\n onCouponCodeEntered,\n setOrderTracking,\n style,\n ...props\n}: Props) {\n const shippingMethodCallback = onShippingMethodSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => {\n onShippingMethodSelected && onShippingMethodSelected(value.nativeEvent);\n }\n : undefined;\n\n const shippingContactCallback = onShippingContactSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => {\n onShippingContactSelected(value.nativeEvent);\n }\n : undefined;\n\n const couponCodeCallback = onCouponCodeEntered\n ? (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => {\n onCouponCodeEntered && onCouponCodeEntered(value.nativeEvent);\n }\n : undefined;\n\n const orderTrackingCallback = setOrderTracking\n ? () => {\n setOrderTracking(NativeStripeSdk.configureOrderTracking);\n }\n : undefined;\n\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={disabled ? 0.3 : 1}\n onPress={onPress}\n style={[disabled ? styles.disabled : styles.notDisabled, style]}\n >\n {Platform.OS === 'ios' ? (\n <ApplePayButtonNative\n type={type}\n buttonStyle={appearance}\n borderRadius={borderRadius}\n disabled={disabled}\n onShippingMethodSelectedAction={shippingMethodCallback}\n onShippingContactSelectedAction={shippingContactCallback}\n onCouponCodeEnteredAction={couponCodeCallback}\n onOrderTrackingAction={orderTrackingCallback}\n style={styles.nativeButtonStyle}\n {...props}\n />\n ) : (\n <GooglePayButtonNative\n type={type}\n appearance={appearance}\n borderRadius={borderRadius}\n style={styles.nativeButtonStyle}\n {...props}\n />\n )}\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n flex: 0,\n opacity: 0.4,\n },\n notDisabled: {\n flex: 0,\n },\n nativeButtonStyle: { flex: 1 },\n});\n"],"mappings":"wXAAA,oDACA,yCASA,2EACA,iDAMA,sFACA,oFAA0D,qRA4EnD,QAASA,kBAAiB,MAYvB,oBAXRC,IAAI,CAAJA,IAAI,oBAAGC,uBAAU,CAACC,OAAO,gCACzBC,UAAU,CAAVA,UAAU,0BAAGC,wBAAW,CAACC,SAAS,iBAClCC,OAAO,MAAPA,OAAO,CACPC,QAAQ,MAARA,QAAQ,CACRC,YAAY,MAAZA,YAAY,CACZC,wBAAwB,MAAxBA,wBAAwB,CACxBC,yBAAyB,MAAzBA,yBAAyB,CACzBC,mBAAmB,MAAnBA,mBAAmB,CACnBC,gBAAgB,MAAhBA,gBAAgB,CAChBC,KAAK,MAALA,KAAK,CACFC,KAAK,uDAER,GAAMC,uBAAsB,CAAGN,wBAAwB,CACnD,SACEO,KAEE,CACC,CACHP,wBAAwB,EAAIA,wBAAwB,CAACO,KAAK,CAACC,WAAW,CAAC,CACzE,CAAC,CACDC,SAAS,CAEb,GAAMC,wBAAuB,CAAGT,yB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CACPC,OAAO,CAAE,GACX,CAAC,CACDP,WAAW,CAAE,CACXM,IAAI,CAAE,CACR,CAAC,CACDH,iBAAiB,CAAE,CAAEG,IAAI,CAAE,CAAE,CAC/B,CAAC,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_NativeStripeSdk","_PlatformPay","_GooglePayButtonNative","_ApplePayButtonNative","_jsxRuntime","_jsxFileName","_excluded","PlatformPayButton","_ref","_ref$type","type","ButtonType","Default","_ref$appearance","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style","props","_objectWithoutProperties2","default","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","orderTrackingCallback","NativeStripeSdk","configureOrderTracking","jsx","TouchableOpacity","activeOpacity","styles","notDisabled","children","Platform","OS","Object","assign","buttonStyle","onShippingMethodSelectedAction","onShippingContactSelectedAction","onCouponCodeEnteredAction","onOrderTrackingAction","nativeButtonStyle","StyleSheet","create","flex","opacity"],"sourceRoot":"../../../src","sources":["components/PlatformPayButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,gBAAA,CAAAH,sBAAA,CAAAC,OAAA,wBACA,IAAAG,YAAA,CAAAH,OAAA,yBAMA,IAAAI,sBAAA,CAAAL,sBAAA,CAAAC,OAAA,6BACA,IAAAK,qBAAA,CAAAN,sBAAA,CAAAC,OAAA,4BAA0D,IAAAM,WAAA,CAAAN,OAAA,0BAAAO,YAAA,4FAAAC,SAAA,mKA4EnD,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAYvB,KAAAC,SAAA,CAAAD,IAAA,CAXRE,IAAI,CAAJA,IAAI,CAAAD,SAAA,UAAGE,uBAAU,CAACC,OAAO,CAAAH,SAAA,CAAAI,eAAA,CAAAL,IAAA,CACzBM,UAAU,CAAVA,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AE,CAACN,QAAQ,CAAGsB,MAAM,CAACtB,QAAQ,CAAGsB,MAAM,CAACC,WAAW,CAAEjB,KAAK,CAAE,CAAAkB,QAAA,CAE/DC,qBAAQ,CAACC,EAAE,GAAK,KAAK,CACpB,GAAAxC,WAAA,CAAAiC,GAAA,EAAClC,qBAAA,CAAAwB,OAAoB,CAAAkB,MAAA,CAAAC,MAAA,EACnBpC,IAAI,CAAEA,IAAK,CACXqC,WAAW,CAAEjC,UAAW,CACxBK,YAAY,CAAEA,YAAa,CAC3BD,QAAQ,CAAEA,QAAS,CACnB8B,8BAA8B,CAAEpB,sBAAuB,CACvDqB,+BAA+B,CAAEjB,uBAAwB,CACzDkB,yBAAyB,CAAEjB,kBAAmB,CAC9CkB,qBAAqB,CAAEjB,qBAAsB,CAC7CV,KAAK,CAAEgB,MAAM,CAACY,iBAAkB,EAC5B3B,KAAK,CACV,CAAC,CAEF,GAAArB,WAAA,CAAAiC,GAAA,EAACnC,sBAAA,CAAAyB,OAAqB,CAAAkB,MAAA,CAAAC,MAAA,EACpBpC,IAAI,CAAEA,IAAK,CACXI,UAAU,CAAEA,UAAW,CACvBK,YAAY,CAAEA,YAAa,CAC3BK,KAAK,CAAEgB,MAAM,CAACY,iBAAkB,EAC5B3B,KAAK,CACV,CACF,CACe,CAAC,CAEvB,CAEA,GAAM,CAAAe,MAAM,CAAGa,uBAAU,CAACC,MAAM,CAAC,CAC/BpC,QAAQ,CAAE,CACRqC,IAAI,CAAE,CAAC,CACPC,OAAO,CAAE,GACX,CAAC,CACDf,WAAW,CAAE,CACXc,IAAI,CAAE,CACR,CAAC,CACDH,iBAAiB,CAAE,CAAEG,IAAI,CAAE,CAAE,CAC/B,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return(0,_jsxRuntime.jsx)(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,accessible:false,children:children})});}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
2
2
  //# sourceMappingURL=StripeContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["StripeContainerNative","requireNativeComponent","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"sources":["StripeContainer.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"mappings":"oLAAA,oDAEA,yCAMsB,mGAEtB,GAAMA,sBAAqB,CAAG,GAAAC,mCAAsB,EAAM,iBAAiB,CAAC,CAkBrE,QAASC,gBAAe,MAGrB,IAFRC,0BAAyB,MAAzBA,yBAAyB,CACzBC,QAAQ,MAARA,QAAQ,CAER,MACE,8BAAC,qBAAqB,EACpB,yBAAyB,CAAED,yBAA0B,CACrD,KAAK,CAAEE,MAAM,CAACC,SAAU,4EAExB,6BAAC,iBAAI,EAAC,KAAK,CAAED,MAAM,CAACC,SAAU,CAAC,UAAU,CAAE,KAAM,4EAC9CF,QAAQ,CACJ,CACe,CAE5B,CAEA,GAAMC,OAAM,CAAGE,uBAAU,CAACC,MAAM,CAAC,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CACR,CACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","StripeContainerNative","requireNativeComponent","StripeContainer","_ref","keyboardShouldPersistTaps","children","jsx","style","styles","container","View","accessible","StyleSheet","create","flex"],"sourceRoot":"../../../src","sources":["components/StripeContainer.tsx"],"mappings":"oLAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,YAAA,CAAAD,OAAA,iBAMsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,sFAEtB,GAAM,CAAAC,qBAAqB,CAAG,GAAAC,mCAAsB,EAAM,iBAAiB,CAAC,CAkBrE,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAGrB,IAFR,CAAAC,yBAAyB,CAAAD,IAAA,CAAzBC,yBAAyB,CACzBC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAER,MACE,GAAAP,WAAA,CAAAQ,GAAA,EAACN,qBAAqB,EACpBI,yBAAyB,CAAEA,yBAA0B,CACrDG,KAAK,CAAEC,MAAM,CAACC,SAAU,CAAAJ,QAAA,CAExB,GAAAP,WAAA,CAAAQ,GAAA,EAACT,YAAA,CAAAa,IAAI,EAACH,KAAK,CAAEC,MAAM,CAACC,SAAU,CAACE,UAAU,CAAE,KAAM,CAAAN,QAAA,CAC9CA,QAAQ,CACL,CAAC,CACc,CAAC,CAE5B,CAEA,GAAM,CAAAG,MAAM,CAAGI,uBAAU,CAACC,MAAM,CAAC,CAC/BJ,SAAS,CAAE,CACTK,IAAI,CAAE,CACR,CACF,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeProvider=StripeProvider;exports.initStripe=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=_interopRequireWildcard(require("react"));var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _helpers=require("../helpers");var _package=_interopRequireDefault(require("../../../package.json"));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 EXPO_PARTNER_ID='pp_partner_JBN7LkABco2yUu';var repository=_package.default.repository;var appInfo={name:(0,_helpers.shouldAttributeExpo)()?_package.default.name+"/expo":_package.default.name,url:repository.url||repository,version:_package.default.version,partnerId:(0,_helpers.shouldAttributeExpo)()?EXPO_PARTNER_ID:undefined};var initStripe=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var extendedParams=Object.assign({},params,{appInfo:appInfo});_NativeStripeSdk.default.initialise(extendedParams);});return function initStripe(_x){return _ref.apply(this,arguments);};}();exports.initStripe=initStripe;function StripeProvider(_ref2){var children=_ref2.children,publishableKey=_ref2.publishableKey,merchantIdentifier=_ref2.merchantIdentifier,threeDSecureParams=_ref2.threeDSecureParams,stripeAccountId=_ref2.stripeAccountId,urlScheme=_ref2.urlScheme,setReturnUrlSchemeOnAndroid=_ref2.setReturnUrlSchemeOnAndroid;(0,_react.useEffect)(function(){if(!publishableKey){return;}if(_helpers.isAndroid){_NativeStripeSdk.default.initialise({publishableKey:publishableKey,appInfo:appInfo,stripeAccountId:stripeAccountId,threeDSecureParams:threeDSecureParams,urlScheme:urlScheme,setReturnUrlSchemeOnAndroid:setReturnUrlSchemeOnAndroid});}else{_NativeStripeSdk.default.initialise({publishableKey:publishableKey,appInfo:appInfo,stripeAccountId:stripeAccountId,threeDSecureParams:threeDSecureParams,merchantIdentifier:merchantIdentifier,urlScheme:urlScheme});}},[publishableKey,merchantIdentifier,stripeAccountId,threeDSecureParams,urlScheme,setReturnUrlSchemeOnAndroid]);return _react.default.createElement(_react.default.Fragment,null,children);}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeProvider=StripeProvider;exports.initStripe=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=_interopRequireWildcard(require("react"));var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _helpers=require("../helpers");var _package=_interopRequireDefault(require("../../../package.json"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var EXPO_PARTNER_ID='pp_partner_JBN7LkABco2yUu';var repository=_package.default.repository;var appInfo={name:(0,_helpers.shouldAttributeExpo)()?`${_package.default.name}/expo`:_package.default.name,url:repository.url||repository,version:_package.default.version,partnerId:(0,_helpers.shouldAttributeExpo)()?EXPO_PARTNER_ID:undefined};var initStripe=exports.initStripe=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){if(_reactNative.Platform.OS==='android'){var stripeHeadlessTask=function stripeHeadlessTask(){return new Promise(function(){});};_reactNative.AppRegistry.registerHeadlessTask('StripeKeepJsAwakeTask',function(){return stripeHeadlessTask;});}var extendedParams=Object.assign({},params,{appInfo:appInfo});_NativeStripeSdk.default.initialise(extendedParams);});return function initStripe(_x){return _ref.apply(this,arguments);};}();function StripeProvider(_ref2){var children=_ref2.children,publishableKey=_ref2.publishableKey,merchantIdentifier=_ref2.merchantIdentifier,threeDSecureParams=_ref2.threeDSecureParams,stripeAccountId=_ref2.stripeAccountId,urlScheme=_ref2.urlScheme,setReturnUrlSchemeOnAndroid=_ref2.setReturnUrlSchemeOnAndroid;(0,_react.useEffect)(function(){if(!publishableKey){return;}if(_helpers.isAndroid){_NativeStripeSdk.default.initialise({publishableKey:publishableKey,appInfo:appInfo,stripeAccountId:stripeAccountId,threeDSecureParams:threeDSecureParams,urlScheme:urlScheme,setReturnUrlSchemeOnAndroid:setReturnUrlSchemeOnAndroid});}else{_NativeStripeSdk.default.initialise({publishableKey:publishableKey,appInfo:appInfo,stripeAccountId:stripeAccountId,threeDSecureParams:threeDSecureParams,merchantIdentifier:merchantIdentifier,urlScheme:urlScheme});}},[publishableKey,merchantIdentifier,stripeAccountId,threeDSecureParams,urlScheme,setReturnUrlSchemeOnAndroid]);return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:children});}
2
2
  //# sourceMappingURL=StripeProvider.js.map