@stripe/stripe-react-native 0.20.0 → 0.22.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 (391) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/android/build.gradle +1 -0
  3. package/android/gradle.properties +1 -1
  4. package/android/proguard-rules.txt +7 -0
  5. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +4 -0
  6. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +1 -1
  7. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +4 -1
  8. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +5 -0
  9. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +46 -8
  10. package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +1 -1
  11. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +132 -0
  12. package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +144 -0
  13. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -1
  14. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +10 -9
  15. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +8 -3
  16. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +142 -21
  17. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +3 -1
  18. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +111 -0
  19. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetEvent.kt +28 -0
  20. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +178 -0
  21. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +67 -0
  22. package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -0
  23. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
  24. package/android/src/main/res/drawable/book_with_googlepay_button_content.xml +14 -0
  25. package/android/src/main/res/drawable/buy_with_googlepay_button_content.xml +14 -0
  26. package/android/src/main/res/drawable/checkout_with_googlepay_button_content.xml +14 -0
  27. package/android/src/main/res/drawable/donate_with_googlepay_button_content.xml +14 -0
  28. package/android/src/main/res/drawable/googlepay_button_background_shape.xml +11 -0
  29. package/android/src/main/res/drawable/googlepay_mark_background.xml +12 -0
  30. package/android/src/main/res/drawable/googlepay_mark_content.xml +27 -0
  31. package/android/src/main/res/drawable/order_with_googlepay_button_content.xml +14 -0
  32. package/android/src/main/res/drawable/pay_with_googlepay_button_content.xml +6 -6
  33. package/android/src/main/res/drawable/subscribe_with_googlepay_button_content.xml +14 -0
  34. package/android/src/main/res/drawable-ar/book_with_googlepay_button_content.xml +14 -0
  35. package/android/src/main/res/drawable-ar/buy_with_googlepay_button_content.xml +14 -0
  36. package/android/src/main/res/drawable-ar/checkout_with_googlepay_button_content.xml +14 -0
  37. package/android/src/main/res/drawable-ar/donate_with_googlepay_button_content.xml +14 -0
  38. package/android/src/main/res/drawable-ar/order_with_googlepay_button_content.xml +14 -0
  39. package/android/src/main/res/drawable-ar/pay_with_googlepay_button_content.xml +6 -6
  40. package/android/src/main/res/drawable-ar/subscribe_with_googlepay_button_content.xml +14 -0
  41. package/android/src/main/res/drawable-bg/book_with_googlepay_button_content.xml +14 -0
  42. package/android/src/main/res/drawable-bg/buy_with_googlepay_button_content.xml +14 -0
  43. package/android/src/main/res/drawable-bg/checkout_with_googlepay_button_content.xml +14 -0
  44. package/android/src/main/res/drawable-bg/donate_with_googlepay_button_content.xml +14 -0
  45. package/android/src/main/res/drawable-bg/order_with_googlepay_button_content.xml +14 -0
  46. package/android/src/main/res/drawable-bg/pay_with_googlepay_button_content.xml +4 -4
  47. package/android/src/main/res/drawable-bg/subscribe_with_googlepay_button_content.xml +14 -0
  48. package/android/src/main/res/drawable-ca/book_with_googlepay_button_content.xml +14 -0
  49. package/android/src/main/res/drawable-ca/buy_with_googlepay_button_content.xml +14 -0
  50. package/android/src/main/res/drawable-ca/checkout_with_googlepay_button_content.xml +14 -0
  51. package/android/src/main/res/drawable-ca/donate_with_googlepay_button_content.xml +14 -0
  52. package/android/src/main/res/drawable-ca/order_with_googlepay_button_content.xml +14 -0
  53. package/android/src/main/res/drawable-ca/pay_with_googlepay_button_content.xml +6 -6
  54. package/android/src/main/res/drawable-ca/subscribe_with_googlepay_button_content.xml +14 -0
  55. package/android/src/main/res/drawable-cs/book_with_googlepay_button_content.xml +14 -0
  56. package/android/src/main/res/drawable-cs/buy_with_googlepay_button_content.xml +14 -0
  57. package/android/src/main/res/drawable-cs/checkout_with_googlepay_button_content.xml +14 -0
  58. package/android/src/main/res/drawable-cs/donate_with_googlepay_button_content.xml +14 -0
  59. package/android/src/main/res/drawable-cs/order_with_googlepay_button_content.xml +14 -0
  60. package/android/src/main/res/drawable-cs/pay_with_googlepay_button_content.xml +6 -6
  61. package/android/src/main/res/drawable-cs/subscribe_with_googlepay_button_content.xml +14 -0
  62. package/android/src/main/res/drawable-da/book_with_googlepay_button_content.xml +14 -0
  63. package/android/src/main/res/drawable-da/buy_with_googlepay_button_content.xml +14 -0
  64. package/android/src/main/res/drawable-da/checkout_with_googlepay_button_content.xml +14 -0
  65. package/android/src/main/res/drawable-da/donate_with_googlepay_button_content.xml +14 -0
  66. package/android/src/main/res/drawable-da/order_with_googlepay_button_content.xml +14 -0
  67. package/android/src/main/res/drawable-da/pay_with_googlepay_button_content.xml +6 -6
  68. package/android/src/main/res/drawable-da/subscribe_with_googlepay_button_content.xml +14 -0
  69. package/android/src/main/res/drawable-de/book_with_googlepay_button_content.xml +15 -0
  70. package/android/src/main/res/drawable-de/buy_with_googlepay_button_content.xml +15 -0
  71. package/android/src/main/res/drawable-de/checkout_with_googlepay_button_content.xml +15 -0
  72. package/android/src/main/res/drawable-de/donate_with_googlepay_button_content.xml +15 -0
  73. package/android/src/main/res/drawable-de/order_with_googlepay_button_content.xml +15 -0
  74. package/android/src/main/res/drawable-de/pay_with_googlepay_button_content.xml +7 -7
  75. package/android/src/main/res/drawable-de/subscribe_with_googlepay_button_content.xml +15 -0
  76. package/android/src/main/res/drawable-el/book_with_googlepay_button_content.xml +14 -0
  77. package/android/src/main/res/drawable-el/buy_with_googlepay_button_content.xml +14 -0
  78. package/android/src/main/res/drawable-el/checkout_with_googlepay_button_content.xml +14 -0
  79. package/android/src/main/res/drawable-el/donate_with_googlepay_button_content.xml +14 -0
  80. package/android/src/main/res/drawable-el/order_with_googlepay_button_content.xml +14 -0
  81. package/android/src/main/res/drawable-el/pay_with_googlepay_button_content.xml +4 -4
  82. package/android/src/main/res/drawable-el/subscribe_with_googlepay_button_content.xml +14 -0
  83. package/android/src/main/res/drawable-et/book_with_googlepay_button_content.xml +15 -0
  84. package/android/src/main/res/drawable-et/buy_with_googlepay_button_content.xml +15 -0
  85. package/android/src/main/res/drawable-et/checkout_with_googlepay_button_content.xml +15 -0
  86. package/android/src/main/res/drawable-et/donate_with_googlepay_button_content.xml +15 -0
  87. package/android/src/main/res/drawable-et/order_with_googlepay_button_content.xml +15 -0
  88. package/android/src/main/res/drawable-et/pay_with_googlepay_button_content.xml +8 -8
  89. package/android/src/main/res/drawable-et/subscribe_with_googlepay_button_content.xml +15 -0
  90. package/android/src/main/res/drawable-fi/book_with_googlepay_button_content.xml +15 -0
  91. package/android/src/main/res/drawable-fi/buy_with_googlepay_button_content.xml +15 -0
  92. package/android/src/main/res/drawable-fi/checkout_with_googlepay_button_content.xml +15 -0
  93. package/android/src/main/res/drawable-fi/donate_with_googlepay_button_content.xml +15 -0
  94. package/android/src/main/res/drawable-fi/order_with_googlepay_button_content.xml +15 -0
  95. package/android/src/main/res/drawable-fi/pay_with_googlepay_button_content.xml +8 -8
  96. package/android/src/main/res/drawable-fi/subscribe_with_googlepay_button_content.xml +15 -0
  97. package/android/src/main/res/drawable-fr/book_with_googlepay_button_content.xml +14 -0
  98. package/android/src/main/res/drawable-fr/buy_with_googlepay_button_content.xml +14 -0
  99. package/android/src/main/res/drawable-fr/checkout_with_googlepay_button_content.xml +14 -0
  100. package/android/src/main/res/drawable-fr/donate_with_googlepay_button_content.xml +14 -0
  101. package/android/src/main/res/drawable-fr/order_with_googlepay_button_content.xml +14 -0
  102. package/android/src/main/res/drawable-fr/pay_with_googlepay_button_content.xml +5 -5
  103. package/android/src/main/res/drawable-fr/subscribe_with_googlepay_button_content.xml +14 -0
  104. package/android/src/main/res/drawable-hr/book_with_googlepay_button_content.xml +14 -0
  105. package/android/src/main/res/drawable-hr/buy_with_googlepay_button_content.xml +14 -0
  106. package/android/src/main/res/drawable-hr/checkout_with_googlepay_button_content.xml +14 -0
  107. package/android/src/main/res/drawable-hr/donate_with_googlepay_button_content.xml +14 -0
  108. package/android/src/main/res/drawable-hr/order_with_googlepay_button_content.xml +14 -0
  109. package/android/src/main/res/drawable-hr/pay_with_googlepay_button_content.xml +4 -4
  110. package/android/src/main/res/drawable-hr/subscribe_with_googlepay_button_content.xml +14 -0
  111. package/android/src/main/res/drawable-id/book_with_googlepay_button_content.xml +14 -0
  112. package/android/src/main/res/drawable-id/buy_with_googlepay_button_content.xml +14 -0
  113. package/android/src/main/res/drawable-id/checkout_with_googlepay_button_content.xml +14 -0
  114. package/android/src/main/res/drawable-id/donate_with_googlepay_button_content.xml +14 -0
  115. package/android/src/main/res/drawable-id/order_with_googlepay_button_content.xml +14 -0
  116. package/android/src/main/res/drawable-id/pay_with_googlepay_button_content.xml +4 -4
  117. package/android/src/main/res/drawable-id/subscribe_with_googlepay_button_content.xml +14 -0
  118. package/android/src/main/res/drawable-it/book_with_googlepay_button_content.xml +14 -0
  119. package/android/src/main/res/drawable-it/buy_with_googlepay_button_content.xml +14 -0
  120. package/android/src/main/res/drawable-it/checkout_with_googlepay_button_content.xml +14 -0
  121. package/android/src/main/res/drawable-it/donate_with_googlepay_button_content.xml +14 -0
  122. package/android/src/main/res/drawable-it/order_with_googlepay_button_content.xml +14 -0
  123. package/android/src/main/res/drawable-it/pay_with_googlepay_button_content.xml +6 -6
  124. package/android/src/main/res/drawable-it/subscribe_with_googlepay_button_content.xml +14 -0
  125. package/android/src/main/res/drawable-ja/book_with_googlepay_button_content.xml +14 -0
  126. package/android/src/main/res/drawable-ja/buy_with_googlepay_button_content.xml +14 -0
  127. package/android/src/main/res/drawable-ja/checkout_with_googlepay_button_content.xml +14 -0
  128. package/android/src/main/res/drawable-ja/donate_with_googlepay_button_content.xml +14 -0
  129. package/android/src/main/res/drawable-ja/order_with_googlepay_button_content.xml +14 -0
  130. package/android/src/main/res/drawable-ja/pay_with_googlepay_button_content.xml +5 -5
  131. package/android/src/main/res/drawable-ja/subscribe_with_googlepay_button_content.xml +14 -0
  132. package/android/src/main/res/drawable-ko/book_with_googlepay_button_content.xml +14 -0
  133. package/android/src/main/res/drawable-ko/buy_with_googlepay_button_content.xml +14 -0
  134. package/android/src/main/res/drawable-ko/checkout_with_googlepay_button_content.xml +14 -0
  135. package/android/src/main/res/drawable-ko/donate_with_googlepay_button_content.xml +14 -0
  136. package/android/src/main/res/drawable-ko/order_with_googlepay_button_content.xml +14 -0
  137. package/android/src/main/res/drawable-ko/pay_with_googlepay_button_content.xml +7 -7
  138. package/android/src/main/res/drawable-ko/subscribe_with_googlepay_button_content.xml +14 -0
  139. package/android/src/main/res/drawable-ms/book_with_googlepay_button_content.xml +14 -0
  140. package/android/src/main/res/drawable-ms/buy_with_googlepay_button_content.xml +14 -0
  141. package/android/src/main/res/drawable-ms/checkout_with_googlepay_button_content.xml +14 -0
  142. package/android/src/main/res/drawable-ms/donate_with_googlepay_button_content.xml +14 -0
  143. package/android/src/main/res/drawable-ms/order_with_googlepay_button_content.xml +14 -0
  144. package/android/src/main/res/drawable-ms/pay_with_googlepay_button_content.xml +4 -4
  145. package/android/src/main/res/drawable-ms/subscribe_with_googlepay_button_content.xml +14 -0
  146. package/android/src/main/res/drawable-nl/book_with_googlepay_button_content.xml +14 -0
  147. package/android/src/main/res/drawable-nl/buy_with_googlepay_button_content.xml +14 -0
  148. package/android/src/main/res/drawable-nl/checkout_with_googlepay_button_content.xml +14 -0
  149. package/android/src/main/res/drawable-nl/donate_with_googlepay_button_content.xml +14 -0
  150. package/android/src/main/res/drawable-nl/order_with_googlepay_button_content.xml +14 -0
  151. package/android/src/main/res/drawable-nl/pay_with_googlepay_button_content.xml +4 -4
  152. package/android/src/main/res/drawable-nl/subscribe_with_googlepay_button_content.xml +14 -0
  153. package/android/src/main/res/drawable-no/book_with_googlepay_button_content.xml +14 -0
  154. package/android/src/main/res/drawable-no/buy_with_googlepay_button_content.xml +14 -0
  155. package/android/src/main/res/drawable-no/checkout_with_googlepay_button_content.xml +14 -0
  156. package/android/src/main/res/drawable-no/donate_with_googlepay_button_content.xml +14 -0
  157. package/android/src/main/res/drawable-no/order_with_googlepay_button_content.xml +14 -0
  158. package/android/src/main/res/drawable-no/pay_with_googlepay_button_content.xml +6 -6
  159. package/android/src/main/res/drawable-no/subscribe_with_googlepay_button_content.xml +14 -0
  160. package/android/src/main/res/drawable-pl/book_with_googlepay_button_content.xml +14 -0
  161. package/android/src/main/res/drawable-pl/buy_with_googlepay_button_content.xml +14 -0
  162. package/android/src/main/res/drawable-pl/checkout_with_googlepay_button_content.xml +14 -0
  163. package/android/src/main/res/drawable-pl/donate_with_googlepay_button_content.xml +14 -0
  164. package/android/src/main/res/drawable-pl/order_with_googlepay_button_content.xml +14 -0
  165. package/android/src/main/res/drawable-pl/pay_with_googlepay_button_content.xml +7 -7
  166. package/android/src/main/res/drawable-pl/subscribe_with_googlepay_button_content.xml +14 -0
  167. package/android/src/main/res/drawable-ru/book_with_googlepay_button_content.xml +14 -0
  168. package/android/src/main/res/drawable-ru/buy_with_googlepay_button_content.xml +14 -0
  169. package/android/src/main/res/drawable-ru/checkout_with_googlepay_button_content.xml +14 -0
  170. package/android/src/main/res/drawable-ru/donate_with_googlepay_button_content.xml +14 -0
  171. package/android/src/main/res/drawable-ru/order_with_googlepay_button_content.xml +14 -0
  172. package/android/src/main/res/drawable-ru/pay_with_googlepay_button_content.xml +7 -7
  173. package/android/src/main/res/drawable-ru/subscribe_with_googlepay_button_content.xml +14 -0
  174. package/android/src/main/res/drawable-sk/book_with_googlepay_button_content.xml +14 -0
  175. package/android/src/main/res/drawable-sk/buy_with_googlepay_button_content.xml +14 -0
  176. package/android/src/main/res/drawable-sk/checkout_with_googlepay_button_content.xml +14 -0
  177. package/android/src/main/res/drawable-sk/donate_with_googlepay_button_content.xml +14 -0
  178. package/android/src/main/res/drawable-sk/order_with_googlepay_button_content.xml +14 -0
  179. package/android/src/main/res/drawable-sk/pay_with_googlepay_button_content.xml +4 -4
  180. package/android/src/main/res/drawable-sk/subscribe_with_googlepay_button_content.xml +14 -0
  181. package/android/src/main/res/drawable-sl/book_with_googlepay_button_content.xml +14 -0
  182. package/android/src/main/res/drawable-sl/buy_with_googlepay_button_content.xml +14 -0
  183. package/android/src/main/res/drawable-sl/checkout_with_googlepay_button_content.xml +14 -0
  184. package/android/src/main/res/drawable-sl/donate_with_googlepay_button_content.xml +14 -0
  185. package/android/src/main/res/drawable-sl/order_with_googlepay_button_content.xml +14 -0
  186. package/android/src/main/res/drawable-sl/pay_with_googlepay_button_content.xml +4 -4
  187. package/android/src/main/res/drawable-sl/subscribe_with_googlepay_button_content.xml +14 -0
  188. package/android/src/main/res/drawable-sr/book_with_googlepay_button_content.xml +14 -0
  189. package/android/src/main/res/drawable-sr/buy_with_googlepay_button_content.xml +14 -0
  190. package/android/src/main/res/drawable-sr/checkout_with_googlepay_button_content.xml +14 -0
  191. package/android/src/main/res/drawable-sr/donate_with_googlepay_button_content.xml +14 -0
  192. package/android/src/main/res/drawable-sr/order_with_googlepay_button_content.xml +14 -0
  193. package/android/src/main/res/drawable-sr/pay_with_googlepay_button_content.xml +7 -7
  194. package/android/src/main/res/drawable-sr/subscribe_with_googlepay_button_content.xml +14 -0
  195. package/android/src/main/res/drawable-sv/book_with_googlepay_button_content.xml +14 -0
  196. package/android/src/main/res/drawable-sv/buy_with_googlepay_button_content.xml +14 -0
  197. package/android/src/main/res/drawable-sv/checkout_with_googlepay_button_content.xml +14 -0
  198. package/android/src/main/res/drawable-sv/donate_with_googlepay_button_content.xml +14 -0
  199. package/android/src/main/res/drawable-sv/order_with_googlepay_button_content.xml +14 -0
  200. package/android/src/main/res/drawable-sv/pay_with_googlepay_button_content.xml +4 -4
  201. package/android/src/main/res/drawable-sv/subscribe_with_googlepay_button_content.xml +14 -0
  202. package/android/src/main/res/drawable-th/book_with_googlepay_button_content.xml +14 -0
  203. package/android/src/main/res/drawable-th/buy_with_googlepay_button_content.xml +14 -0
  204. package/android/src/main/res/drawable-th/checkout_with_googlepay_button_content.xml +14 -0
  205. package/android/src/main/res/drawable-th/donate_with_googlepay_button_content.xml +14 -0
  206. package/android/src/main/res/drawable-th/order_with_googlepay_button_content.xml +14 -0
  207. package/android/src/main/res/drawable-th/pay_with_googlepay_button_content.xml +6 -6
  208. package/android/src/main/res/drawable-th/subscribe_with_googlepay_button_content.xml +14 -0
  209. package/android/src/main/res/drawable-tr/book_with_googlepay_button_content.xml +14 -0
  210. package/android/src/main/res/drawable-tr/buy_with_googlepay_button_content.xml +14 -0
  211. package/android/src/main/res/drawable-tr/checkout_with_googlepay_button_content.xml +14 -0
  212. package/android/src/main/res/drawable-tr/donate_with_googlepay_button_content.xml +14 -0
  213. package/android/src/main/res/drawable-tr/order_with_googlepay_button_content.xml +14 -0
  214. package/android/src/main/res/drawable-tr/pay_with_googlepay_button_content.xml +7 -7
  215. package/android/src/main/res/drawable-tr/subscribe_with_googlepay_button_content.xml +14 -0
  216. package/android/src/main/res/drawable-uk/book_with_googlepay_button_content.xml +14 -0
  217. package/android/src/main/res/drawable-uk/buy_with_googlepay_button_content.xml +14 -0
  218. package/android/src/main/res/drawable-uk/checkout_with_googlepay_button_content.xml +14 -0
  219. package/android/src/main/res/drawable-uk/donate_with_googlepay_button_content.xml +14 -0
  220. package/android/src/main/res/drawable-uk/order_with_googlepay_button_content.xml +14 -0
  221. package/android/src/main/res/drawable-uk/pay_with_googlepay_button_content.xml +5 -5
  222. package/android/src/main/res/drawable-uk/subscribe_with_googlepay_button_content.xml +14 -0
  223. package/android/src/main/res/layout/book_with_googlepay_button.xml +20 -0
  224. package/android/src/main/res/layout/buy_with_googlepay_button.xml +20 -0
  225. package/android/src/main/res/layout/checkout_with_googlepay_button.xml +20 -0
  226. package/android/src/main/res/layout/donate_with_googlepay_button.xml +20 -0
  227. package/android/src/main/res/layout/googlepay_mark_button.xml +18 -0
  228. package/android/src/main/res/layout/order_with_googlepay_button.xml +20 -0
  229. package/android/src/main/res/layout/pay_with_googlepay_button.xml +10 -24
  230. package/android/src/main/res/layout/plain_googlepay_button.xml +17 -0
  231. package/android/src/main/res/layout/subscribe_with_googlepay_button.xml +20 -0
  232. package/android/src/main/res/values/googlepay_strings.xml +3 -2
  233. package/ios/AddressSheet/AddressSheetUtils.swift +98 -0
  234. package/ios/AddressSheet/AddressSheetView.swift +131 -0
  235. package/ios/AddressSheet/AddressSheetViewManager.m +25 -0
  236. package/ios/AddressSheet/AddressSheetViewManager.swift +19 -0
  237. package/ios/ApplePayButtonManager.m +5 -0
  238. package/ios/ApplePayButtonManager.swift +3 -1
  239. package/ios/ApplePayButtonView.swift +21 -0
  240. package/ios/ApplePayUtils.swift +187 -0
  241. package/ios/ApplePayViewController.swift +279 -0
  242. package/ios/PaymentPassFinder.swift +61 -0
  243. package/ios/PaymentSheetAppearance.swift +24 -23
  244. package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonManager.m +0 -0
  245. package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonManager.swift +0 -0
  246. package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonView.swift +10 -10
  247. package/ios/PushProvisioning/PushProvisioningUtils.swift +87 -0
  248. package/ios/StripeSdk.m +29 -0
  249. package/ios/StripeSdk.swift +200 -130
  250. package/ios/Tests/AddressSheetUtilsTests.swift +273 -0
  251. package/ios/Tests/PushProvisioningTests.swift +14 -11
  252. package/jest/mock.js +44 -0
  253. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  254. package/lib/commonjs/components/AddressSheet.js +2 -0
  255. package/lib/commonjs/components/AddressSheet.js.map +1 -0
  256. package/lib/commonjs/components/PlatformPayButton.js +2 -0
  257. package/lib/commonjs/components/PlatformPayButton.js.map +1 -0
  258. package/lib/commonjs/functions.js +1 -1
  259. package/lib/commonjs/functions.js.map +1 -1
  260. package/lib/commonjs/hooks/usePlatformPay.js +2 -0
  261. package/lib/commonjs/hooks/usePlatformPay.js.map +1 -0
  262. package/lib/commonjs/hooks/useStripe.js +1 -1
  263. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  264. package/lib/commonjs/index.js +1 -1
  265. package/lib/commonjs/index.js.map +1 -1
  266. package/lib/commonjs/types/Errors.js +1 -1
  267. package/lib/commonjs/types/Errors.js.map +1 -1
  268. package/lib/commonjs/types/PlatformPay.js +2 -0
  269. package/lib/commonjs/types/PlatformPay.js.map +1 -0
  270. package/lib/commonjs/types/PushProvisioning.js +2 -0
  271. package/lib/commonjs/types/PushProvisioning.js.map +1 -0
  272. package/lib/commonjs/types/index.js +1 -1
  273. package/lib/commonjs/types/index.js.map +1 -1
  274. package/lib/module/NativeStripeSdk.js.map +1 -1
  275. package/lib/module/components/AddressSheet.js +2 -0
  276. package/lib/module/components/AddressSheet.js.map +1 -0
  277. package/lib/module/components/PlatformPayButton.js +2 -0
  278. package/lib/module/components/PlatformPayButton.js.map +1 -0
  279. package/lib/module/functions.js +1 -1
  280. package/lib/module/functions.js.map +1 -1
  281. package/lib/module/hooks/usePlatformPay.js +2 -0
  282. package/lib/module/hooks/usePlatformPay.js.map +1 -0
  283. package/lib/module/hooks/useStripe.js +1 -1
  284. package/lib/module/hooks/useStripe.js.map +1 -1
  285. package/lib/module/index.js +1 -1
  286. package/lib/module/index.js.map +1 -1
  287. package/lib/module/types/Errors.js +1 -1
  288. package/lib/module/types/Errors.js.map +1 -1
  289. package/lib/module/types/PlatformPay.js +2 -0
  290. package/lib/module/types/PlatformPay.js.map +1 -0
  291. package/lib/module/types/PushProvisioning.js +2 -0
  292. package/lib/module/types/PushProvisioning.js.map +1 -0
  293. package/lib/module/types/index.js +1 -1
  294. package/lib/module/types/index.js.map +1 -1
  295. package/lib/typescript/src/NativeStripeSdk.d.ts +8 -1
  296. package/lib/typescript/src/components/AddressSheet.d.ts +53 -0
  297. package/lib/typescript/src/components/PlatformPayButton.d.ts +65 -0
  298. package/lib/typescript/src/functions.d.ts +73 -1
  299. package/lib/typescript/src/hooks/usePlatformPay.d.ts +70 -0
  300. package/lib/typescript/src/hooks/useStripe.d.ts +18 -1
  301. package/lib/typescript/src/index.d.ts +3 -0
  302. package/lib/typescript/src/types/ApplePay.d.ts +9 -0
  303. package/lib/typescript/src/types/Common.d.ts +12 -0
  304. package/lib/typescript/src/types/Errors.d.ts +9 -0
  305. package/lib/typescript/src/types/GooglePay.d.ts +2 -1
  306. package/lib/typescript/src/types/PaymentSheet.d.ts +7 -1
  307. package/lib/typescript/src/types/PlatformPay.d.ts +285 -0
  308. package/lib/typescript/src/types/PushProvisioning.d.ts +66 -0
  309. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +2 -2
  310. package/lib/typescript/src/types/index.d.ts +6 -44
  311. package/package.json +8 -1
  312. package/src/NativeStripeSdk.tsx +20 -0
  313. package/src/components/AddressSheet.tsx +82 -0
  314. package/src/components/PlatformPayButton.tsx +157 -0
  315. package/src/functions.ts +181 -0
  316. package/src/hooks/usePlatformPay.tsx +174 -0
  317. package/src/hooks/useStripe.tsx +77 -0
  318. package/src/index.tsx +9 -0
  319. package/src/types/ApplePay.ts +9 -0
  320. package/src/types/Common.ts +13 -0
  321. package/src/types/Errors.ts +11 -0
  322. package/src/types/GooglePay.ts +2 -1
  323. package/src/types/PaymentSheet.ts +7 -1
  324. package/src/types/PlatformPay.ts +326 -0
  325. package/src/types/PushProvisioning.ts +76 -0
  326. package/src/types/components/ApplePayButtonComponent.ts +3 -2
  327. package/src/types/index.ts +8 -64
  328. package/stripe-react-native.podspec +1 -1
  329. package/android/src/main/res/drawable/googlepay_button_background.xml +0 -6
  330. package/android/src/main/res/drawable/googlepay_button_content.xml +0 -48
  331. package/android/src/main/res/drawable/googlepay_button_overlay.xml +0 -12
  332. package/android/src/main/res/drawable-af/pay_with_googlepay_button_content.xml +0 -14
  333. package/android/src/main/res/drawable-am/pay_with_googlepay_button_content.xml +0 -15
  334. package/android/src/main/res/drawable-as/pay_with_googlepay_button_content.xml +0 -14
  335. package/android/src/main/res/drawable-az/pay_with_googlepay_button_content.xml +0 -14
  336. package/android/src/main/res/drawable-be/pay_with_googlepay_button_content.xml +0 -14
  337. package/android/src/main/res/drawable-bn/pay_with_googlepay_button_content.xml +0 -14
  338. package/android/src/main/res/drawable-bs/pay_with_googlepay_button_content.xml +0 -14
  339. package/android/src/main/res/drawable-cy/pay_with_googlepay_button_content.xml +0 -14
  340. package/android/src/main/res/drawable-en-rau/pay_with_googlepay_button_content.xml +0 -14
  341. package/android/src/main/res/drawable-en-rca/pay_with_googlepay_button_content.xml +0 -14
  342. package/android/src/main/res/drawable-en-rgb/pay_with_googlepay_button_content.xml +0 -14
  343. package/android/src/main/res/drawable-en-rin/pay_with_googlepay_button_content.xml +0 -14
  344. package/android/src/main/res/drawable-es/pay_with_googlepay_button_content.xml +0 -14
  345. package/android/src/main/res/drawable-es-res/pay_with_googlepay_button_content.xml +0 -14
  346. package/android/src/main/res/drawable-eu/pay_with_googlepay_button_content.xml +0 -15
  347. package/android/src/main/res/drawable-fa/pay_with_googlepay_button_content.xml +0 -14
  348. package/android/src/main/res/drawable-fil/pay_with_googlepay_button_content.xml +0 -14
  349. package/android/src/main/res/drawable-fr-rca/pay_with_googlepay_button_content.xml +0 -14
  350. package/android/src/main/res/drawable-ga/pay_with_googlepay_button_content.xml +0 -14
  351. package/android/src/main/res/drawable-gl/pay_with_googlepay_button_content.xml +0 -14
  352. package/android/src/main/res/drawable-gu/pay_with_googlepay_button_content.xml +0 -14
  353. package/android/src/main/res/drawable-hdpi/googlepay_button_background_image.9.png +0 -0
  354. package/android/src/main/res/drawable-hu/pay_with_googlepay_button_content.xml +0 -15
  355. package/android/src/main/res/drawable-hy/pay_with_googlepay_button_content.xml +0 -15
  356. package/android/src/main/res/drawable-is/pay_with_googlepay_button_content.xml +0 -14
  357. package/android/src/main/res/drawable-iw/pay_with_googlepay_button_content.xml +0 -14
  358. package/android/src/main/res/drawable-ka/pay_with_googlepay_button_content.xml +0 -15
  359. package/android/src/main/res/drawable-kk/pay_with_googlepay_button_content.xml +0 -14
  360. package/android/src/main/res/drawable-km/pay_with_googlepay_button_content.xml +0 -14
  361. package/android/src/main/res/drawable-kn/pay_with_googlepay_button_content.xml +0 -14
  362. package/android/src/main/res/drawable-ky/pay_with_googlepay_button_content.xml +0 -14
  363. package/android/src/main/res/drawable-lo/pay_with_googlepay_button_content.xml +0 -14
  364. package/android/src/main/res/drawable-lt/pay_with_googlepay_button_content.xml +0 -14
  365. package/android/src/main/res/drawable-lv/pay_with_googlepay_button_content.xml +0 -14
  366. package/android/src/main/res/drawable-mdpi/googlepay_button_background_image.9.png +0 -0
  367. package/android/src/main/res/drawable-mk/pay_with_googlepay_button_content.xml +0 -14
  368. package/android/src/main/res/drawable-ml/pay_with_googlepay_button_content.xml +0 -14
  369. package/android/src/main/res/drawable-mn/pay_with_googlepay_button_content.xml +0 -14
  370. package/android/src/main/res/drawable-mr/pay_with_googlepay_button_content.xml +0 -14
  371. package/android/src/main/res/drawable-ne/pay_with_googlepay_button_content.xml +0 -14
  372. package/android/src/main/res/drawable-pt-rbr/pay_with_googlepay_button_content.xml +0 -14
  373. package/android/src/main/res/drawable-pt-rpt/pay_with_googlepay_button_content.xml +0 -14
  374. package/android/src/main/res/drawable-ro/pay_with_googlepay_button_content.xml +0 -14
  375. package/android/src/main/res/drawable-sq/pay_with_googlepay_button_content.xml +0 -14
  376. package/android/src/main/res/drawable-sw/pay_with_googlepay_button_content.xml +0 -14
  377. package/android/src/main/res/drawable-ta/pay_with_googlepay_button_content.xml +0 -14
  378. package/android/src/main/res/drawable-te/pay_with_googlepay_button_content.xml +0 -14
  379. package/android/src/main/res/drawable-ur/pay_with_googlepay_button_content.xml +0 -14
  380. package/android/src/main/res/drawable-uz/pay_with_googlepay_button_content.xml +0 -14
  381. package/android/src/main/res/drawable-v21/googlepay_button_background.xml +0 -7
  382. package/android/src/main/res/drawable-vi/pay_with_googlepay_button_content.xml +0 -14
  383. package/android/src/main/res/drawable-xhdpi/googlepay_button_background_image.9.png +0 -0
  384. package/android/src/main/res/drawable-xxhdpi/googlepay_button_background_image.9.png +0 -0
  385. package/android/src/main/res/drawable-xxxhdpi/googlepay_button_background_image.9.png +0 -0
  386. package/android/src/main/res/drawable-zh-rcn/pay_with_googlepay_button_content.xml +0 -15
  387. package/android/src/main/res/drawable-zh-rhk/pay_with_googlepay_button_content.xml +0 -15
  388. package/android/src/main/res/drawable-zh-rtw/pay_with_googlepay_button_content.xml +0 -15
  389. package/android/src/main/res/drawable-zu/pay_with_googlepay_button_content.xml +0 -14
  390. package/android/src/main/res/layout/googlepay_button.xml +0 -39
  391. package/ios/pushprovisioning/PushProvisioningUtils.swift +0 -64
@@ -1 +1 @@
1
- {"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants"],"mappings":"ioCAAA,kCACA,sCACA,0EACA,8BAoCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAAG,UACjCC,MADiC,CAGM,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,GAAI,CACF,+BAAuCC,0BAAgBH,mBAAhB,CACrCC,MADqC,CAErCC,OAFqC,CAAvC,CAAQE,aAAR,uBAAQA,aAAR,CAAuBC,KAAvB,uBAAuBA,KAAvB,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLD,aAAa,CAAEA,aADV,CAAP,CAGD,CAAC,MAAOC,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CAtB+B,iBAAnBL,CAAAA,mBAAmB,4CAAzB,C,gDAwBA,GAAMM,CAAAA,WAAW,qDAAG,UACzBL,MADyB,CAEM,qBAC/B,GACEA,MAAM,CAACM,IAAP,GAAgB,aAAhB,EACA,kBAAAN,MAAM,CAACO,OAAP,+BAAgBC,WAAhB,MAAkC,IADlC,EAEA,CAACR,MAAM,CAACS,aAHV,CAIE,CACA,MAAO,CACLL,KAAK,CAAEM,4BADF,CAAP,CAGD,CAED,GAAI,CACF,gCAA+BR,0BAAgBG,WAAhB,CAA4BL,MAA5B,CAA/B,CAAQW,KAAR,wBAAQA,KAAR,CAAeP,KAAf,wBAAeA,KAAf,CAEA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAA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B,CAGA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACL0D,UAAU,CAAEA,UADP,CAELC,OAAO,CAAEA,OAFJ,CAAP,CAID,CAAC,MAAO3D,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CArB8B,iBAAlByD,CAAAA,kBAAkB,gDAAxB,C,8CAuBA,GAAMG,CAAAA,cAAc,sDAAG,UAAOhE,MAAP,CAEO,CACnC,GAAI,CACF,iCAA2CE,0BAAgB8D,cAAhB,CACzChE,MADyC,CAA3C,CAAQiE,UAAR,yBAAQA,UAAR,CAAoBtD,KAApB,yBAAoBA,KAApB,CAA2BP,KAA3B,yBAA2BA,KAA3B,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACL6D,UAAU,CAAEA,UADP,CAELtD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAd4D,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAGhE,yBAAgBiE,YAAhB,EAAlB,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\nexport const resetPaymentSheetCustomer = async (): Promise<null> => {\n return await NativeStripeSdk.resetPaymentSheetCustomer();\n};\n\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string\n): Promise<FinancialConnections.TokenResult> => {\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string\n): Promise<FinancialConnections.SessionResult> => {\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n"]}
1
+ {"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPay","confirmPlatformPayPayment","dismissPlatformPay","didDismiss","createPlatformPayPaymentMethod","updatePlatformPaySheet","applePay","cartItems","shippingMethods","errors","openPlatformPaySetup"],"mappings":"s2CAAA,kCACA,sCACA,0EACA,8BAsCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAAG,UACjCC,MADiC,CAGM,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,GAAI,CACF,+BAAuCC,0BAAgBH,mBAAhB,CACrCC,MADqC,CAErCC,OAFqC,CAAvC,CAAQE,aAAR,uBAAQA,aAAR,CAAuBC,KAAvB,uBAAuBA,KAAvB,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLD,aAAa,CAAEA,aADV,CAAP,CAGD,CAAC,MAAOC,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CAtB+B,iBAAnBL,CAAAA,mBAAmB,4CAAzB,C,gDAwBA,GAAMM,CAAAA,WAAW,qDAAG,UACzBL,MADyB,CAEM,qBAC/B,GACEA,MAAM,CAACM,IAAP,GAAgB,aAAhB,EACA,kBAAAN,MAAM,CAACO,OAAP,+BAAgBC,WAAhB,MAAkC,IADlC,EAEA,CAACR,MAAM,CAACS,aAHV,CAIE,CACA,MAAO,CACLL,KAAK,CAAEM,4BADF,CAAP,CAGD,CAED,GAAI,CACF,gCAA+BR,0BAAgBG,WAAhB,CAA4BL,MAA5B,CAA/B,CAAQW,KAAR,wBAAQA,KAAR,CAAeP,KAAf,wBAAeA,KAAf,CAEA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLO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A9B,CAEA,GAAIP,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLD,aAAa,CAAEA,aADV,CAELQ,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CApB0C,iBAA9BsE,CAAAA,8BAA8B,gDAApC,C,sEA+BA,GAAMC,CAAAA,sBAAsB,sDAAG,UAAO3E,MAAP,CAQhC,CACJ,GAAIgC,sBAASC,EAAT,GAAgB,KAApB,CAA2B,CACzB,MAAO,EAAP,CACD,CAED,GAAI,CACF,KAAM/B,0BAAgByE,sBAAhB,CACJ3E,MAAM,CAAC4E,QAAP,CAAgBC,SADZ,CAEJ7E,MAAM,CAAC4E,QAAP,CAAgBE,eAFZ,CAGJ9E,MAAM,CAAC4E,QAAP,CAAgBG,MAHZ,CAAN,CAMA,MAAO,EAAP,CACD,CAAC,MAAO3E,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CA1BkC,iBAAtBuE,CAAAA,sBAAsB,gDAA5B,C,sDAiCA,GAAMK,CAAAA,oBAAoB,sDAAG,WAA2B,CAC7D,GAAIhD,sBAASC,EAAT,GAAgB,KAApB,CAA2B,CACzB,KAAM/B,0BAAgBoD,iBAAhB,EAAN,CACD,CACF,CAJgC,iBAApB0B,CAAAA,oBAAoB,4CAA1B,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n PlatformPayError,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `updatePlatformPaySheet` instead. */\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent` or `confirmPlatformPayPayment` instead. */\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\nexport const resetPaymentSheetCustomer = async (): Promise<null> => {\n return await NativeStripeSdk.resetPaymentSheetCustomer();\n};\n\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `createPlatformPayPaymentMethod` instead. */\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** @deprecated Use `openNativePaySetup` instead. */\nexport const openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string\n): Promise<FinancialConnections.TokenResult> => {\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string\n): Promise<FinancialConnections.SessionResult> => {\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\n */\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/** @deprecated Please use `canAddCardToWallet` instead. */\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n\n/**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\nexport const isPlatformPaySupported = async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n}): Promise<boolean> => {\n return await NativeStripeSdk.isPlatformPaySupported(params ?? {});\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPaySetupIntent = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n try {\n const { error, setupIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n false\n )) as PlatformPay.ConfirmSetupIntentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPayPayment = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmPaymentResult> => {\n try {\n const { error, paymentIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n true\n )) as PlatformPay.ConfirmPaymentResult;\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\nexport const dismissPlatformPay = async (): Promise<boolean> => {\n if (Platform.OS !== 'ios') {\n return false;\n }\n try {\n const didDismiss = await NativeStripeSdk.dismissPlatformPay();\n return didDismiss;\n } catch (error: any) {\n return false;\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods) and [token](https://stripe.com/docs/api/tokens).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.\n */\nexport const createPlatformPayPaymentMethod = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.PaymentMethodResult> => {\n try {\n const { error, paymentMethod, token } =\n await NativeStripeSdk.createPlatformPayPaymentMethod(params);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only. Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.\n * @param params an object describing the Apple Pay configuration, with the following fields:\n * - cartItems An array of payment summary items to display in the Apple Pay sheet.\n * - shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * - errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\nexport const updatePlatformPaySheet = async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n}): Promise<{\n error?: StripeError<PlatformPayError>;\n}> => {\n if (Platform.OS !== 'ios') {\n return {};\n }\n\n try {\n await NativeStripeSdk.updatePlatformPaySheet(\n params.applePay.cartItems,\n params.applePay.shippingMethods,\n params.applePay.errors\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\nexport const openPlatformPaySetup = async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n await NativeStripeSdk.openApplePaySetup();\n }\n};\n"]}
@@ -0,0 +1,2 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePlatformPay=usePlatformPay;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _useStripe2=require("./useStripe");function usePlatformPay(){var _useStripe=(0,_useStripe2.useStripe)(),isPlatformPaySupported=_useStripe.isPlatformPaySupported,confirmPlatformPaySetupIntent=_useStripe.confirmPlatformPaySetupIntent,confirmPlatformPayPayment=_useStripe.confirmPlatformPayPayment,createPlatformPayPaymentMethod=_useStripe.createPlatformPayPaymentMethod,dismissPlatformPay=_useStripe.dismissPlatformPay,updatePlatformPaySheet=_useStripe.updatePlatformPaySheet,canAddCardToWallet=_useStripe.canAddCardToWallet,openPlatformPaySetup=_useStripe.openPlatformPaySetup;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield isPlatformPaySupported(params);setLoading(false);return result;});return function(_x){return _ref.apply(this,arguments);};}(),[isPlatformPaySupported]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(clientSecret,params){setLoading(true);var result=yield confirmPlatformPaySetupIntent(clientSecret,params);setLoading(false);return result;});return function(_x2,_x3){return _ref2.apply(this,arguments);};}(),[confirmPlatformPaySetupIntent]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret,params){setLoading(true);var result=yield confirmPlatformPayPayment(clientSecret,params);setLoading(false);return result;});return function(_x4,_x5){return _ref3.apply(this,arguments);};}(),[confirmPlatformPayPayment]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield createPlatformPayPaymentMethod(params);setLoading(false);return result;});return function(_x6){return _ref4.apply(this,arguments);};}(),[createPlatformPayPaymentMethod]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield dismissPlatformPay();setLoading(false);return result;}),[dismissPlatformPay]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield updatePlatformPaySheet(params);setLoading(false);return result;});return function(_x7){return _ref6.apply(this,arguments);};}(),[updatePlatformPaySheet]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield canAddCardToWallet(params);setLoading(false);return result;});return function(_x8){return _ref7.apply(this,arguments);};}(),[canAddCardToWallet]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return openPlatformPaySetup();}),[openPlatformPaySetup]);return{loading:loading,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,dismissPlatformPay:_dismissPlatformPay,updatePlatformPaySheet:_updatePlatformPaySheet,canAddCardToWallet:_canAddCardToWallet,openPlatformPaySetup:_openPlatformPaySetup};}
2
+ //# sourceMappingURL=usePlatformPay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["usePlatformPay.tsx"],"names":["usePlatformPay","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPayPayment","createPlatformPayPaymentMethod","dismissPlatformPay","updatePlatformPaySheet","canAddCardToWallet","openPlatformPaySetup","loading","setLoading","_isPlatformPaySupported","params","result","_confirmPlatformPaySetupIntent","clientSecret","_confirmPlatformPayPayment","_createPlatformPayPaymentMethod","_dismissPlatformPay","_updatePlatformPaySheet","_canAddCardToWallet","_openPlatformPaySetup"],"mappings":"gXAAA,4BAMA,uCAKO,QAASA,CAAAA,cAAT,EAA0B,CAC/B,eASI,2BATJ,CACEC,sBADF,YACEA,sBADF,CAEEC,6BAFF,YAEEA,6BAFF,CAGEC,yBAHF,YAGEA,yBAHF,CAIEC,8BAJF,YAIEA,8BAJF,CAKEC,kBALF,YAKEA,kBALF,CAMEC,sBANF,YAMEA,sBANF,CAOEC,kBAPF,YAOEA,kBAPF,CAQEC,oBARF,YAQEA,oBARF,CAUA,cAA8B,oBAAS,KAAT,CAA9B,qDAAOC,OAAP,eAAgBC,UAAhB,eAEA,GAAMC,CAAAA,uBAAuB,CAAG,0EAC9B,UAAOC,MAAP,CAA2E,CACzEF,UAAU,CAAC,IAAD,CAAV,CAEA,GAAMG,CAAAA,MAAM,MAASZ,CAAAA,sBAAsB,CAACW,MAAD,CAA3C,CACAF,UAAU,CAAC,KAAD,CAAV,CAEA,MAAOG,CAAAA,MAAP,CACD,CAR6B,8DAS9B,CAACZ,sBAAD,CAT8B,CAAhC,CAYA,GAAMa,CAAAA,8BAA8B,CAAG,2EACrC,UAAOC,YAAP,CAA6BH,MAA7B,CAAmE,CACjEF,UAAU,CAAC,IAAD,CAAV,CAEA,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CAkBA,GAAMc,CAAAA,mBAAmB,CAAG,2EAC1B,UACER,MADF,CAEwC,CACtCF,UAAU,CAAC,IAAD,CAAV,CAEA,GAAMG,CAAAA,MAAM,MAASN,CAAAA,kBAAkB,CAACK,MAAD,CAAvC,CACAF,UAAU,CAAC,KAAD,CAAV,CAEA,MAAOG,CAAAA,MAAP,CACD,CAVyB,gEAW1B,CAACN,kBAAD,CAX0B,CAA5B,CAcA,GAAMc,CAAAA,qBAAqB,CAAG,sDAAY,WAA2B,CACnE,MAAOb,CAAAA,oBAAoB,EAA3B,CACD,CAF6B,EAE3B,CAACA,oBAAD,CAF2B,CAA9B,CAIA,MAAO,CAELC,OAAO,CAAPA,OAFK,CAOLR,sBAAsB,CAAEU,uBAPnB,CAcLT,6BAA6B,CAAEY,8BAd1B,CAqBLX,yBAAyB,CAAEa,0BArBtB,CA2BLZ,8BAA8B,CAAEa,+BA3B3B,CAgCLZ,kBAAkB,CAAEa,mBAhCf,CAyCLZ,sBAAsB,CAAEa,uBAzCnB,CAgDLZ,kBAAkB,CAAEa,mBAhDf,CAsDLZ,oBAAoB,CAAEa,qBAtDjB,CAAP,CAwDD","sourcesContent":["import { useCallback, useState } from 'react';\nimport type {\n PlatformPay,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n} from '../types';\nimport { useStripe } from './useStripe';\n\n/**\n * usePlatformPay hook. Access all Apple and Google Pay functionality with this hook.\n */\nexport function usePlatformPay() {\n const {\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n createPlatformPayPaymentMethod,\n dismissPlatformPay,\n updatePlatformPaySheet,\n canAddCardToWallet,\n openPlatformPaySetup,\n } = useStripe();\n const [loading, setLoading] = useState(false);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: { googlePay?: PlatformPay.IsGooglePaySupportedParams }) => {\n setLoading(true);\n\n const result = await isPlatformPaySupported(params);\n setLoading(false);\n\n return result;\n },\n [isPlatformPaySupported]\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (clientSecret: string, params: PlatformPay.ConfirmParams) => {\n setLoading(true);\n\n const result = await confirmPlatformPaySetupIntent(clientSecret, params);\n setLoading(false);\n\n return result;\n },\n [confirmPlatformPaySetupIntent]\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (clientSecret: string, params: PlatformPay.ConfirmParams) => {\n setLoading(true);\n\n const result = await confirmPlatformPayPayment(clientSecret, params);\n setLoading(false);\n\n return result;\n },\n [confirmPlatformPayPayment]\n );\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (params: PlatformPay.PaymentMethodParams) => {\n setLoading(true);\n\n const result = await createPlatformPayPaymentMethod(params);\n setLoading(false);\n\n return result;\n },\n [createPlatformPayPaymentMethod]\n );\n\n const _dismissPlatformPay = useCallback(async () => {\n setLoading(true);\n\n const result = await dismissPlatformPay();\n setLoading(false);\n\n return result;\n }, [dismissPlatformPay]);\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }) => {\n setLoading(true);\n\n const result = await updatePlatformPaySheet(params);\n setLoading(false);\n\n return result;\n },\n [updatePlatformPaySheet]\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n setLoading(true);\n\n const result = await canAddCardToWallet(params);\n setLoading(false);\n\n return result;\n },\n [canAddCardToWallet]\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, [openPlatformPaySetup]);\n\n return {\n /** Use this boolean to present a spinner or other similar loading screen. `true` if the SDK is currently processing, `false` if it is not. */\n loading,\n /**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\n isPlatformPaySupported: _isPlatformPaySupported,\n /**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n /**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n /**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods) and [token](https://stripe.com/docs/api/tokens).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.\n */\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n /**\n * Dismiss the Apple Pay sheet if it is open. iOS only, this is a no-op on Android.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\n dismissPlatformPay: _dismissPlatformPay,\n /**\n * Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.\n * @param cartItems An array of payment summary items to display in the Apple Pay sheet.\n * @param shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * @param errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\n updatePlatformPaySheet: _updatePlatformPaySheet,\n /**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\n */\n canAddCardToWallet: _canAddCardToWallet,\n /**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer};}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref29=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isPlatformPaySupported)(params);});return function(_x32){return _ref29.apply(this,arguments);};}(),[]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPaySetupIntent)(clientSecret,params);});return function(_x33,_x34){return _ref30.apply(this,arguments);};}(),[]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPayPayment)(clientSecret,params);});return function(_x35,_x36){return _ref31.apply(this,arguments);};}(),[]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.dismissPlatformPay)();}),[]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref33=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayPaymentMethod)(params);});return function(_x37){return _ref33.apply(this,arguments);};}(),[]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.updatePlatformPaySheet)(params);});return function(_x38){return _ref34.apply(this,arguments);};}(),[]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openPlatformPaySetup)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,dismissPlatformPay:_dismissPlatformPay,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,updatePlatformPaySheet:_updatePlatformPaySheet,openPlatformPaySetup:_openPlatformPaySetup};}
2
2
  //# sourceMappingURL=useStripe.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer"],"mappings":"sWAmCA,4BACA,mCACA,2EACA,uCAkCO,QAASA,CAAAA,SAAT,EAAqB,CAC1B,cAAoD,oBAClD,IADkD,CAApD,qDAAOC,mBAAP,eAA4BC,oBAA5B,eAIA,qBAAU,UAAM,SACCC,CAAAA,oBADD,6IACd,WAAsC,CACpC,GAAMC,CAAAA,WAAW,CACfC,sBAAgBC,0BAAgBL,mBAAhB,EAAhB,CADF,CAEAC,oBAAoB,CAACE,WAAD,CAApB,CACD,CALa,sDAOdD,oBAAoB,GACrB,CARD,CAQG,EARH,EAUA,GAAMI,CAAAA,oBAAoB,CAAG,0EAC3B,UACEC,IADF,CAGyC,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,MAAO,mCAAoBD,IAApB,CAA0BC,OAA1B,CAAP,CACD,CAN0B,8DAO3B,EAP2B,CAA7B,CAUA,GAAMC,CAAAA,YAAY,CAAG,2EACnB,UAAOC,MAAP,CAAkE,CAChE,MAAO,2BAAYA,MAAZ,CAAP,CACD,CAHkB,gEAInB,EAJmB,CAArB,CAOA,GAAMC,CAAAA,sBAAsB,CAAG,2EAC7B,UAAOC,YAAP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CAAEzC,oBAJhB,CAKL0C,gBAAgB,CAAE3B,iBALb,CAMLrB,mBAAmB,CAAEA,mBANhB,CAOLiD,eAAe,CAAEjC,gBAPZ,CAQLkC,sBAAsB,CAAE9B,uBARnB,CASL+B,kBAAkB,CAAE5B,mBATf,CAUL6B,uBAAuB,CAAE5B,wBAVpB,CAWL6B,0BAA0B,CAAEpC,2BAXvB,CAYLqC,iBAAiB,CAAEzB,kBAZd,CAaL0B,0BAA0B,CAAE3B,2BAbvB,CAcL4B,mBAAmB,CAAE7B,oBAdhB,CAeL8B,gBAAgB,CAAE/B,iBAfb,CAgBLgC,WAAW,CAAEjD,YAhBR,CAiBLkD,oBAAoB,CAAE5B,qBAjBjB,CAkBL6B,aAAa,CAAE5B,cAlBV,CAmBL6B,gBAAgB,CAAE5B,iBAnBb,CAoBL6B,4BAA4B,CAAE5B,6BApBzB,CAqBL6B,iBAAiB,CAAE5B,kBArBd,CAsBL6B,4BAA4B,CAAE5B,6BAtBzB,CAuBL6B,0BAA0B,CAAE5B,2BAvBvB,CAwBL6B,6BAA6B,CAAE5B,8BAxB1B,CAyBL6B,2BAA2B,CAAE5B,4BAzBxB,CA0BL6B,kBAAkB,CAAE5B,mBA1Bf,CA2BL6B,uBAAuB,CAAE5B,wBA3BpB,CA4BL6B,mCAAmC,CAAE5B,oCA5BhC,CAkCL6B,yBAAyB,CAAE5B,0BAlCtB,CAAP,CAoCD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\n }, []);\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\n }, []);\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n /**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\n resetPaymentSheetCustomer: _resetPaymentSheetCustomer,\n };\n}\n"]}
1
+ {"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","_isPlatformPaySupported","_confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","_dismissPlatformPay","_createPlatformPayPaymentMethod","_updatePlatformPaySheet","_openPlatformPaySetup","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPayPayment","dismissPlatformPay","createPlatformPayPaymentMethod","updatePlatformPaySheet","openPlatformPaySetup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CAAEnC,0BAlCtB,CAmCLoC,sBAAsB,CAAEnC,uBAnCnB,CAoCLoC,6BAA6B,CAAEnC,8BApC1B,CAqCLoC,yBAAyB,CAAEnC,0BArCtB,CAsCLoC,kBAAkB,CAAEnC,mBAtCf,CAuCLoC,8BAA8B,CAAEnC,+BAvC3B,CAwCLoC,sBAAsB,CAAEnC,uBAxCnB,CAyCLoC,oBAAoB,CAAEnC,qBAzCjB,CAAP,CA2CD","sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n PlatformPayError,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n dismissPlatformPay,\n createPlatformPayPaymentMethod,\n updatePlatformPaySheet,\n openPlatformPaySetup,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\n }, []);\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\n }, []);\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: {\n googlePay?: GooglePay.IsSupportedParams;\n }): Promise<boolean> => {\n return isPlatformPaySupported(params);\n },\n []\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n return confirmPlatformPaySetupIntent(clientSecret, params);\n },\n []\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmPaymentResult> => {\n return confirmPlatformPayPayment(clientSecret, params);\n },\n []\n );\n\n const _dismissPlatformPay = useCallback(async (): Promise<boolean> => {\n return dismissPlatformPay();\n }, []);\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.PaymentMethodResult> => {\n return createPlatformPayPaymentMethod(params);\n },\n []\n );\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }): Promise<{\n error?: StripeError<PlatformPayError>;\n }> => {\n return updatePlatformPaySheet(params);\n },\n []\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\n /**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\n resetPaymentSheetCustomer: _resetPaymentSheetCustomer,\n isPlatformPaySupported: _isPlatformPaySupported,\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n dismissPlatformPay: _dismissPlatformPay,\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={useConfirmPayment:true,useConfirmSetupIntent:true,useStripe:true,useApplePay:true,UseApplePayProps:true,usePaymentSheet:true,useGooglePay:true,useFinancialConnectionsSheet:true,initStripe:true,StripeProvider:true,StripeProviderProps:true,CardField:true,CardFieldProps:true,CardForm:true,CardFormProps:true,ApplePayButton:true,ApplePayButtonProps:true,AuBECSDebitForm:true,AuBECSDebitFormProps:true,StripeContainer:true,StripeContainerProps:true,GooglePayButton:true,GooglePayButtonProps:true,AddToWalletButton:true,AddToWalletButtonProps:true};Object.defineProperty(exports,"AddToWalletButton",{enumerable:true,get:function get(){return _AddToWalletButton.AddToWalletButton;}});Object.defineProperty(exports,"AddToWalletButtonProps",{enumerable:true,get:function get(){return _AddToWalletButton.Props;}});Object.defineProperty(exports,"ApplePayButton",{enumerable:true,get:function get(){return _ApplePayButton.ApplePayButton;}});Object.defineProperty(exports,"ApplePayButtonProps",{enumerable:true,get:function get(){return _ApplePayButton.Props;}});Object.defineProperty(exports,"AuBECSDebitForm",{enumerable:true,get:function get(){return _AuBECSDebitForm.AuBECSDebitForm;}});Object.defineProperty(exports,"AuBECSDebitFormProps",{enumerable:true,get:function get(){return _AuBECSDebitForm.Props;}});Object.defineProperty(exports,"CardField",{enumerable:true,get:function get(){return _CardField.CardField;}});Object.defineProperty(exports,"CardFieldProps",{enumerable:true,get:function get(){return _CardField.Props;}});Object.defineProperty(exports,"CardForm",{enumerable:true,get:function get(){return _CardForm.CardForm;}});Object.defineProperty(exports,"CardFormProps",{enumerable:true,get:function get(){return _CardForm.Props;}});Object.defineProperty(exports,"GooglePayButton",{enumerable:true,get:function get(){return _GooglePayButton.GooglePayButton;}});Object.defineProperty(exports,"GooglePayButtonProps",{enumerable:true,get:function get(){return _GooglePayButton.Props;}});Object.defineProperty(exports,"StripeContainer",{enumerable:true,get:function get(){return _StripeContainer.StripeContainer;}});Object.defineProperty(exports,"StripeContainerProps",{enumerable:true,get:function get(){return _StripeContainer.Props;}});Object.defineProperty(exports,"StripeProvider",{enumerable:true,get:function get(){return _StripeProvider.StripeProvider;}});Object.defineProperty(exports,"StripeProviderProps",{enumerable:true,get:function get(){return _StripeProvider.Props;}});Object.defineProperty(exports,"UseApplePayProps",{enumerable:true,get:function get(){return _useApplePay.Props;}});Object.defineProperty(exports,"initStripe",{enumerable:true,get:function get(){return _StripeProvider.initStripe;}});Object.defineProperty(exports,"useApplePay",{enumerable:true,get:function get(){return _useApplePay.useApplePay;}});Object.defineProperty(exports,"useConfirmPayment",{enumerable:true,get:function get(){return _useConfirmPayment.useConfirmPayment;}});Object.defineProperty(exports,"useConfirmSetupIntent",{enumerable:true,get:function get(){return _useConfirmSetupIntent.useConfirmSetupIntent;}});Object.defineProperty(exports,"useFinancialConnectionsSheet",{enumerable:true,get:function get(){return _useFinancialConnectionsSheet.useFinancialConnectionsSheet;}});Object.defineProperty(exports,"useGooglePay",{enumerable:true,get:function get(){return _useGooglePay.useGooglePay;}});Object.defineProperty(exports,"usePaymentSheet",{enumerable:true,get:function get(){return _usePaymentSheet.usePaymentSheet;}});Object.defineProperty(exports,"useStripe",{enumerable:true,get:function get(){return _useStripe.useStripe;}});var _useConfirmPayment=require("./hooks/useConfirmPayment");var _useConfirmSetupIntent=require("./hooks/useConfirmSetupIntent");var _useStripe=require("./hooks/useStripe");var _useApplePay=require("./hooks/useApplePay");var _usePaymentSheet=require("./hooks/usePaymentSheet");var _useGooglePay=require("./hooks/useGooglePay");var _useFinancialConnectionsSheet=require("./hooks/useFinancialConnectionsSheet");var _StripeProvider=require("./components/StripeProvider");var _CardField=require("./components/CardField");var _CardForm=require("./components/CardForm");var _ApplePayButton=require("./components/ApplePayButton");var _AuBECSDebitForm=require("./components/AuBECSDebitForm");var _StripeContainer=require("./components/StripeContainer");var _GooglePayButton=require("./components/GooglePayButton");var _AddToWalletButton=require("./components/AddToWalletButton");var _functions=require("./functions");Object.keys(_functions).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_functions[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _functions[key];}});});var _index=require("./types/index");Object.keys(_index).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_index[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _index[key];}});});
1
+ Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={useConfirmPayment:true,useConfirmSetupIntent:true,useStripe:true,usePlatformPay:true,useApplePay:true,UseApplePayProps:true,usePaymentSheet:true,useGooglePay:true,useFinancialConnectionsSheet:true,initStripe:true,StripeProvider:true,StripeProviderProps:true,CardField:true,CardFieldProps:true,CardForm:true,CardFormProps:true,ApplePayButton:true,ApplePayButtonProps:true,AuBECSDebitForm:true,AuBECSDebitFormProps:true,StripeContainer:true,StripeContainerProps:true,GooglePayButton:true,GooglePayButtonProps:true,AddToWalletButton:true,AddToWalletButtonProps:true,AddressSheet:true,AddressSheetProps:true,PlatformPayButton:true,PlatformPayButtonProps:true};Object.defineProperty(exports,"AddToWalletButton",{enumerable:true,get:function get(){return _AddToWalletButton.AddToWalletButton;}});Object.defineProperty(exports,"AddToWalletButtonProps",{enumerable:true,get:function get(){return _AddToWalletButton.Props;}});Object.defineProperty(exports,"AddressSheet",{enumerable:true,get:function get(){return _AddressSheet.AddressSheet;}});Object.defineProperty(exports,"AddressSheetProps",{enumerable:true,get:function get(){return _AddressSheet.Props;}});Object.defineProperty(exports,"ApplePayButton",{enumerable:true,get:function get(){return _ApplePayButton.ApplePayButton;}});Object.defineProperty(exports,"ApplePayButtonProps",{enumerable:true,get:function get(){return _ApplePayButton.Props;}});Object.defineProperty(exports,"AuBECSDebitForm",{enumerable:true,get:function get(){return _AuBECSDebitForm.AuBECSDebitForm;}});Object.defineProperty(exports,"AuBECSDebitFormProps",{enumerable:true,get:function get(){return _AuBECSDebitForm.Props;}});Object.defineProperty(exports,"CardField",{enumerable:true,get:function get(){return _CardField.CardField;}});Object.defineProperty(exports,"CardFieldProps",{enumerable:true,get:function get(){return _CardField.Props;}});Object.defineProperty(exports,"CardForm",{enumerable:true,get:function get(){return _CardForm.CardForm;}});Object.defineProperty(exports,"CardFormProps",{enumerable:true,get:function get(){return _CardForm.Props;}});Object.defineProperty(exports,"GooglePayButton",{enumerable:true,get:function get(){return _GooglePayButton.GooglePayButton;}});Object.defineProperty(exports,"GooglePayButtonProps",{enumerable:true,get:function get(){return _GooglePayButton.Props;}});Object.defineProperty(exports,"PlatformPayButton",{enumerable:true,get:function get(){return _PlatformPayButton.PlatformPayButton;}});Object.defineProperty(exports,"PlatformPayButtonProps",{enumerable:true,get:function get(){return _PlatformPayButton.Props;}});Object.defineProperty(exports,"StripeContainer",{enumerable:true,get:function get(){return _StripeContainer.StripeContainer;}});Object.defineProperty(exports,"StripeContainerProps",{enumerable:true,get:function get(){return _StripeContainer.Props;}});Object.defineProperty(exports,"StripeProvider",{enumerable:true,get:function get(){return _StripeProvider.StripeProvider;}});Object.defineProperty(exports,"StripeProviderProps",{enumerable:true,get:function get(){return _StripeProvider.Props;}});Object.defineProperty(exports,"UseApplePayProps",{enumerable:true,get:function get(){return _useApplePay.Props;}});Object.defineProperty(exports,"initStripe",{enumerable:true,get:function get(){return _StripeProvider.initStripe;}});Object.defineProperty(exports,"useApplePay",{enumerable:true,get:function get(){return _useApplePay.useApplePay;}});Object.defineProperty(exports,"useConfirmPayment",{enumerable:true,get:function get(){return _useConfirmPayment.useConfirmPayment;}});Object.defineProperty(exports,"useConfirmSetupIntent",{enumerable:true,get:function get(){return _useConfirmSetupIntent.useConfirmSetupIntent;}});Object.defineProperty(exports,"useFinancialConnectionsSheet",{enumerable:true,get:function get(){return _useFinancialConnectionsSheet.useFinancialConnectionsSheet;}});Object.defineProperty(exports,"useGooglePay",{enumerable:true,get:function get(){return _useGooglePay.useGooglePay;}});Object.defineProperty(exports,"usePaymentSheet",{enumerable:true,get:function get(){return _usePaymentSheet.usePaymentSheet;}});Object.defineProperty(exports,"usePlatformPay",{enumerable:true,get:function get(){return _usePlatformPay.usePlatformPay;}});Object.defineProperty(exports,"useStripe",{enumerable:true,get:function get(){return _useStripe.useStripe;}});var _useConfirmPayment=require("./hooks/useConfirmPayment");var _useConfirmSetupIntent=require("./hooks/useConfirmSetupIntent");var _useStripe=require("./hooks/useStripe");var _usePlatformPay=require("./hooks/usePlatformPay");var _useApplePay=require("./hooks/useApplePay");var _usePaymentSheet=require("./hooks/usePaymentSheet");var _useGooglePay=require("./hooks/useGooglePay");var _useFinancialConnectionsSheet=require("./hooks/useFinancialConnectionsSheet");var _StripeProvider=require("./components/StripeProvider");var _CardField=require("./components/CardField");var _CardForm=require("./components/CardForm");var _ApplePayButton=require("./components/ApplePayButton");var _AuBECSDebitForm=require("./components/AuBECSDebitForm");var _StripeContainer=require("./components/StripeContainer");var _GooglePayButton=require("./components/GooglePayButton");var _AddToWalletButton=require("./components/AddToWalletButton");var _AddressSheet=require("./components/AddressSheet");var _PlatformPayButton=require("./components/PlatformPayButton");var _functions=require("./functions");Object.keys(_functions).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_functions[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _functions[key];}});});var _index=require("./types/index");Object.keys(_index).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_index[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _index[key];}});});
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":[],"mappings":"koHACA,4DACA,oEACA,4CACA,gDACA,wDACA,kDACA,kFAGA,2DAKA,iDACA,+CACA,2DAIA,6DAIA,6DAIA,6DAIA,iEAKA,gWAEA","sourcesContent":["// hooks\nexport { useConfirmPayment } from './hooks/useConfirmPayment';\nexport { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';\nexport { useStripe } from './hooks/useStripe';\nexport { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';\nexport { usePaymentSheet } from './hooks/usePaymentSheet';\nexport { useGooglePay } from './hooks/useGooglePay';\nexport { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';\n\n//components\nexport {\n initStripe,\n StripeProvider,\n Props as StripeProviderProps,\n} from './components/StripeProvider';\nexport { CardField, Props as CardFieldProps } from './components/CardField';\nexport { CardForm, Props as CardFormProps } from './components/CardForm';\nexport {\n ApplePayButton,\n Props as ApplePayButtonProps,\n} from './components/ApplePayButton';\nexport {\n AuBECSDebitForm,\n Props as AuBECSDebitFormProps,\n} from './components/AuBECSDebitForm';\nexport {\n StripeContainer,\n Props as StripeContainerProps,\n} from './components/StripeContainer';\nexport {\n GooglePayButton,\n Props as GooglePayButtonProps,\n} from './components/GooglePayButton';\nexport {\n AddToWalletButton,\n Props as AddToWalletButtonProps,\n} from './components/AddToWalletButton';\n\nexport * from './functions';\n\nexport * from './types/index';\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":[],"mappings":"g2IACA,4DACA,oEACA,4CACA,sDACA,gDACA,wDACA,kDACA,kFAGA,2DAKA,iDACA,+CACA,2DAIA,6DAIA,6DAIA,6DAIA,iEAIA,uDAIA,iEAKA,gWAEA","sourcesContent":["// hooks\nexport { useConfirmPayment } from './hooks/useConfirmPayment';\nexport { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';\nexport { useStripe } from './hooks/useStripe';\nexport { usePlatformPay } from './hooks/usePlatformPay';\nexport { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';\nexport { usePaymentSheet } from './hooks/usePaymentSheet';\nexport { useGooglePay } from './hooks/useGooglePay';\nexport { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';\n\n//components\nexport {\n initStripe,\n StripeProvider,\n Props as StripeProviderProps,\n} from './components/StripeProvider';\nexport { CardField, Props as CardFieldProps } from './components/CardField';\nexport { CardForm, Props as CardFormProps } from './components/CardForm';\nexport {\n ApplePayButton,\n Props as ApplePayButtonProps,\n} from './components/ApplePayButton';\nexport {\n AuBECSDebitForm,\n Props as AuBECSDebitFormProps,\n} from './components/AuBECSDebitForm';\nexport {\n StripeContainer,\n Props as StripeContainerProps,\n} from './components/StripeContainer';\nexport {\n GooglePayButton,\n Props as GooglePayButtonProps,\n} from './components/GooglePayButton';\nexport {\n AddToWalletButton,\n Props as AddToWalletButtonProps,\n} from './components/AddToWalletButton';\nexport {\n AddressSheet,\n Props as AddressSheetProps,\n} from './components/AddressSheet';\nexport {\n PlatformPayButton,\n Props as PlatformPayButtonProps,\n} from './components/PlatformPayButton';\n\nexport * from './functions';\n\nexport * from './types/index';\n"]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.VerifyMicrodepositsError=exports.RetrieveSetupIntentError=exports.RetrievePaymentIntentError=exports.PaymentSheetError=exports.MissingRoutingNumber=exports.GooglePayError=exports.CreateTokenError=exports.CreatePaymentMethodError=exports.ConfirmSetupIntentError=exports.ConfirmPaymentError=exports.CollectBankAccountError=exports.CardActionError=exports.ApplePayError=void 0;var ConfirmPaymentError;exports.ConfirmPaymentError=ConfirmPaymentError;(function(ConfirmPaymentError){ConfirmPaymentError["Canceled"]="Canceled";ConfirmPaymentError["Failed"]="Failed";ConfirmPaymentError["Unknown"]="Unknown";})(ConfirmPaymentError||(exports.ConfirmPaymentError=ConfirmPaymentError={}));var CardActionError;exports.CardActionError=CardActionError;(function(CardActionError){CardActionError["Canceled"]="Canceled";CardActionError["Failed"]="Failed";CardActionError["Unknown"]="Unknown";})(CardActionError||(exports.CardActionError=CardActionError={}));var ConfirmSetupIntentError;exports.ConfirmSetupIntentError=ConfirmSetupIntentError;(function(ConfirmSetupIntentError){ConfirmSetupIntentError["Canceled"]="Canceled";ConfirmSetupIntentError["Failed"]="Failed";ConfirmSetupIntentError["Unknown"]="Unknown";})(ConfirmSetupIntentError||(exports.ConfirmSetupIntentError=ConfirmSetupIntentError={}));var CreatePaymentMethodError;exports.CreatePaymentMethodError=CreatePaymentMethodError;(function(CreatePaymentMethodError){CreatePaymentMethodError["Failed"]="Failed";})(CreatePaymentMethodError||(exports.CreatePaymentMethodError=CreatePaymentMethodError={}));var CreateTokenError;exports.CreateTokenError=CreateTokenError;(function(CreateTokenError){CreateTokenError["Failed"]="Failed";})(CreateTokenError||(exports.CreateTokenError=CreateTokenError={}));var RetrievePaymentIntentError;exports.RetrievePaymentIntentError=RetrievePaymentIntentError;(function(RetrievePaymentIntentError){RetrievePaymentIntentError["Unknown"]="Unknown";})(RetrievePaymentIntentError||(exports.RetrievePaymentIntentError=RetrievePaymentIntentError={}));var RetrieveSetupIntentError;exports.RetrieveSetupIntentError=RetrieveSetupIntentError;(function(RetrieveSetupIntentError){RetrieveSetupIntentError["Unknown"]="Unknown";})(RetrieveSetupIntentError||(exports.RetrieveSetupIntentError=RetrieveSetupIntentError={}));var ApplePayError;exports.ApplePayError=ApplePayError;(function(ApplePayError){ApplePayError["Canceled"]="Canceled";ApplePayError["Failed"]="Failed";ApplePayError["Unknown"]="Unknown";})(ApplePayError||(exports.ApplePayError=ApplePayError={}));var PaymentSheetError;exports.PaymentSheetError=PaymentSheetError;(function(PaymentSheetError){PaymentSheetError["Failed"]="Failed";PaymentSheetError["Canceled"]="Canceled";})(PaymentSheetError||(exports.PaymentSheetError=PaymentSheetError={}));var GooglePayError;exports.GooglePayError=GooglePayError;(function(GooglePayError){GooglePayError["Failed"]="Failed";GooglePayError["Canceled"]="Canceled";GooglePayError["Unknown"]="Unknown";})(GooglePayError||(exports.GooglePayError=GooglePayError={}));var MissingRoutingNumber={code:CreateTokenError.Failed,message:'You must provide a routing number for US bank accounts. This should be the ACH routing number.'};exports.MissingRoutingNumber=MissingRoutingNumber;var VerifyMicrodepositsError;exports.VerifyMicrodepositsError=VerifyMicrodepositsError;(function(VerifyMicrodepositsError){VerifyMicrodepositsError["Canceled"]="Canceled";VerifyMicrodepositsError["Failed"]="Failed";VerifyMicrodepositsError["Unknown"]="Unknown";})(VerifyMicrodepositsError||(exports.VerifyMicrodepositsError=VerifyMicrodepositsError={}));var CollectBankAccountError;exports.CollectBankAccountError=CollectBankAccountError;(function(CollectBankAccountError){CollectBankAccountError["Canceled"]="Canceled";CollectBankAccountError["Failed"]="Failed";CollectBankAccountError["Unknown"]="Unknown";})(CollectBankAccountError||(exports.CollectBankAccountError=CollectBankAccountError={}));
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.VerifyMicrodepositsError=exports.RetrieveSetupIntentError=exports.RetrievePaymentIntentError=exports.PlatformPayError=exports.PaymentSheetError=exports.MissingRoutingNumber=exports.GooglePayError=exports.CreateTokenError=exports.CreatePaymentMethodError=exports.ConfirmSetupIntentError=exports.ConfirmPaymentError=exports.CollectBankAccountError=exports.CardActionError=exports.ApplePayError=exports.AddressSheetError=void 0;var ConfirmPaymentError;exports.ConfirmPaymentError=ConfirmPaymentError;(function(ConfirmPaymentError){ConfirmPaymentError["Canceled"]="Canceled";ConfirmPaymentError["Failed"]="Failed";ConfirmPaymentError["Unknown"]="Unknown";})(ConfirmPaymentError||(exports.ConfirmPaymentError=ConfirmPaymentError={}));var CardActionError;exports.CardActionError=CardActionError;(function(CardActionError){CardActionError["Canceled"]="Canceled";CardActionError["Failed"]="Failed";CardActionError["Unknown"]="Unknown";})(CardActionError||(exports.CardActionError=CardActionError={}));var ConfirmSetupIntentError;exports.ConfirmSetupIntentError=ConfirmSetupIntentError;(function(ConfirmSetupIntentError){ConfirmSetupIntentError["Canceled"]="Canceled";ConfirmSetupIntentError["Failed"]="Failed";ConfirmSetupIntentError["Unknown"]="Unknown";})(ConfirmSetupIntentError||(exports.ConfirmSetupIntentError=ConfirmSetupIntentError={}));var CreatePaymentMethodError;exports.CreatePaymentMethodError=CreatePaymentMethodError;(function(CreatePaymentMethodError){CreatePaymentMethodError["Failed"]="Failed";})(CreatePaymentMethodError||(exports.CreatePaymentMethodError=CreatePaymentMethodError={}));var CreateTokenError;exports.CreateTokenError=CreateTokenError;(function(CreateTokenError){CreateTokenError["Failed"]="Failed";})(CreateTokenError||(exports.CreateTokenError=CreateTokenError={}));var RetrievePaymentIntentError;exports.RetrievePaymentIntentError=RetrievePaymentIntentError;(function(RetrievePaymentIntentError){RetrievePaymentIntentError["Unknown"]="Unknown";})(RetrievePaymentIntentError||(exports.RetrievePaymentIntentError=RetrievePaymentIntentError={}));var RetrieveSetupIntentError;exports.RetrieveSetupIntentError=RetrieveSetupIntentError;(function(RetrieveSetupIntentError){RetrieveSetupIntentError["Unknown"]="Unknown";})(RetrieveSetupIntentError||(exports.RetrieveSetupIntentError=RetrieveSetupIntentError={}));var ApplePayError;exports.ApplePayError=ApplePayError;(function(ApplePayError){ApplePayError["Canceled"]="Canceled";ApplePayError["Failed"]="Failed";ApplePayError["Unknown"]="Unknown";})(ApplePayError||(exports.ApplePayError=ApplePayError={}));var PaymentSheetError;exports.PaymentSheetError=PaymentSheetError;(function(PaymentSheetError){PaymentSheetError["Failed"]="Failed";PaymentSheetError["Canceled"]="Canceled";})(PaymentSheetError||(exports.PaymentSheetError=PaymentSheetError={}));var GooglePayError;exports.GooglePayError=GooglePayError;(function(GooglePayError){GooglePayError["Failed"]="Failed";GooglePayError["Canceled"]="Canceled";GooglePayError["Unknown"]="Unknown";})(GooglePayError||(exports.GooglePayError=GooglePayError={}));var MissingRoutingNumber={code:CreateTokenError.Failed,message:'You must provide a routing number for US bank accounts. This should be the ACH routing number.'};exports.MissingRoutingNumber=MissingRoutingNumber;var VerifyMicrodepositsError;exports.VerifyMicrodepositsError=VerifyMicrodepositsError;(function(VerifyMicrodepositsError){VerifyMicrodepositsError["Canceled"]="Canceled";VerifyMicrodepositsError["Failed"]="Failed";VerifyMicrodepositsError["Unknown"]="Unknown";})(VerifyMicrodepositsError||(exports.VerifyMicrodepositsError=VerifyMicrodepositsError={}));var CollectBankAccountError;exports.CollectBankAccountError=CollectBankAccountError;(function(CollectBankAccountError){CollectBankAccountError["Canceled"]="Canceled";CollectBankAccountError["Failed"]="Failed";CollectBankAccountError["Unknown"]="Unknown";})(CollectBankAccountError||(exports.CollectBankAccountError=CollectBankAccountError={}));var AddressSheetError;exports.AddressSheetError=AddressSheetError;(function(AddressSheetError){AddressSheetError["Failed"]="Failed";AddressSheetError["Canceled"]="Canceled";})(AddressSheetError||(exports.AddressSheetError=AddressSheetError={}));var PlatformPayError;exports.PlatformPayError=PlatformPayError;(function(PlatformPayError){PlatformPayError["Canceled"]="Canceled";PlatformPayError["Failed"]="Failed";PlatformPayError["Unknown"]="Unknown";})(PlatformPayError||(exports.PlatformPayError=PlatformPayError={}));
2
2
  //# sourceMappingURL=Errors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Errors.ts"],"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError"],"mappings":"0bAAYA,CAAAA,mB,2DAAAA,mB,EAAAA,mB,wBAAAA,mB,oBAAAA,mB,yBAAAA,mB,+BAAAA,mB,SAMAC,CAAAA,e,mDAAAA,e,EAAAA,e,wBAAAA,e,oBAAAA,e,yBAAAA,e,2BAAAA,e,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB,SAMAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,uBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,gB,qDAAAA,gB,EAAAA,gB,uBAAAA,gB,4BAAAA,gB,SAIAC,CAAAA,0B,yEAAAA,0B,EAAAA,0B,yBAAAA,0B,sCAAAA,0B,SAIAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,a,+CAAAA,a,EAAAA,a,wBAAAA,a,oBAAAA,a,yBAAAA,a,yBAAAA,a,SAMAC,CAAAA,iB,uDAAAA,iB,EAAAA,iB,oBAAAA,iB,2BAAAA,iB,6BAAAA,iB,SAuBAC,CAAAA,c,iDAAAA,c,EAAAA,c,oBAAAA,c,wBAAAA,c,yBAAAA,c,0BAAAA,c,MAML,GAAMC,CAAAA,oBAAoB,CAAG,CAClCC,IAAI,CAAEP,gBAAgB,CAACQ,MADW,CAElCC,OAAO,CACL,gGAHgC,CAA7B,C,qDAMKC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,wBAAAA,wB,oBAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB","sourcesContent":["export enum ConfirmPaymentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CardActionError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum ConfirmSetupIntentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CreatePaymentMethodError {\n Failed = 'Failed',\n}\n\nexport enum CreateTokenError {\n Failed = 'Failed',\n}\n\nexport enum RetrievePaymentIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum RetrieveSetupIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum ApplePayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum PaymentSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport type ErrorType =\n | 'api_connection_error'\n | 'api_error'\n | 'authentication_error'\n | 'card_error'\n | 'idempotency_error'\n | 'invalid_request_error'\n | 'rate_limit_error';\n\nexport interface StripeError<T> {\n code: T;\n message: string;\n localizedMessage?: string;\n declineCode?: string;\n stripeErrorCode?: string;\n type?: ErrorType;\n}\n\nexport enum GooglePayError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n Unknown = 'Unknown',\n}\n\nexport const MissingRoutingNumber = {\n code: CreateTokenError.Failed,\n message:\n 'You must provide a routing number for US bank accounts. This should be the ACH routing number.',\n};\n\nexport enum VerifyMicrodepositsError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CollectBankAccountError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n"]}
1
+ {"version":3,"sources":["Errors.ts"],"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError","AddressSheetError","PlatformPayError"],"mappings":"6eAAYA,CAAAA,mB,2DAAAA,mB,EAAAA,mB,wBAAAA,mB,oBAAAA,mB,yBAAAA,mB,+BAAAA,mB,SAMAC,CAAAA,e,mDAAAA,e,EAAAA,e,wBAAAA,e,oBAAAA,e,yBAAAA,e,2BAAAA,e,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB,SAMAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,uBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,gB,qDAAAA,gB,EAAAA,gB,uBAAAA,gB,4BAAAA,gB,SAIAC,CAAAA,0B,yEAAAA,0B,EAAAA,0B,yBAAAA,0B,sCAAAA,0B,SAIAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,a,+CAAAA,a,EAAAA,a,wBAAAA,a,oBAAAA,a,yBAAAA,a,yBAAAA,a,SAMAC,CAAAA,iB,uDAAAA,iB,EAAAA,iB,oBAAAA,iB,2BAAAA,iB,6BAAAA,iB,SAuBAC,CAAAA,c,iDAAAA,c,EAAAA,c,oBAAAA,c,wBAAAA,c,yBAAAA,c,0BAAAA,c,MAML,GAAMC,CAAAA,oBAAoB,CAAG,CAClCC,IAAI,CAAEP,gBAAgB,CAACQ,MADW,CAElCC,OAAO,CACL,gGAHgC,CAA7B,C,qDAMKC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,wBAAAA,wB,oBAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB,SAMAC,CAAAA,iB,uDAAAA,iB,EAAAA,iB,oBAAAA,iB,2BAAAA,iB,6BAAAA,iB,SAKAC,CAAAA,gB,qDAAAA,gB,EAAAA,gB,wBAAAA,gB,oBAAAA,gB,yBAAAA,gB,4BAAAA,gB","sourcesContent":["export enum ConfirmPaymentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CardActionError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum ConfirmSetupIntentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CreatePaymentMethodError {\n Failed = 'Failed',\n}\n\nexport enum CreateTokenError {\n Failed = 'Failed',\n}\n\nexport enum RetrievePaymentIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum RetrieveSetupIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum ApplePayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum PaymentSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport type ErrorType =\n | 'api_connection_error'\n | 'api_error'\n | 'authentication_error'\n | 'card_error'\n | 'idempotency_error'\n | 'invalid_request_error'\n | 'rate_limit_error';\n\nexport interface StripeError<T> {\n code: T;\n message: string;\n localizedMessage?: string;\n declineCode?: string;\n stripeErrorCode?: string;\n type?: ErrorType;\n}\n\nexport enum GooglePayError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n Unknown = 'Unknown',\n}\n\nexport const MissingRoutingNumber = {\n code: CreateTokenError.Failed,\n message:\n 'You must provide a routing number for US bank accounts. This should be the ACH routing number.',\n};\n\nexport enum VerifyMicrodepositsError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CollectBankAccountError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum AddressSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport enum PlatformPayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n"]}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.PaymentType=exports.InvalidShippingField=exports.IntervalUnit=exports.ContactField=exports.ButtonType=exports.ButtonStyle=exports.BillingAddressFormat=exports.ApplePayShippingType=exports.ApplePaySheetErrorType=exports.ApplePayMerchantCapability=void 0;var ApplePaySheetErrorType;exports.ApplePaySheetErrorType=ApplePaySheetErrorType;(function(ApplePaySheetErrorType){ApplePaySheetErrorType["InvalidShippingAddress"]="InvalidShippingAddress";ApplePaySheetErrorType["UnserviceableShippingAddress"]="UnserviceableShippingAddress";ApplePaySheetErrorType["InvalidCouponCode"]="InvalidCouponCode";ApplePaySheetErrorType["ExpiredCouponCode"]="ExpiredCouponCode";})(ApplePaySheetErrorType||(exports.ApplePaySheetErrorType=ApplePaySheetErrorType={}));var ContactField;exports.ContactField=ContactField;(function(ContactField){ContactField["EmailAddress"]="emailAddress";ContactField["Name"]="name";ContactField["PhoneNumber"]="phoneNumber";ContactField["PhoneticName"]="phoneticName";ContactField["PostalAddress"]="postalAddress";})(ContactField||(exports.ContactField=ContactField={}));var InvalidShippingField;exports.InvalidShippingField=InvalidShippingField;(function(InvalidShippingField){InvalidShippingField["Street"]="street";InvalidShippingField["City"]="city";InvalidShippingField["SubAdministrativeArea"]="subAdministrativeArea";InvalidShippingField["State"]="state";InvalidShippingField["PostalCode"]="postalCode";InvalidShippingField["Country"]="country";InvalidShippingField["CountryCode"]="countryCode";InvalidShippingField["SubLocality"]="subLocality";})(InvalidShippingField||(exports.InvalidShippingField=InvalidShippingField={}));var ApplePayMerchantCapability;exports.ApplePayMerchantCapability=ApplePayMerchantCapability;(function(ApplePayMerchantCapability){ApplePayMerchantCapability["Supports3DS"]="supports3DS";ApplePayMerchantCapability["SupportsCredit"]="supportsCredit";ApplePayMerchantCapability["SupportsDebit"]="supportsDebit";})(ApplePayMerchantCapability||(exports.ApplePayMerchantCapability=ApplePayMerchantCapability={}));var ApplePayShippingType;exports.ApplePayShippingType=ApplePayShippingType;(function(ApplePayShippingType){ApplePayShippingType["Shipping"]="shipping";ApplePayShippingType["Delivery"]="delivery";ApplePayShippingType["StorePickup"]="storePickup";ApplePayShippingType["ServicePickup"]="servicePickup";})(ApplePayShippingType||(exports.ApplePayShippingType=ApplePayShippingType={}));var BillingAddressFormat;exports.BillingAddressFormat=BillingAddressFormat;(function(BillingAddressFormat){BillingAddressFormat["Full"]="FULL";BillingAddressFormat["Min"]="MIN";})(BillingAddressFormat||(exports.BillingAddressFormat=BillingAddressFormat={}));var ButtonType;exports.ButtonType=ButtonType;(function(ButtonType){ButtonType[ButtonType["Default"]=0]="Default";ButtonType[ButtonType["Buy"]=1]="Buy";ButtonType[ButtonType["Book"]=6]="Book";ButtonType[ButtonType["Checkout"]=5]="Checkout";ButtonType[ButtonType["Donate"]=4]="Donate";ButtonType[ButtonType["Order"]=11]="Order";ButtonType[ButtonType["Subscribe"]=7]="Subscribe";ButtonType[ButtonType["SetUp"]=2]="SetUp";ButtonType[ButtonType["InStore"]=3]="InStore";ButtonType[ButtonType["Reload"]=8]="Reload";ButtonType[ButtonType["AddMoney"]=9]="AddMoney";ButtonType[ButtonType["TopUp"]=10]="TopUp";ButtonType[ButtonType["Rent"]=12]="Rent";ButtonType[ButtonType["Support"]=13]="Support";ButtonType[ButtonType["Contribute"]=14]="Contribute";ButtonType[ButtonType["Tip"]=15]="Tip";ButtonType[ButtonType["Continue"]=16]="Continue";ButtonType[ButtonType["Pay"]=1000]="Pay";ButtonType[ButtonType["GooglePayMark"]=1001]="GooglePayMark";})(ButtonType||(exports.ButtonType=ButtonType={}));var ButtonStyle;exports.ButtonStyle=ButtonStyle;(function(ButtonStyle){ButtonStyle[ButtonStyle["White"]=0]="White";ButtonStyle[ButtonStyle["WhiteOutline"]=1]="WhiteOutline";ButtonStyle[ButtonStyle["Black"]=2]="Black";ButtonStyle[ButtonStyle["Automatic"]=3]="Automatic";})(ButtonStyle||(exports.ButtonStyle=ButtonStyle={}));var PaymentType;exports.PaymentType=PaymentType;(function(PaymentType){PaymentType["Deferred"]="Deferred";PaymentType["Immediate"]="Immediate";PaymentType["Recurring"]="Recurring";})(PaymentType||(exports.PaymentType=PaymentType={}));var IntervalUnit;exports.IntervalUnit=IntervalUnit;(function(IntervalUnit){IntervalUnit["Minute"]="minute";IntervalUnit["Hour"]="hour";IntervalUnit["Day"]="day";IntervalUnit["Month"]="month";IntervalUnit["Year"]="year";})(IntervalUnit||(exports.IntervalUnit=IntervalUnit={}));
2
+ //# sourceMappingURL=PlatformPay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PlatformPay.ts"],"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"mappings":"iUAsBYA,CAAAA,sB,iEAAAA,sB,EAAAA,sB,oDAAAA,sB,gEAAAA,sB,0CAAAA,sB,6CAAAA,sB,kCAAAA,sB,SAOAC,CAAAA,Y,6CAAAA,Y,EAAAA,Y,gCAAAA,Y,gBAAAA,Y,8BAAAA,Y,gCAAAA,Y,qCAAAA,Y,wBAAAA,Y,SAQAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,oBAAAA,oB,gBAAAA,oB,kDAAAA,oB,kBAAAA,oB,4BAAAA,oB,sBAAAA,oB,8BAAAA,oB,iCAAAA,oB,gCAAAA,oB,SAyCAC,CAAAA,0B,yEAAAA,0B,EAAAA,0B,8BAAAA,0B,oCAAAA,0B,qCAAAA,0B,sCAAAA,0B,SAUAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,wBAAAA,oB,wBAAAA,oB,8BAAAA,oB,qCAAAA,oB,gCAAAA,oB,SAsDAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,gBAAAA,oB,iBAAAA,oB,gCAAAA,oB,SAqBAC,CAAAA,U,yCAAAA,U,EAAAA,U,CAAAA,U,yBAAAA,U,CAAAA,U,iBAAAA,U,CAAAA,U,mBAAAA,U,CAAAA,U,2BAAAA,U,CAAAA,U,uBAAAA,U,CAAAA,U,sBAAAA,U,CAAAA,U,6BAAAA,U,CAAAA,U,qBAAAA,U,CAAAA,U,yBAAAA,U,CAAAA,U,uBAAAA,U,CAAAA,U,2BAAAA,U,CAAAA,U,sBAAAA,U,CAAAA,U,oBAAAA,U,CAAAA,U,0BAAAA,U,CAAAA,U,gCAAAA,U,CAAAA,U,kBAAAA,U,CAAAA,U,4BAAAA,U,CAAAA,U,oBAAAA,U,CAAAA,U,2CAAAA,U,sBAAAA,U,SA0CAC,CAAAA,W,2CAAAA,W,EAAAA,W,CAAAA,W,qBAAAA,W,CAAAA,W,mCAAAA,W,CAAAA,W,qBAAAA,W,CAAAA,W,gCAAAA,W,uBAAAA,W,SAkBAC,CAAAA,W,2CAAAA,W,EAAAA,W,wBAAAA,W,0BAAAA,W,6BAAAA,W,uBAAAA,W,SAwCAC,CAAAA,Y,6CAAAA,Y,EAAAA,Y,oBAAAA,Y,gBAAAA,Y,cAAAA,Y,kBAAAA,Y,mBAAAA,Y,wBAAAA,Y","sourcesContent":["import type { Result as Token } from './Token';\nimport type { Result as PaymentMethod } from './PaymentMethod';\nimport type { Result as PaymentIntent } from './PaymentIntent';\nimport type { Result as SetupIntent } from './SetupIntent';\nimport type { StripeError, PlatformPayError } from './Errors';\nimport type { ShippingContact as ApplePayShippingContact } from './ApplePay';\nimport type { IsSupportedParams } from './GooglePay';\n\nexport type ApplePaySheetError =\n | {\n errorType: ApplePaySheetErrorType.InvalidShippingAddress;\n field: InvalidShippingField;\n message?: string;\n }\n | {\n errorType:\n | ApplePaySheetErrorType.UnserviceableShippingAddress\n | ApplePaySheetErrorType.InvalidCouponCode\n | ApplePaySheetErrorType.ExpiredCouponCode;\n message?: string;\n };\n\nexport enum ApplePaySheetErrorType {\n InvalidShippingAddress = 'InvalidShippingAddress',\n UnserviceableShippingAddress = 'UnserviceableShippingAddress',\n InvalidCouponCode = 'InvalidCouponCode',\n ExpiredCouponCode = 'ExpiredCouponCode',\n}\n\nexport enum ContactField {\n EmailAddress = 'emailAddress',\n Name = 'name',\n PhoneNumber = 'phoneNumber',\n PhoneticName = 'phoneticName',\n PostalAddress = 'postalAddress',\n}\n\nexport enum InvalidShippingField {\n Street = 'street',\n City = 'city',\n SubAdministrativeArea = 'subAdministrativeArea',\n State = 'state',\n PostalCode = 'postalCode',\n Country = 'country',\n CountryCode = 'countryCode',\n SubLocality = 'subLocality',\n}\n\nexport type ApplePayBaseParams = {\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: [\"JCB\", \"barcode\", \"chinaUnionPay\"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. */\n additionalEnabledNetworks?: Array<string>;\n /** The list of items that describe a purchase. For example: total, tax, discount, and grand total. */\n cartItems: Array<CartSummaryItem>;\n /** The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.*/\n requiredShippingAddressFields?: Array<ContactField>;\n /** The list of fields that you need for a billing contact in order to process the transaction. */\n requiredBillingContactFields?: Array<ContactField>;\n /** An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. */\n shippingMethods?: Array<ShippingMethod>;\n /** Set the payment capabilities you support. If set, 3DS is required. */\n merchantCapabilities?: Array<ApplePayMerchantCapability>;\n /** An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.*/\n shippingType?: ApplePayShippingType;\n /** A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. */\n supportedCountries?: Array<string>;\n};\n\nexport type ApplePayPaymentMethodParams = {\n /** Set this value to true to display the coupon code field, or pass the 'couponCode' field to autofill with a coupon code. Defaults to false. If true, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n supportsCouponCode?: boolean;\n /** Set this value to autofill with a coupon code. If provided, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n couponCode?: string;\n};\n\nexport enum ApplePayMerchantCapability {\n /** Required. This value must be supplied. */\n Supports3DS = 'supports3DS',\n /** Optional. If present, only transactions that are categorized as credit cards are allowed. */\n SupportsCredit = 'supportsCredit',\n /** Optional. If present, only transactions that are categorized as debit cards are allowed. */\n SupportsDebit = 'supportsDebit',\n}\n\n/** A type that indicates how to ship purchased items. */\nexport enum ApplePayShippingType {\n /** Default. */\n Shipping = 'shipping',\n Delivery = 'delivery',\n StorePickup = 'storePickup',\n ServicePickup = 'servicePickup',\n}\n\nexport type GooglePayBaseParams = {\n /**\n * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK.\n - Does not require the application to be uploaded to the Google Play Store.\n - Does not require a Google Pay Developer Profile.\n - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.\n - The user will see a warning message that the app is not recognized/verified.\n */\n testEnv: boolean;\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** Your merchant name, displayed in the Google Pay sheet. */\n merchantName?: string;\n /** Set to true to request an email address. Defaults to false. */\n isEmailRequired?: boolean;\n /** Set to false if you don't support credit cards. Defaults to true. */\n allowCreditCards?: boolean;\n /** If true, Google Pay is considered \"available\" if the customer's Google Pay wallet has an existing payment method. Defaults to false. */\n existingPaymentMethodRequired?: boolean;\n /** Describes the configuration for billing address collection in the Google Pay sheet. */\n billingAddressConfig?: {\n /** Set to true if billing address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */\n format?: BillingAddressFormat;\n };\n};\n\nexport type GooglePayPaymentMethodParams = {\n /** Total monetary value of the transaction. */\n amount: number;\n /** Describes the configuration for shipping address collection in the Google Pay sheet. */\n shippingAddressConfig?: {\n /** Set to true if shipping address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Set of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. Defaults to all shipping address countries. */\n allowedCountryCodes?: Array<string>;\n };\n};\n\nexport enum BillingAddressFormat {\n /** Collect name, street address, locality, region, country code, and postal code. */\n Full = 'FULL',\n /** Collect name, country code, and postal code (default). */\n Min = 'MIN',\n}\n\nexport type PaymentMethodParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams & GooglePayPaymentMethodParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;\n};\n\nexport type ConfirmParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams;\n};\n\nexport enum ButtonType {\n /** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */\n Default = 0,\n /** A button useful for product purchases. */\n Buy = 1,\n /** A button useful for booking trips, flights, or other experiences. */\n Book = 6,\n /** A button useful for purchase experiences that include other payment buttons that start with “Check out”. */\n Checkout = 5,\n /** A button used by approved nonprofit organization that lets people make donations. */\n Donate = 4,\n /** A button useful for placing orders for such as like meals or flowers. */\n Order = 11,\n /** A button useful for purchasing a subscription such as a gym membership or meal-kit delivery service. */\n Subscribe = 7,\n /** iOS only. A button useful for prompting the user to set up a card. */\n SetUp = 2,\n /** iOS only. A button useful for paying bills or invoices. */\n InStore = 3,\n /** iOS only. A button useful for adding money to a card, account, or payment system.*/\n Reload = 8,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n AddMoney = 9,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n TopUp = 10,\n /** iOS only. A button useful for renting items such as cars or scooters. */\n Rent = 12,\n /** iOS only. A button useful supporting people give money to projects, causes, organizations, and other entities.*/\n Support = 13,\n /** iOS only. A button useful to help people contribute money to projects, causes, organizations, and other entities. */\n Contribute = 14,\n /** iOS only. A button useful useful for letting people tip for goods or services. */\n Tip = 15,\n /** iOS only. A button useful for general purchases. */\n Continue = 16,\n /** Android only. A button useful for general payments. */\n Pay = 1000,\n /** Android only. A plain white button with the Google Pay logo. Use when you show Google Pay as a payment option in your payment flows. */\n GooglePayMark = 1001,\n}\n\n/** iOS only. */\nexport enum ButtonStyle {\n /** A white button with black lettering. */\n White = 0,\n /** A white button with black lettering and a black outline. */\n WhiteOutline = 1,\n /** A black button with white lettering. */\n Black = 2,\n /** Default. A button that automatically changes its appearance when the user switches between Light Mode and Dark Mode. */\n Automatic = 3,\n}\n\n/** iOS only. */\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\n/** iOS only. */\nexport enum PaymentType {\n Deferred = 'Deferred',\n Immediate = 'Immediate',\n Recurring = 'Recurring',\n}\n\n/** iOS only. Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */\nexport type DeferredCartSummaryItem = {\n paymentType: PaymentType.Deferred;\n /** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */\n deferredDate: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n paymentType: PaymentType.Immediate;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/\nexport type RecurringCartSummaryItem = {\n paymentType: PaymentType.Recurring;\n /** The amount of time – in calendar units such as Day, Month, or Year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalUnit: IntervalUnit;\n /** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalCount: number;\n /** The unix timestamp of the start date. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date. Measured in seconds. */\n endDate?: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. */\nexport enum IntervalUnit {\n Minute = 'minute',\n Hour = 'hour',\n Day = 'day',\n Month = 'month',\n Year = 'year',\n}\n\n/** iOS only. */\nexport type ShippingMethod = {\n /** A short, localized description. */\n label: string;\n /** The cost associated with this shipping option. */\n amount: string;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n /** A unique identifier for the shipping method. */\n identifier: string;\n /** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */\n detail?: string;\n /** The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n endDate?: number;\n};\n\n/** iOS only. */\nexport type ShippingContact = ApplePayShippingContact;\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = IsSupportedParams;\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n token: Token;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n token?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n"]}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayCardTokenStatus=exports.CanAddCardToWalletStatus=void 0;var GooglePayCardTokenStatus;exports.GooglePayCardTokenStatus=GooglePayCardTokenStatus;(function(GooglePayCardTokenStatus){GooglePayCardTokenStatus["TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION"]="TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION";GooglePayCardTokenStatus["TOKEN_STATE_PENDING"]="TOKEN_STATE_PENDING";GooglePayCardTokenStatus["TOKEN_STATE_SUSPENDED"]="TOKEN_STATE_SUSPENDED";GooglePayCardTokenStatus["TOKEN_STATE_ACTIVE"]="TOKEN_STATE_ACTIVE";GooglePayCardTokenStatus["TOKEN_STATE_FELICA_PENDING_PROVISIONING"]="TOKEN_STATE_FELICA_PENDING_PROVISIONING";GooglePayCardTokenStatus["TOKEN_STATE_UNTOKENIZED"]="TOKEN_STATE_UNTOKENIZED";})(GooglePayCardTokenStatus||(exports.GooglePayCardTokenStatus=GooglePayCardTokenStatus={}));var CanAddCardToWalletStatus;exports.CanAddCardToWalletStatus=CanAddCardToWalletStatus;(function(CanAddCardToWalletStatus){CanAddCardToWalletStatus["MISSING_CONFIGURATION"]="MISSING_CONFIGURATION";CanAddCardToWalletStatus["UNSUPPORTED_DEVICE"]="UNSUPPORTED_DEVICE";CanAddCardToWalletStatus["CARD_ALREADY_EXISTS"]="CARD_ALREADY_EXISTS";CanAddCardToWalletStatus["CARD_EXISTS_ON_CURRENT_DEVICE"]="CARD_EXISTS_ON_CURRENT_DEVICE";CanAddCardToWalletStatus["CARD_EXISTS_ON_PAIRED_DEVICE"]="CARD_EXISTS_ON_PAIRED_DEVICE";})(CanAddCardToWalletStatus||(exports.CanAddCardToWalletStatus=CanAddCardToWalletStatus={}));
2
+ //# sourceMappingURL=PushProvisioning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PushProvisioning.ts"],"names":["GooglePayCardTokenStatus","CanAddCardToWalletStatus"],"mappings":"qIAWYA,CAAAA,wB,qEAAAA,wB,EAAAA,wB,sFAAAA,wB,8CAAAA,wB,kDAAAA,wB,4CAAAA,wB,sFAAAA,wB,yDAAAA,wB,oCAAAA,wB,SAqDAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,kDAAAA,wB,4CAAAA,wB,8CAAAA,wB,kEAAAA,wB,mEAAAA,wB,oCAAAA,wB","sourcesContent":["import type { StripeError, GooglePayError } from './Errors';\n\nexport type GooglePayCardToken = {\n id: string;\n cardLastFour: string;\n network: number;\n serviceProvider: number;\n issuer: string;\n status: GooglePayCardTokenStatus;\n};\n\nexport enum GooglePayCardTokenStatus {\n /** */\n TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION = 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION',\n /** */\n TOKEN_STATE_PENDING = 'TOKEN_STATE_PENDING',\n /** */\n TOKEN_STATE_SUSPENDED = 'TOKEN_STATE_SUSPENDED',\n /** */\n TOKEN_STATE_ACTIVE = 'TOKEN_STATE_ACTIVE',\n /** */\n TOKEN_STATE_FELICA_PENDING_PROVISIONING = 'TOKEN_STATE_FELICA_PENDING_PROVISIONING',\n /** */\n TOKEN_STATE_UNTOKENIZED = 'TOKEN_STATE_UNTOKENIZED',\n}\n\nexport type IsCardInWalletResult =\n | {\n isInWallet: boolean;\n token?: GooglePayCardToken;\n error?: undefined;\n }\n | {\n isInWallet?: undefined;\n token?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type CanAddCardToWalletParams = {\n /** The `primary_account_identifier` value from the issued card. Can be an empty string. */\n primaryAccountIdentifier: string | null;\n /** Last 4 digits of the card number. */\n cardLastFour: 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 /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */\n hasPairedAppleWatch?: boolean;\n};\n\nexport type CanAddCardToWalletResult =\n | {\n canAddCard: boolean;\n details?: {\n token?: GooglePayCardToken;\n status?: CanAddCardToWalletStatus;\n };\n error?: undefined;\n }\n | {\n canAddCard?: undefined;\n details?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport enum CanAddCardToWalletStatus {\n /** You are missing configuration required for Push Provisioning. Make sure you've completed all steps at https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native. */\n MISSING_CONFIGURATION = 'MISSING_CONFIGURATION',\n /** This device doesn't support adding a card to the native wallet. */\n UNSUPPORTED_DEVICE = 'UNSUPPORTED_DEVICE',\n /** This card already exists on this device and any paired devices. */\n CARD_ALREADY_EXISTS = 'CARD_ALREADY_EXISTS',\n /** This card already exists on this device, but not on the paired device. */\n CARD_EXISTS_ON_CURRENT_DEVICE = 'CARD_EXISTS_ON_CURRENT_DEVICE',\n /** This card already exists on the paired device, but not on this device. */\n CARD_EXISTS_ON_PAIRED_DEVICE = 'CARD_EXISTS_ON_PAIRED_DEVICE',\n}\n"]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,GooglePay:true,ApplePayButtonComponent:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,Address:true,BillingDetails:true};Object.defineProperty(exports,"Address",{enumerable:true,get:function get(){return _Common.Address;}});exports.AuBECSDebitFormComponent=exports.ApplePayButtonComponent=exports.ApplePay=void 0;Object.defineProperty(exports,"BillingDetails",{enumerable:true,get:function get(){return _Common.BillingDetails;}});exports.Token=exports.ThreeDSecure=exports.SetupIntent=exports.PaymentSheet=exports.PaymentMethod=exports.PaymentIntent=exports.GooglePay=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=void 0;var ApplePay=_interopRequireWildcard(require("./ApplePay"));exports.ApplePay=ApplePay;var PaymentIntent=_interopRequireWildcard(require("./PaymentIntent"));exports.PaymentIntent=PaymentIntent;var PaymentMethod=_interopRequireWildcard(require("./PaymentMethod"));exports.PaymentMethod=PaymentMethod;var PaymentSheet=_interopRequireWildcard(require("./PaymentSheet"));exports.PaymentSheet=PaymentSheet;var SetupIntent=_interopRequireWildcard(require("./SetupIntent"));exports.SetupIntent=SetupIntent;var ThreeDSecure=_interopRequireWildcard(require("./ThreeDSecure"));exports.ThreeDSecure=ThreeDSecure;var GooglePay=_interopRequireWildcard(require("./GooglePay"));exports.GooglePay=GooglePay;var ApplePayButtonComponent=_interopRequireWildcard(require("./components/ApplePayButtonComponent"));exports.ApplePayButtonComponent=ApplePayButtonComponent;var AuBECSDebitFormComponent=_interopRequireWildcard(require("./components/AuBECSDebitFormComponent"));exports.AuBECSDebitFormComponent=AuBECSDebitFormComponent;var CardFieldInput=_interopRequireWildcard(require("./components/CardFieldInput"));exports.CardFieldInput=CardFieldInput;var CardFormView=_interopRequireWildcard(require("./components/CardFormView"));exports.CardFormView=CardFormView;var Token=_interopRequireWildcard(require("./Token"));exports.Token=Token;var FinancialConnections=_interopRequireWildcard(require("./FinancialConnections"));exports.FinancialConnections=FinancialConnections;var _Errors=require("./Errors");Object.keys(_Errors).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Errors[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Errors[key];}});});var _Common=require("./Common");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;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,GooglePay:true,ApplePayButtonComponent:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,PlatformPay:true,Address:true,BillingDetails:true,AddressDetails:true};Object.defineProperty(exports,"Address",{enumerable:true,get:function get(){return _Common.Address;}});Object.defineProperty(exports,"AddressDetails",{enumerable:true,get:function get(){return _Common.AddressDetails;}});exports.AuBECSDebitFormComponent=exports.ApplePayButtonComponent=exports.ApplePay=void 0;Object.defineProperty(exports,"BillingDetails",{enumerable:true,get:function get(){return _Common.BillingDetails;}});exports.Token=exports.ThreeDSecure=exports.SetupIntent=exports.PlatformPay=exports.PaymentSheet=exports.PaymentMethod=exports.PaymentIntent=exports.GooglePay=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=void 0;var ApplePay=_interopRequireWildcard(require("./ApplePay"));exports.ApplePay=ApplePay;var PaymentIntent=_interopRequireWildcard(require("./PaymentIntent"));exports.PaymentIntent=PaymentIntent;var PaymentMethod=_interopRequireWildcard(require("./PaymentMethod"));exports.PaymentMethod=PaymentMethod;var PaymentSheet=_interopRequireWildcard(require("./PaymentSheet"));exports.PaymentSheet=PaymentSheet;var SetupIntent=_interopRequireWildcard(require("./SetupIntent"));exports.SetupIntent=SetupIntent;var ThreeDSecure=_interopRequireWildcard(require("./ThreeDSecure"));exports.ThreeDSecure=ThreeDSecure;var GooglePay=_interopRequireWildcard(require("./GooglePay"));exports.GooglePay=GooglePay;var ApplePayButtonComponent=_interopRequireWildcard(require("./components/ApplePayButtonComponent"));exports.ApplePayButtonComponent=ApplePayButtonComponent;var AuBECSDebitFormComponent=_interopRequireWildcard(require("./components/AuBECSDebitFormComponent"));exports.AuBECSDebitFormComponent=AuBECSDebitFormComponent;var CardFieldInput=_interopRequireWildcard(require("./components/CardFieldInput"));exports.CardFieldInput=CardFieldInput;var CardFormView=_interopRequireWildcard(require("./components/CardFormView"));exports.CardFormView=CardFormView;var Token=_interopRequireWildcard(require("./Token"));exports.Token=Token;var FinancialConnections=_interopRequireWildcard(require("./FinancialConnections"));exports.FinancialConnections=FinancialConnections;var PlatformPay=_interopRequireWildcard(require("./PlatformPay"));exports.PlatformPay=PlatformPay;var _PushProvisioning=require("./PushProvisioning");Object.keys(_PushProvisioning).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PushProvisioning[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PushProvisioning[key];}});});var _Errors=require("./Errors");Object.keys(_Errors).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Errors[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Errors[key];}});});var _Common=require("./Common");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;}
2
2
  //# sourceMappingURL=index.js.map