@stripe/stripe-react-native 0.13.1 → 0.16.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 (219) hide show
  1. package/.editorconfig +15 -0
  2. package/CHANGELOG.md +68 -11
  3. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  4. package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  5. package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/7.1/gc.properties +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  10. package/android/.gradle/checksums/checksums.lock +0 -0
  11. package/android/.gradle/vcs-1/gc.properties +0 -0
  12. package/android/.idea/gradle.xml +13 -0
  13. package/android/.idea/misc.xml +9 -0
  14. package/android/.idea/modules/android.iml +18 -0
  15. package/android/.idea/modules.xml +8 -0
  16. package/android/.idea/vcs.xml +6 -0
  17. package/android/build.gradle +6 -0
  18. package/android/local.properties +8 -0
  19. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +2 -0
  20. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +28 -6
  21. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +34 -3
  22. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +5 -0
  23. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +17 -7
  24. package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +4 -0
  25. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +3 -0
  26. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +213 -367
  27. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -0
  28. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +48 -28
  29. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +69 -23
  30. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +1 -2
  31. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +19 -7
  32. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +46 -39
  33. package/android/src/main/java/com/reactnativestripesdk/{Errors.kt → utils/Errors.kt} +1 -1
  34. package/android/src/main/java/com/reactnativestripesdk/{Extensions.kt → utils/Extensions.kt} +1 -1
  35. package/android/src/main/java/com/reactnativestripesdk/{Mappers.kt → utils/Mappers.kt} +19 -1
  36. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +18 -0
  37. package/android/src/main/res/{drawable-night/googlepay_button_background.xml → drawable/googlepay_button_background_dark.xml} +1 -1
  38. package/android/src/main/res/{drawable-night/googlepay_button_content.xml → drawable/googlepay_button_content_dark.xml} +0 -0
  39. package/android/src/main/res/{drawable-night/googlepay_button_overlay.xml → drawable/googlepay_button_overlay_dark.xml} +0 -0
  40. package/android/src/main/res/{drawable-night/pay_with_googlepay_button_content.xml → drawable/pay_with_googlepay_button_content_dark.xml} +0 -0
  41. package/android/src/main/res/{drawable-ar-night/pay_with_googlepay_button_content.xml → drawable-ar/pay_with_googlepay_button_content_dark.xml} +0 -0
  42. package/android/src/main/res/{drawable-bg-night/pay_with_googlepay_button_content.xml → drawable-bg/pay_with_googlepay_button_content_dark.xml} +0 -0
  43. package/android/src/main/res/{drawable-ca-night/pay_with_googlepay_button_content.xml → drawable-ca/pay_with_googlepay_button_content_dark.xml} +0 -0
  44. package/android/src/main/res/{drawable-cs-night/pay_with_googlepay_button_content.xml → drawable-cs/pay_with_googlepay_button_content_dark.xml} +0 -0
  45. package/android/src/main/res/{drawable-da-night/pay_with_googlepay_button_content.xml → drawable-da/pay_with_googlepay_button_content_dark.xml} +0 -0
  46. package/android/src/main/res/{drawable-de-night/pay_with_googlepay_button_content.xml → drawable-de/pay_with_googlepay_button_content_dark.xml} +0 -0
  47. package/android/src/main/res/{drawable-el-night/pay_with_googlepay_button_content.xml → drawable-el/pay_with_googlepay_button_content_dark.xml} +0 -0
  48. package/android/src/main/res/{drawable-es-night/pay_with_googlepay_button_content.xml → drawable-es/pay_with_googlepay_button_content_dark.xml} +0 -0
  49. package/android/src/main/res/{drawable-et-night/pay_with_googlepay_button_content.xml → drawable-et/pay_with_googlepay_button_content_dark.xml} +0 -0
  50. package/android/src/main/res/{drawable-fi-night/pay_with_googlepay_button_content.xml → drawable-fi/pay_with_googlepay_button_content_dark.xml} +0 -0
  51. package/android/src/main/res/{drawable-fr-night/pay_with_googlepay_button_content.xml → drawable-fr/pay_with_googlepay_button_content_dark.xml} +0 -0
  52. package/android/src/main/res/{drawable-night-hdpi/googlepay_button_background_image.9.png → drawable-hdpi/googlepay_button_background_image_dark.9.png} +0 -0
  53. package/android/src/main/res/{drawable-hr-night/pay_with_googlepay_button_content.xml → drawable-hr/pay_with_googlepay_button_content_dark.xml} +0 -0
  54. package/android/src/main/res/{drawable-id-night/pay_with_googlepay_button_content.xml → drawable-id/pay_with_googlepay_button_content_dark.xml} +0 -0
  55. package/android/src/main/res/{drawable-it-night/pay_with_googlepay_button_content.xml → drawable-it/pay_with_googlepay_button_content_dark.xml} +0 -0
  56. package/android/src/main/res/{drawable-ja-night/pay_with_googlepay_button_content.xml → drawable-ja/pay_with_googlepay_button_content_dark.xml} +0 -0
  57. package/android/src/main/res/{drawable-ko-night/pay_with_googlepay_button_content.xml → drawable-ko/pay_with_googlepay_button_content_dark.xml} +0 -0
  58. package/android/src/main/res/{drawable-night-mdpi/googlepay_button_background_image.9.png → drawable-mdpi/googlepay_button_background_image_dark.9.png} +0 -0
  59. package/android/src/main/res/{drawable-ms-night/pay_with_googlepay_button_content.xml → drawable-ms/pay_with_googlepay_button_content_dark.xml} +0 -0
  60. package/android/src/main/res/{drawable-nl-night/pay_with_googlepay_button_content.xml → drawable-nl/pay_with_googlepay_button_content_dark.xml} +0 -0
  61. package/android/src/main/res/{drawable-no-night/pay_with_googlepay_button_content.xml → drawable-no/pay_with_googlepay_button_content_dark.xml} +0 -0
  62. package/android/src/main/res/{drawable-pl-night/pay_with_googlepay_button_content.xml → drawable-pl/pay_with_googlepay_button_content_dark.xml} +0 -0
  63. package/android/src/main/res/{drawable-pt-night/pay_with_googlepay_button_content.xml → drawable-pt/pay_with_googlepay_button_content_dark.xml} +0 -0
  64. package/android/src/main/res/{drawable-ru-night/pay_with_googlepay_button_content.xml → drawable-ru/pay_with_googlepay_button_content_dark.xml} +0 -0
  65. package/android/src/main/res/{drawable-sk-night/pay_with_googlepay_button_content.xml → drawable-sk/pay_with_googlepay_button_content_dark.xml} +0 -0
  66. package/android/src/main/res/{drawable-sl-night/pay_with_googlepay_button_content.xml → drawable-sl/pay_with_googlepay_button_content_dark.xml} +0 -0
  67. package/android/src/main/res/{drawable-sr-night/pay_with_googlepay_button_content.xml → drawable-sr/pay_with_googlepay_button_content_dark.xml} +0 -0
  68. package/android/src/main/res/{drawable-sv-night/pay_with_googlepay_button_content.xml → drawable-sv/pay_with_googlepay_button_content_dark.xml} +0 -0
  69. package/android/src/main/res/{drawable-th-night/pay_with_googlepay_button_content.xml → drawable-th/pay_with_googlepay_button_content_dark.xml} +0 -0
  70. package/android/src/main/res/{drawable-tr-night/pay_with_googlepay_button_content.xml → drawable-tr/pay_with_googlepay_button_content_dark.xml} +0 -0
  71. package/android/src/main/res/{drawable-uk-night/pay_with_googlepay_button_content.xml → drawable-uk/pay_with_googlepay_button_content_dark.xml} +0 -0
  72. package/android/src/main/res/{drawable-night-v21/googlepay_button_background.xml → drawable-v21/googlepay_button_background_dark.xml} +1 -1
  73. package/android/src/main/res/{drawable-night-xhdpi/googlepay_button_background_image.9.png → drawable-xhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  74. package/android/src/main/res/{drawable-night-xxhdpi/googlepay_button_background_image.9.png → drawable-xxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  75. package/android/src/main/res/{drawable-night-xxxhdpi/googlepay_button_background_image.9.png → drawable-xxxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  76. package/android/src/main/res/{layout-night/googlepay_button.xml → layout/googlepay_button_dark.xml} +4 -4
  77. package/android/src/main/res/{layout-night/pay_with_googlepay_button.xml → layout/pay_with_googlepay_button_dark.xml} +4 -4
  78. package/ios/ApplePayUtils.swift +159 -0
  79. package/ios/CardFieldView.swift +11 -8
  80. package/ios/CardFormView.swift +20 -0
  81. package/ios/Mappers.swift +8 -13
  82. package/ios/PaymentMethodFactory.swift +9 -0
  83. package/ios/StripeSdk.m +5 -0
  84. package/ios/StripeSdk.swift +60 -53
  85. package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  86. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  87. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  88. package/ios/StripeSdk.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +52 -0
  89. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +22 -0
  90. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
  91. package/ios/Tests/ApplePayUtilsTests.swift +214 -0
  92. package/ios/Tests/PushProvisioningTests.swift +49 -0
  93. package/ios/pushprovisioning/AddToWalletButtonView.swift +1 -5
  94. package/ios/pushprovisioning/PushProvisioningUtils.swift +64 -0
  95. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  96. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  97. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  98. package/lib/commonjs/components/ApplePayButton.js +1 -1
  99. package/lib/commonjs/components/ApplePayButton.js.map +1 -1
  100. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  101. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  102. package/lib/commonjs/components/CardField.js +1 -1
  103. package/lib/commonjs/components/CardField.js.map +1 -1
  104. package/lib/commonjs/components/CardForm.js +1 -1
  105. package/lib/commonjs/components/CardForm.js.map +1 -1
  106. package/lib/commonjs/components/GooglePayButton.js +1 -1
  107. package/lib/commonjs/components/GooglePayButton.js.map +1 -1
  108. package/lib/commonjs/components/StripeContainer.js +1 -1
  109. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  110. package/lib/commonjs/functions.js +1 -1
  111. package/lib/commonjs/functions.js.map +1 -1
  112. package/lib/commonjs/hooks/useStripe.js +1 -1
  113. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  114. package/lib/commonjs/types/index.js.map +1 -1
  115. package/lib/module/NativeStripeSdk.js.map +1 -1
  116. package/lib/module/components/AddToWalletButton.js +1 -1
  117. package/lib/module/components/AddToWalletButton.js.map +1 -1
  118. package/lib/module/components/ApplePayButton.js +1 -1
  119. package/lib/module/components/ApplePayButton.js.map +1 -1
  120. package/lib/module/components/AuBECSDebitForm.js +1 -1
  121. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  122. package/lib/module/components/CardField.js +1 -1
  123. package/lib/module/components/CardField.js.map +1 -1
  124. package/lib/module/components/CardForm.js +1 -1
  125. package/lib/module/components/CardForm.js.map +1 -1
  126. package/lib/module/components/GooglePayButton.js +1 -1
  127. package/lib/module/components/GooglePayButton.js.map +1 -1
  128. package/lib/module/components/StripeContainer.js +1 -1
  129. package/lib/module/components/StripeContainer.js.map +1 -1
  130. package/lib/module/functions.js +1 -1
  131. package/lib/module/functions.js.map +1 -1
  132. package/lib/module/hooks/useStripe.js +1 -1
  133. package/lib/module/hooks/useStripe.js.map +1 -1
  134. package/lib/module/types/index.js.map +1 -1
  135. package/lib/typescript/src/NativeStripeSdk.d.ts +2 -1
  136. package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
  137. package/lib/typescript/src/components/CardForm.d.ts +1 -1
  138. package/lib/typescript/src/components/GooglePayButton.d.ts +2 -2
  139. package/lib/typescript/src/functions.d.ts +2 -1
  140. package/lib/typescript/src/hooks/useStripe.d.ts +2 -1
  141. package/lib/typescript/src/types/ApplePay.d.ts +31 -5
  142. package/lib/typescript/src/types/PaymentMethod.d.ts +9 -1
  143. package/lib/typescript/src/types/PaymentSheet.d.ts +19 -16
  144. package/lib/typescript/src/types/index.d.ts +20 -0
  145. package/package.json +7 -15
  146. package/src/NativeStripeSdk.tsx +5 -0
  147. package/src/components/AddToWalletButton.tsx +1 -1
  148. package/src/components/CardForm.tsx +2 -2
  149. package/src/components/GooglePayButton.tsx +8 -2
  150. package/src/functions.ts +25 -0
  151. package/src/hooks/useStripe.tsx +13 -0
  152. package/src/types/ApplePay.ts +39 -6
  153. package/src/types/PaymentMethod.ts +11 -1
  154. package/src/types/PaymentSheet.ts +34 -35
  155. package/src/types/index.ts +27 -0
  156. package/stripe-react-native.podspec +6 -1
  157. package/android/src/main/res/drawable-night/googlepay_button_no_shadow_background.xml +0 -6
  158. package/android/src/main/res/drawable-night-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  159. package/android/src/main/res/drawable-night-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  160. package/android/src/main/res/drawable-night-v21/googlepay_button_no_shadow_background.xml +0 -7
  161. package/android/src/main/res/drawable-night-xhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  162. package/android/src/main/res/drawable-night-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  163. package/android/src/main/res/drawable-night-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  164. package/android/src/main/res/values-night/googlepay_strings.xml +0 -12
  165. package/lib/typescript/e2e/buyNowPayLater.test.d.ts +0 -1
  166. package/lib/typescript/e2e/helpers.d.ts +0 -5
  167. package/lib/typescript/e2e/payments.test.d.ts +0 -1
  168. package/lib/typescript/e2e/paymentsWithRedirects.test.d.ts +0 -1
  169. package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +0 -17
  170. package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +0 -6
  171. package/lib/typescript/e2e/screenObject/components/BECSForm.d.ts +0 -8
  172. package/lib/typescript/e2e/screenObject/components/CardField.d.ts +0 -10
  173. package/lib/typescript/example/server/index.d.ts +0 -1
  174. package/lib/typescript/example/server/utils.d.ts +0 -11
  175. package/lib/typescript/example/src/App.d.ts +0 -45
  176. package/lib/typescript/example/src/Config.d.ts +0 -2
  177. package/lib/typescript/example/src/colors.d.ts +0 -8
  178. package/lib/typescript/example/src/components/Button.d.ts +0 -11
  179. package/lib/typescript/example/src/components/Collapse.d.ts +0 -6
  180. package/lib/typescript/example/src/components/PaymentScreen.d.ts +0 -7
  181. package/lib/typescript/example/src/helpers.d.ts +0 -1
  182. package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +0 -1
  183. package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +0 -1
  184. package/lib/typescript/example/src/screens/AfterpayClearpayPaymentScreen.d.ts +0 -1
  185. package/lib/typescript/example/src/screens/AlipayPaymentScreen.d.ts +0 -1
  186. package/lib/typescript/example/src/screens/ApplePayScreen.d.ts +0 -1
  187. package/lib/typescript/example/src/screens/AuBECSDebitPaymentScreen.d.ts +0 -1
  188. package/lib/typescript/example/src/screens/AuBECSDebitSetupPaymentScreen.d.ts +0 -1
  189. package/lib/typescript/example/src/screens/BancontactPaymentScreen.d.ts +0 -1
  190. package/lib/typescript/example/src/screens/BancontactSetupFuturePaymentScreen.d.ts +0 -1
  191. package/lib/typescript/example/src/screens/CVCReCollectionScreen.d.ts +0 -1
  192. package/lib/typescript/example/src/screens/CreateTokenScreen.d.ts +0 -1
  193. package/lib/typescript/example/src/screens/EPSPaymentScreen.d.ts +0 -1
  194. package/lib/typescript/example/src/screens/FPXPaymentScreen.d.ts +0 -1
  195. package/lib/typescript/example/src/screens/GiropayPaymentScreen.d.ts +0 -1
  196. package/lib/typescript/example/src/screens/GooglePayScreen.d.ts +0 -1
  197. package/lib/typescript/example/src/screens/GrabPayPaymentScreen.d.ts +0 -1
  198. package/lib/typescript/example/src/screens/HomeScreen.d.ts +0 -1
  199. package/lib/typescript/example/src/screens/IdealPaymentScreen.d.ts +0 -1
  200. package/lib/typescript/example/src/screens/IdealSetupFuturePaymentScreen.d.ts +0 -1
  201. package/lib/typescript/example/src/screens/KlarnaPaymentScreen.d.ts +0 -1
  202. package/lib/typescript/example/src/screens/MultilineWebhookPaymentScreen.d.ts +0 -1
  203. package/lib/typescript/example/src/screens/NoWebhookPaymentScreen.d.ts +0 -1
  204. package/lib/typescript/example/src/screens/OxxoPaymentScreen.d.ts +0 -1
  205. package/lib/typescript/example/src/screens/P24PaymentScreen.d.ts +0 -1
  206. package/lib/typescript/example/src/screens/PayPalScreen.d.ts +0 -1
  207. package/lib/typescript/example/src/screens/PaymentResultScreen.d.ts +0 -8
  208. package/lib/typescript/example/src/screens/PaymentSheetAppearance.d.ts +0 -3
  209. package/lib/typescript/example/src/screens/PaymentsUICompleteScreen.d.ts +0 -1
  210. package/lib/typescript/example/src/screens/PaymentsUICustomScreen.d.ts +0 -1
  211. package/lib/typescript/example/src/screens/SepaPaymentScreen.d.ts +0 -1
  212. package/lib/typescript/example/src/screens/SepaSetupFuturePaymentScreen.d.ts +0 -1
  213. package/lib/typescript/example/src/screens/SetupFuturePaymentScreen.d.ts +0 -1
  214. package/lib/typescript/example/src/screens/SofortPaymentScreen.d.ts +0 -1
  215. package/lib/typescript/example/src/screens/SofortSetupFuturePaymentScreen.d.ts +0 -1
  216. package/lib/typescript/example/src/screens/WebhookPaymentScreen.d.ts +0 -1
  217. package/lib/typescript/src/plugin/__tests__/withStripe-test.d.ts +0 -1
  218. package/src/plugin/__tests__/fixtures/sample-AndroidManifest.xml +0 -24
  219. package/src/plugin/__tests__/withStripe-test.ts +0 -111
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "1340"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ </BuildAction>
9
+ <TestAction
10
+ buildConfiguration = "Debug"
11
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13
+ shouldUseLaunchSchemeArgsEnv = "YES">
14
+ <Testables>
15
+ <TestableReference
16
+ skipped = "NO">
17
+ <BuildableReference
18
+ BuildableIdentifier = "primary"
19
+ BlueprintIdentifier = "FC55C2D928620B7D00526360"
20
+ BuildableName = "Tests.xctest"
21
+ BlueprintName = "Tests"
22
+ ReferencedContainer = "container:StripeSdk.xcodeproj">
23
+ </BuildableReference>
24
+ </TestableReference>
25
+ </Testables>
26
+ </TestAction>
27
+ <LaunchAction
28
+ buildConfiguration = "Debug"
29
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31
+ launchStyle = "0"
32
+ useCustomWorkingDirectory = "NO"
33
+ ignoresPersistentStateOnLaunch = "NO"
34
+ debugDocumentVersioning = "YES"
35
+ debugServiceExtension = "internal"
36
+ allowLocationSimulation = "YES">
37
+ </LaunchAction>
38
+ <ProfileAction
39
+ buildConfiguration = "Release"
40
+ shouldUseLaunchSchemeArgsEnv = "YES"
41
+ savedToolIdentifier = ""
42
+ useCustomWorkingDirectory = "NO"
43
+ debugDocumentVersioning = "YES">
44
+ </ProfileAction>
45
+ <AnalyzeAction
46
+ buildConfiguration = "Debug">
47
+ </AnalyzeAction>
48
+ <ArchiveAction
49
+ buildConfiguration = "Release"
50
+ revealArchiveInOrganizer = "YES">
51
+ </ArchiveAction>
52
+ </Scheme>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Bucket
3
+ uuid = "18A7FEF5-1FA3-4609-B152-0287F2E115A0"
4
+ type = "1"
5
+ version = "2.0">
6
+ <Breakpoints>
7
+ <BreakpointProxy
8
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
+ <BreakpointContent
10
+ uuid = "C0FB3E07-7654-41DA-96B5-07363EE2CDC7"
11
+ shouldBeEnabled = "Yes"
12
+ ignoreCount = "0"
13
+ continueAfterRunningActions = "No"
14
+ filePath = "ApplePayButtonManager.m"
15
+ startingColumnNumber = "9223372036854775807"
16
+ endingColumnNumber = "9223372036854775807"
17
+ startingLineNumber = "11"
18
+ endingLineNumber = "11">
19
+ </BreakpointContent>
20
+ </BreakpointProxy>
21
+ </Breakpoints>
22
+ </Bucket>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>StripeSdk.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ <key>Tests.xcscheme_^#shared#^_</key>
13
+ <dict>
14
+ <key>orderHint</key>
15
+ <integer>1</integer>
16
+ </dict>
17
+ </dict>
18
+ <key>SuppressBuildableAutocreation</key>
19
+ <dict>
20
+ <key>FC55C2D928620B7D00526360</key>
21
+ <dict>
22
+ <key>primary</key>
23
+ <true/>
24
+ </dict>
25
+ </dict>
26
+ </dict>
27
+ </plist>
@@ -0,0 +1,214 @@
1
+ //
2
+ // Tests.swift
3
+ // Tests
4
+ //
5
+ // Created by Charles Cruzan on 6/21/22.
6
+ // Copyright © 2022 Facebook. All rights reserved.
7
+ //
8
+
9
+ import XCTest
10
+ @testable import stripe_react_native
11
+ import PassKit
12
+
13
+ @available(iOS 15.0, *)
14
+ class ApplePayUtilsTests: XCTestCase {
15
+
16
+ func test_buildPaymentSheetApplePayConfig_FailsWithoutMerchantIdentifier() throws {
17
+ XCTAssertThrowsError(
18
+ try ApplePayUtils.buildPaymentSheetApplePayConfig(merchantIdentifier: nil, merchantCountryCode: "", paymentSummaryItems: nil)
19
+ ) { error in
20
+ XCTAssertEqual(
21
+ error as! ApplePayUtilsError, ApplePayUtilsError.missingMerchantId
22
+ )
23
+ }
24
+ }
25
+
26
+ func test_buildPaymentSheetApplePayConfig_FailsWithoutCountryCode() throws {
27
+ XCTAssertThrowsError(
28
+ try ApplePayUtils.buildPaymentSheetApplePayConfig(merchantIdentifier: TestFixtures.MERCHANT_ID, merchantCountryCode: nil, paymentSummaryItems: nil)
29
+ ) { error in
30
+ XCTAssertEqual(
31
+ error as! ApplePayUtilsError, ApplePayUtilsError.missingCountryCode
32
+ )
33
+ }
34
+ }
35
+
36
+ func test_buildPaymentSheetApplePayConfig_withNilAndEmptyArray_shouldBeEqual() throws {
37
+ let resultWithItemsAsNil = try ApplePayUtils.buildPaymentSheetApplePayConfig(merchantIdentifier: TestFixtures.MERCHANT_ID, merchantCountryCode: TestFixtures.COUNTRY_CODE, paymentSummaryItems: nil)
38
+ let resultWithItemsAsEmptyArray = try ApplePayUtils.buildPaymentSheetApplePayConfig(merchantIdentifier: TestFixtures.MERCHANT_ID, merchantCountryCode: TestFixtures.COUNTRY_CODE, paymentSummaryItems: [])
39
+ XCTAssertEqual(resultWithItemsAsNil.paymentSummaryItems, resultWithItemsAsEmptyArray.paymentSummaryItems)
40
+ }
41
+
42
+ func test_buildPaymentSheetApplePayConfig_withItems_shouldMatchExpected() throws {
43
+ let result = try ApplePayUtils.buildPaymentSheetApplePayConfig(merchantIdentifier: TestFixtures.MERCHANT_ID, merchantCountryCode: TestFixtures.COUNTRY_CODE, paymentSummaryItems: TestFixtures.CART_ITEM_DICTIONARY)
44
+
45
+ let deferredItemResult = PKDeferredPaymentSummaryItem(label: "deferred label", amount: 1.00)
46
+ deferredItemResult.deferredDate = Date(timeIntervalSince1970: 123456789)
47
+ let immediateItemResult = PKPaymentSummaryItem(label: "immediate label", amount: 2.00, type: .pending)
48
+ let recurringResult = PKRecurringPaymentSummaryItem(label: "recurring label", amount: 1.00)
49
+ recurringResult.intervalUnit = .minute
50
+ recurringResult.intervalCount = 2
51
+ recurringResult.startDate = Date(timeIntervalSince1970: 123456789)
52
+ recurringResult.endDate = Date(timeIntervalSince1970: 234567890)
53
+
54
+ XCTAssertEqual(
55
+ result.paymentSummaryItems,
56
+ [deferredItemResult, immediateItemResult, recurringResult]
57
+ )
58
+ XCTAssertEqual(
59
+ result.merchantId,
60
+ TestFixtures.MERCHANT_ID
61
+ )
62
+ XCTAssertEqual(
63
+ result.merchantCountryCode,
64
+ TestFixtures.COUNTRY_CODE
65
+ )
66
+ }
67
+
68
+ func test_createDeferredPaymentSummaryItem() throws {
69
+ let result = try ApplePayUtils.createDeferredPaymentSummaryItem(item: TestFixtures.DEFERRED_CART_ITEM_DICTIONARY)
70
+
71
+ let expectedResult = PKDeferredPaymentSummaryItem(label: "deferred label", amount: 1.00)
72
+ expectedResult.deferredDate = Date(timeIntervalSince1970: 123456789)
73
+
74
+ XCTAssertEqual(
75
+ result,
76
+ expectedResult
77
+ )
78
+ }
79
+
80
+ func test_createRecurringPaymentSummaryItem() throws {
81
+ let result = try ApplePayUtils.createRecurringPaymentSummaryItem(item: TestFixtures.RECURRING_CART_ITEM_DICTIONARY)
82
+
83
+ let expectedResult = PKRecurringPaymentSummaryItem(label: "recurring label", amount: 1.00)
84
+ expectedResult.intervalUnit = .minute
85
+ expectedResult.intervalCount = 2
86
+ expectedResult.startDate = Date(timeIntervalSince1970: 123456789)
87
+ expectedResult.endDate = Date(timeIntervalSince1970: 234567890)
88
+
89
+ XCTAssertEqual(
90
+ result,
91
+ expectedResult
92
+ )
93
+ }
94
+
95
+ func test_createRecurringPaymentSummaryItem_withUnexpectedIntervalUnit_fails() throws {
96
+ XCTAssertThrowsError(
97
+ try ApplePayUtils.createRecurringPaymentSummaryItem(item: [
98
+ "paymentType":"Recurring",
99
+ "intervalUnit": "decade",
100
+ "intervalCount": 1,
101
+ ] as [String : Any])
102
+ ) { error in
103
+ XCTAssertEqual(
104
+ error as! ApplePayUtilsError, ApplePayUtilsError.invalidTimeInterval("decade")
105
+ )
106
+ }
107
+
108
+ XCTAssertThrowsError(
109
+ try ApplePayUtils.createRecurringPaymentSummaryItem(item: [
110
+ "paymentType":"Recurring",
111
+ "intervalCount": 1,
112
+ ] as [String : Any])
113
+ ) { error in
114
+ XCTAssertEqual(
115
+ error as! ApplePayUtilsError, ApplePayUtilsError.invalidTimeInterval("null")
116
+ )
117
+ }
118
+ }
119
+
120
+ func test_createImmediatePaymentSummaryItem() throws {
121
+ let result = ApplePayUtils.createImmediatePaymentSummaryItem(item: TestFixtures.IMMEDIATE_CART_ITEM_DICTIONARY_NOT_PENDING)
122
+
123
+ let expectedResult = PKPaymentSummaryItem(label: "immediate label", amount: 2.00, type: .final)
124
+
125
+ XCTAssertEqual(
126
+ result,
127
+ expectedResult
128
+ )
129
+ }
130
+
131
+ func test_buildPaymentSummaryItems() throws {
132
+ let result = try ApplePayUtils.buildPaymentSummaryItems(items: TestFixtures.CART_ITEM_DICTIONARY)
133
+ let deferredItemResult = PKDeferredPaymentSummaryItem(label: "deferred label", amount: 1.00)
134
+ deferredItemResult.deferredDate = Date(timeIntervalSince1970: 123456789)
135
+ let immediateItemResult = PKPaymentSummaryItem(label: "immediate label", amount: 2.00, type: .pending)
136
+ let recurringResult = PKRecurringPaymentSummaryItem(label: "recurring label", amount: 1.00)
137
+ recurringResult.intervalUnit = .minute
138
+ recurringResult.intervalCount = 2
139
+ recurringResult.startDate = Date(timeIntervalSince1970: 123456789)
140
+ recurringResult.endDate = Date(timeIntervalSince1970: 234567890)
141
+
142
+ XCTAssertEqual(
143
+ result,
144
+ [deferredItemResult, immediateItemResult, recurringResult]
145
+ )
146
+ }
147
+
148
+ func test_buildPaymentSummaryItems_unexpectedType_fails() throws {
149
+ XCTAssertThrowsError(
150
+ try ApplePayUtils.buildPaymentSummaryItems(items: [[
151
+ "paymentType":"wrong type",
152
+ ]] as [[String : Any]])
153
+ ) { error in
154
+ XCTAssertEqual(
155
+ error as! ApplePayUtilsError, ApplePayUtilsError.invalidCartSummaryItemType("wrong type")
156
+ )
157
+ }
158
+
159
+ XCTAssertThrowsError(
160
+ try ApplePayUtils.buildPaymentSummaryItems(items: [[
161
+ "paymentType":"",
162
+ ]] as [[String : Any]])
163
+ ) { error in
164
+ XCTAssertEqual(
165
+ error as! ApplePayUtilsError, ApplePayUtilsError.invalidCartSummaryItemType("")
166
+ )
167
+ }
168
+
169
+ XCTAssertThrowsError(
170
+ try ApplePayUtils.buildPaymentSummaryItems(items: [[
171
+ "label":"my labal",
172
+ ]] as [[String : Any]])
173
+ ) { error in
174
+ XCTAssertEqual(
175
+ error as! ApplePayUtilsError, ApplePayUtilsError.invalidCartSummaryItemType("null")
176
+ )
177
+ }
178
+ }
179
+
180
+
181
+ private struct TestFixtures {
182
+ static let MERCHANT_ID = "merchant.com.id"
183
+ static let COUNTRY_CODE = "US"
184
+ static let DEFERRED_CART_ITEM_DICTIONARY = [
185
+ "paymentType":"Deferred",
186
+ "deferredDate": 123456789 as NSNumber,
187
+ "label": "deferred label",
188
+ "amount": "1.00"
189
+ ] as [String : Any]
190
+ static let RECURRING_CART_ITEM_DICTIONARY = [
191
+ "paymentType":"Recurring",
192
+ "intervalUnit": "minute",
193
+ "intervalCount": 2,
194
+ "startDate": 123456789 as NSNumber,
195
+ "endDate": 234567890 as NSNumber,
196
+ "label": "recurring label",
197
+ "amount": "1.00"
198
+ ] as [String : Any]
199
+ static let IMMEDIATE_CART_ITEM_DICTIONARY = [
200
+ "paymentType":"Immediate",
201
+ "isPending": true,
202
+ "label": "immediate label",
203
+ "amount": "2.00"
204
+ ] as [String : Any]
205
+ static let CART_ITEM_DICTIONARY = [
206
+ DEFERRED_CART_ITEM_DICTIONARY, IMMEDIATE_CART_ITEM_DICTIONARY, RECURRING_CART_ITEM_DICTIONARY
207
+ ]
208
+ static let IMMEDIATE_CART_ITEM_DICTIONARY_NOT_PENDING = [
209
+ "paymentType":"Immediate",
210
+ "label": "immediate label",
211
+ "amount": "2.00"
212
+ ] as [String : Any]
213
+ }
214
+ }
@@ -0,0 +1,49 @@
1
+ //
2
+ // Tests.swift
3
+ // Tests
4
+ //
5
+ // Created by Charles Cruzan on 6/21/22.
6
+ // Copyright © 2022 Facebook. All rights reserved.
7
+ //
8
+
9
+ import XCTest
10
+ @testable import stripe_react_native
11
+
12
+ class PushProvisioningTests: XCTestCase {
13
+ func testCanAddCardToWalletInTestMode() throws {
14
+ let (canAddCard, status) = PushProvisioningUtils.canAddCardToWallet(last4: "4242",
15
+ primaryAccountIdentifier: "",
16
+ testEnv: true)
17
+ XCTAssertEqual(canAddCard, true)
18
+ XCTAssertEqual(status, nil)
19
+ }
20
+
21
+ func testCanAddCardToWalletInLiveMode() throws {
22
+ let (canAddCard, status) = PushProvisioningUtils.canAddCardToWallet(last4: "4242",
23
+ primaryAccountIdentifier: "",
24
+ testEnv: false)
25
+ XCTAssertEqual(canAddCard, false)
26
+ XCTAssertEqual(status, PushProvisioningUtils.AddCardToWalletStatus.MISSING_CONFIGURATION)
27
+ }
28
+
29
+ func testCanAddPaymentPassInTestMode() throws {
30
+ XCTAssertEqual(
31
+ PushProvisioningUtils.canAddPaymentPass(primaryAccountIdentifier: "", isTestMode: true),
32
+ true
33
+ )
34
+ }
35
+
36
+ func testCanAddPaymentPassInLiveMode() throws {
37
+ XCTAssertEqual(
38
+ PushProvisioningUtils.canAddPaymentPass(primaryAccountIdentifier: "", isTestMode: false),
39
+ false
40
+ )
41
+ }
42
+
43
+ func testCheckIfPassExists() throws {
44
+ XCTAssertEqual(
45
+ PushProvisioningUtils.passExistsWith(last4: "4242"),
46
+ false
47
+ )
48
+ }
49
+ }
@@ -33,10 +33,6 @@ class AddToWalletButtonView: UIView {
33
33
  }
34
34
  }
35
35
 
36
- func canAddPaymentPass() -> Bool {
37
- return self.testEnv ? STPFakeAddPaymentPassViewController.canAddPaymentPass() : PKAddPaymentPassViewController.canAddPaymentPass()
38
- }
39
-
40
36
  override func didSetProps(_ changedProps: [String]!) {
41
37
  if let addToWalletButton = addToWalletButton {
42
38
  addToWalletButton.removeFromSuperview()
@@ -53,7 +49,7 @@ class AddToWalletButtonView: UIView {
53
49
  }
54
50
 
55
51
  @objc func beginPushProvisioning() {
56
- if (!canAddPaymentPass()) {
52
+ if (!PushProvisioningUtils.canAddPaymentPass(primaryAccountIdentifier: cardDetails?["primaryAccountIdentifier"] as? String ?? "", isTestMode: self.testEnv)) {
57
53
  onCompleteAction!(
58
54
  Errors.createError(
59
55
  ErrorType.Failed,
@@ -0,0 +1,64 @@
1
+ //
2
+ // PushProvisioningUtils.swift
3
+ // stripe-react-native
4
+ //
5
+ // Created by Charles Cruzan on 6/9/22.
6
+ //
7
+
8
+ import Foundation
9
+ import Stripe
10
+
11
+ internal class PushProvisioningUtils {
12
+ class func canAddCardToWallet(
13
+ last4: String,
14
+ primaryAccountIdentifier: String,
15
+ testEnv: Bool
16
+ ) -> (canAddCard: Bool, status: AddCardToWalletStatus?) {
17
+ if (!PKAddPassesViewController.canAddPasses()) {
18
+ return (false, AddCardToWalletStatus.UNSUPPORTED_DEVICE)
19
+ }
20
+
21
+ var status : AddCardToWalletStatus? = nil
22
+ var canAddCard = PushProvisioningUtils.canAddPaymentPass(
23
+ primaryAccountIdentifier: primaryAccountIdentifier,
24
+ isTestMode: testEnv)
25
+
26
+ if (!canAddCard) {
27
+ status = AddCardToWalletStatus.MISSING_CONFIGURATION
28
+ } else if (PushProvisioningUtils.passExistsWith(last4: last4)) {
29
+ canAddCard = false
30
+ status = AddCardToWalletStatus.CARD_ALREADY_EXISTS
31
+ }
32
+
33
+ return (canAddCard, status)
34
+ }
35
+
36
+ class func canAddPaymentPass(primaryAccountIdentifier: String, isTestMode: Bool) -> Bool {
37
+ if (isTestMode) {
38
+ return STPFakeAddPaymentPassViewController.canAddPaymentPass()
39
+ }
40
+
41
+ if #available(iOS 13.4, *) {
42
+ return PKPassLibrary().canAddSecureElementPass(primaryAccountIdentifier: primaryAccountIdentifier)
43
+ } else {
44
+ return PKAddPaymentPassViewController.canAddPaymentPass()
45
+ }
46
+ }
47
+
48
+ class func passExistsWith(last4: String) -> Bool {
49
+ let existingPass: PKPass? = {
50
+ if #available(iOS 13.4, *) {
51
+ return PKPassLibrary().passes(of: PKPassType.secureElement).first(where: {$0.secureElementPass?.primaryAccountNumberSuffix == last4})
52
+ } else {
53
+ return PKPassLibrary().passes(of: PKPassType.payment).first(where: {$0.paymentPass?.primaryAccountNumberSuffix == last4})
54
+ }
55
+ }()
56
+ return existingPass != nil
57
+ }
58
+
59
+ enum AddCardToWalletStatus: String {
60
+ case UNSUPPORTED_DEVICE
61
+ case MISSING_CONFIGURATION
62
+ case CARD_ALREADY_EXISTS
63
+ }
64
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCA+FA,GAAQA,CAAAA,SAAR,CAAsBC,0BAAtB,CAAQD,SAAR,C,aAEeA,S","sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n ApplePay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\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 ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params: PaymentMethod.ConfirmParams,\n options: PaymentMethod.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\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 presentPaymentSheet(): 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 isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\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 isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
1
+ {"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCAoGA,GAAQA,CAAAA,SAAR,CAAsBC,0BAAtB,CAAQD,SAAR,C,aAEeA,S","sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n ApplePay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\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 ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params: PaymentMethod.ConfirmParams,\n options: PaymentMethod.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\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 presentPaymentSheet(): 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 isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\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};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
@@ -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/acomley/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,+HAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","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/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** Only set to `false` when shipping through TestFlight || App Store */\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"]}
1
+ {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,qIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","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/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, 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"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;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 _jsxFileName="/Users/acomley/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];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 ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;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 _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];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 ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
2
2
  //# sourceMappingURL=ApplePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,upCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
1
+ {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,6pCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
@@ -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/acomley/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:(0,_extends2.default)({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:(0,_extends2.default)({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,uJAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,0BAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","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"]}
1
+ {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,6JAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,0BAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","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"]}
@@ -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/acomley/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:177,columnNumber:7}}));});exports.CardField=CardField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F WARNING: You've enabled `dangerouslyGetFullCardDetails`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
2
2
  //# sourceMappingURL=CardField.js.map