@stripe/stripe-react-native 0.4.0 → 0.6.1

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 (295) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +6 -1
  3. package/android/build/.transforms/{c731e6bf5b480f659bf1c341f3f0657c → 253af79d247c9f91c901f2038cdc6938}/results.bin +0 -0
  4. package/android/build/.transforms/253af79d247c9f91c901f2038cdc6938/transformed/classes/classes.dex +0 -0
  5. package/android/build/.transforms/{e9391f6bbf8da46ff748ca7feadbce73 → 3cbaee99352386a9df7b22dbbb69831e}/results.bin +0 -0
  6. package/android/build/.transforms/3cbaee99352386a9df7b22dbbb69831e/transformed/classes/classes.dex +0 -0
  7. package/android/build/.transforms/{f0b2868ed2d4a4bb73b1ace98fe4ccfa → 8d3571dbfd2a31ee669f64a85b02f3fc}/results.bin +0 -0
  8. package/android/build/.transforms/8d3571dbfd2a31ee669f64a85b02f3fc/transformed/classes/classes.dex +0 -0
  9. package/android/build/.transforms/bcac5194839639e17669a07fd0143335/results.bin +1 -0
  10. package/android/build/.transforms/bcac5194839639e17669a07fd0143335/transformed/classes/classes.dex +0 -0
  11. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +4 -2
  12. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +1 -0
  13. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  14. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  15. package/android/build/intermediates/compile_symbol_list/debug/R.txt +553 -29
  16. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -1
  17. package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/GooglepayButtonBinding.class +0 -0
  18. package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/GooglepayButtonNoShadowBinding.class +0 -0
  19. package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/PayWithGooglepayButtonBinding.class +0 -0
  20. package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/PayWithGooglepayButtonNoShadowBinding.class +0 -0
  21. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  22. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +4 -2
  23. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  24. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +523 -29
  25. package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -1
  65. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +2 -2
  85. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.s +1 -1
  104. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
  106. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  107. package/android/build/tmp/kotlin-classes/debug/META-INF/reactnativestripesdk_debug.kotlin_module +0 -0
  108. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormView$setListeners$1.class +0 -0
  109. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormView.class +0 -0
  110. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormViewManager.class +0 -0
  111. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardChangedEvent$Companion.class +0 -0
  112. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardChangedEvent.class +0 -0
  113. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$10.class +0 -0
  114. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$6.class +0 -0
  115. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$7.class +0 -0
  116. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$8.class +0 -0
  117. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$9.class +0 -0
  118. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView.class +0 -0
  119. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldViewManager.class +0 -0
  120. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFocusEvent$Companion.class +0 -0
  121. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFocusEvent.class +0 -0
  122. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormCompleteEvent$Companion.class +0 -0
  123. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormCompleteEvent.class +0 -0
  124. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormView.class +0 -0
  125. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormViewManager.class +0 -0
  126. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CollectBankAccountLauncherFragment$createBankAccountLauncher$1.class +0 -0
  127. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CollectBankAccountLauncherFragment.class +0 -0
  128. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConfirmPaymentErrorType.class +0 -0
  129. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConfirmSetupIntentErrorType.class +0 -0
  130. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CreateTokenErrorType.class +0 -0
  131. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/DefaultPushProvisioningProxy.class +0 -0
  132. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ErrorType.class +0 -0
  133. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ErrorsKt.class +0 -0
  134. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ExtensionsKt.class +0 -0
  135. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/FormCompleteEvent$Companion.class +0 -0
  136. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/FormCompleteEvent.class +0 -0
  137. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonManager$Companion.class +0 -0
  138. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonManager.class +0 -0
  139. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonView.class +0 -0
  140. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayErrorType.class +0 -0
  141. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$1.class +0 -0
  142. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$2.class +0 -0
  143. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$3.class +0 -0
  144. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$4.class +0 -0
  145. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment.class +0 -0
  146. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.class +0 -0
  147. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/MappersKt$WhenMappings.class +0 -0
  148. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/MappersKt.class +0 -0
  149. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$WhenMappings.class +0 -0
  150. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrievePaymentIntent$1$WhenMappings.class +0 -0
  151. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrievePaymentIntent$1.class +0 -0
  152. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrieveSetupIntent$1$WhenMappings.class +0 -0
  153. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrieveSetupIntent$1.class +0 -0
  154. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment.class +0 -0
  155. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsException.class +0 -0
  156. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsFactory$WhenMappings.class +0 -0
  157. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.class +0 -0
  158. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetErrorType.class +0 -0
  159. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment.class +0 -0
  160. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragmentKt.class +0 -0
  161. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PushProvisioningProxy$createActivityEventListener$listener$1.class +0 -0
  162. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PushProvisioningProxy.class +0 -0
  163. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/RetrievePaymentIntentErrorType.class +0 -0
  164. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/RetrieveSetupIntentErrorType.class +0 -0
  165. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeContainerManager.class +0 -0
  166. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeContainerView.class +0 -0
  167. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$Companion.class +0 -0
  168. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createPaymentMethod$1.class +0 -0
  169. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenForCVCUpdate$1.class +0 -0
  170. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenFromBankAccount$1.class +0 -0
  171. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenFromCard$1.class +0 -0
  172. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1.class +0 -0
  173. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$retrievePaymentIntent$1.class +0 -0
  174. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$retrieveSetupIntent$1.class +0 -0
  175. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$verifyMicrodeposits$paymentCallback$1.class +0 -0
  176. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$verifyMicrodeposits$setupCallback$1.class +0 -0
  177. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule.class +0 -0
  178. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkPackage.class +0 -0
  179. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.class +0 -0
  180. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView$onAfterUpdateTransaction$1.class +0 -0
  181. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.class +0 -0
  182. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent$Companion.class +0 -0
  183. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent.class +0 -0
  184. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider$CREATOR.class +0 -0
  185. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider.class +0 -0
  186. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.class +0 -0
  187. package/android/build.gradle +1 -1
  188. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +1 -10
  189. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +4 -2
  190. package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +0 -4
  191. package/android/src/main/java/com/reactnativestripesdk/{StripeSdkCardView.kt → CardFieldView.kt} +6 -9
  192. package/android/src/main/java/com/reactnativestripesdk/{StripeSdkCardViewManager.kt → CardFieldViewManager.kt} +20 -16
  193. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +23 -23
  194. package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +9 -6
  195. package/android/src/main/java/com/reactnativestripesdk/Errors.kt +3 -3
  196. package/android/src/main/java/com/reactnativestripesdk/FormCompleteEvent.kt +0 -1
  197. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +1 -0
  198. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +1 -1
  199. package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +1 -1
  200. package/android/src/main/java/com/reactnativestripesdk/Mappers.kt +51 -12
  201. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +122 -0
  202. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +103 -98
  203. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +51 -58
  204. package/android/src/main/java/com/reactnativestripesdk/StripeContainerManager.kt +2 -1
  205. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +84 -124
  206. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -1
  207. package/ios/.DS_Store +0 -0
  208. package/ios/AuBECSDebitFormView.swift +15 -0
  209. package/ios/Errors.swift +9 -35
  210. package/ios/Mappers.swift +110 -5
  211. package/ios/PaymentMethodFactory.swift +46 -1
  212. package/ios/StripeSdk.m +15 -1
  213. package/ios/StripeSdk.swift +287 -105
  214. package/jest/mock.js +1 -1
  215. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  216. package/lib/commonjs/components/StripeProvider.js +1 -1
  217. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  218. package/lib/commonjs/functions.js +1 -1
  219. package/lib/commonjs/functions.js.map +1 -1
  220. package/lib/commonjs/hooks/useStripe.js +1 -1
  221. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  222. package/lib/commonjs/types/Card.js.map +1 -1
  223. package/lib/commonjs/types/NextAction.js +2 -0
  224. package/lib/commonjs/types/NextAction.js.map +1 -0
  225. package/lib/commonjs/types/PaymentIntents.js.map +1 -1
  226. package/lib/commonjs/types/PaymentMethods.js.map +1 -1
  227. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  228. package/lib/commonjs/types/index.js.map +1 -1
  229. package/lib/module/NativeStripeSdk.js.map +1 -1
  230. package/lib/module/components/StripeProvider.js +1 -1
  231. package/lib/module/components/StripeProvider.js.map +1 -1
  232. package/lib/module/functions.js +1 -1
  233. package/lib/module/functions.js.map +1 -1
  234. package/lib/module/hooks/useStripe.js +1 -1
  235. package/lib/module/hooks/useStripe.js.map +1 -1
  236. package/lib/module/types/Card.js.map +1 -1
  237. package/lib/module/types/NextAction.js +2 -0
  238. package/lib/module/types/NextAction.js.map +1 -0
  239. package/lib/module/types/PaymentIntents.js.map +1 -1
  240. package/lib/module/types/PaymentMethods.js.map +1 -1
  241. package/lib/module/types/SetupIntent.js.map +1 -1
  242. package/lib/module/types/index.js.map +1 -1
  243. package/lib/typescript/e2e/helpers.d.ts +1 -0
  244. package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +1 -0
  245. package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +1 -1
  246. package/lib/typescript/example/src/App.d.ts +2 -0
  247. package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +1 -0
  248. package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +1 -0
  249. package/lib/typescript/src/NativeStripeSdk.d.ts +4 -2
  250. package/lib/typescript/src/components/StripeProvider.d.ts +4 -10
  251. package/lib/typescript/src/functions.d.ts +10 -2
  252. package/lib/typescript/src/hooks/useStripe.d.ts +7 -2
  253. package/lib/typescript/src/types/Card.d.ts +1 -0
  254. package/lib/typescript/src/types/NextAction.d.ts +32 -0
  255. package/lib/typescript/src/types/PaymentIntents.d.ts +2 -0
  256. package/lib/typescript/src/types/PaymentMethods.d.ts +28 -2
  257. package/lib/typescript/src/types/SetupIntent.d.ts +4 -2
  258. package/lib/typescript/src/types/index.d.ts +23 -4
  259. package/package.json +4 -4
  260. package/src/NativeStripeSdk.tsx +15 -3
  261. package/src/components/StripeProvider.tsx +7 -15
  262. package/src/functions.ts +174 -3
  263. package/src/hooks/useStripe.tsx +57 -6
  264. package/src/types/Card.ts +1 -0
  265. package/src/types/NextAction.ts +44 -0
  266. package/src/types/PaymentIntents.ts +2 -0
  267. package/src/types/PaymentMethods.ts +31 -2
  268. package/src/types/SetupIntent.ts +9 -2
  269. package/src/types/index.ts +32 -4
  270. package/stripe-react-native.podspec +3 -2
  271. package/android/build/.transforms/c731e6bf5b480f659bf1c341f3f0657c/transformed/classes/classes.dex +0 -0
  272. package/android/build/.transforms/e9391f6bbf8da46ff748ca7feadbce73/transformed/classes/classes.dex +0 -0
  273. package/android/build/.transforms/f0b2868ed2d4a4bb73b1ace98fe4ccfa/transformed/classes/classes.dex +0 -0
  274. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values +0 -0
  275. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.s +0 -1
  276. package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +0 -10
  277. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConstantsKt.class +0 -0
  278. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/NextPaymentActionErrorType.class +0 -0
  279. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$configureFlowController$onFlowControllerConfigure$1.class +0 -0
  280. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$onViewCreated$paymentOptionCallback$1.class +0 -0
  281. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$onViewCreated$paymentResultCallback$1.class +0 -0
  282. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$2.class +0 -0
  283. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$3.class +0 -0
  284. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$4.class +0 -0
  285. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$5.class +0 -0
  286. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$6.class +0 -0
  287. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView.class +0 -0
  288. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardViewManager.class +0 -0
  289. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$googlePayReceiver$1.class +0 -0
  290. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$2$WhenMappings.class +0 -0
  291. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$2.class +0 -0
  292. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$3$WhenMappings.class +0 -0
  293. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$3.class +0 -0
  294. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mPaymentSheetReceiver$1.class +0 -0
  295. package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$payWithWeChatPay$1.class +0 -0
@@ -5,12 +5,10 @@ import android.content.BroadcastReceiver
5
5
  import android.content.Context
6
6
  import android.content.Intent
7
7
  import android.content.IntentFilter
8
- import android.os.AsyncTask
9
8
  import android.os.Parcelable
10
9
  import android.util.Log
11
10
  import androidx.activity.ComponentActivity
12
11
  import androidx.appcompat.app.AppCompatActivity
13
- import androidx.lifecycle.lifecycleScope
14
12
  import androidx.localbroadcastmanager.content.LocalBroadcastManager
15
13
  import com.facebook.react.bridge.*
16
14
  import com.facebook.react.module.annotations.ReactModule
@@ -20,27 +18,28 @@ import com.stripe.android.googlepaylauncher.GooglePayPaymentMethodLauncher
20
18
  import com.stripe.android.model.*
21
19
  import com.stripe.android.paymentsheet.PaymentSheetResult
22
20
  import com.stripe.android.view.AddPaymentMethodActivityStarter
23
- import kotlinx.coroutines.*
24
-
21
+ import kotlinx.coroutines.CoroutineScope
22
+ import kotlinx.coroutines.Dispatchers
23
+ import kotlinx.coroutines.launch
25
24
 
26
25
  @ReactModule(name = StripeSdkModule.NAME)
27
- class StripeSdkModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
28
- var cardFieldView: StripeSdkCardView? = null
26
+ class StripeSdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
27
+ var cardFieldView: CardFieldView? = null
29
28
  var cardFormView: CardFormView? = null
30
- private lateinit var localBroadcastManager: LocalBroadcastManager
31
29
 
32
30
  override fun getName(): String {
33
31
  return "StripeSdk"
34
32
  }
35
33
  private lateinit var stripe: Stripe
36
34
 
35
+ private lateinit var paymentLauncherFragment: PaymentLauncherFragment
36
+
37
37
  private lateinit var publishableKey: String
38
38
  private var stripeAccountId: String? = null
39
39
  private var paymentSheetFragment: PaymentSheetFragment? = null
40
40
 
41
41
  private var urlScheme: String? = null
42
42
  private var confirmPromise: Promise? = null
43
- private var handleCardActionPromise: Promise? = null
44
43
  private var confirmSetupIntentPromise: Promise? = null
45
44
  private var confirmPaymentSheetPaymentPromise: Promise? = null
46
45
  private var presentPaymentSheetPromise: Promise? = null
@@ -79,61 +78,6 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
79
78
  }
80
79
  })
81
80
 
82
- stripe.onPaymentResult(requestCode, data, object : ApiResultCallback<PaymentIntentResult> {
83
- override fun onSuccess(result: PaymentIntentResult) {
84
- val paymentIntent = result.intent
85
-
86
- when (paymentIntent.status) {
87
- StripeIntent.Status.Succeeded,
88
- StripeIntent.Status.Processing,
89
- StripeIntent.Status.RequiresCapture -> {
90
- val pi = createResult("paymentIntent", mapFromPaymentIntentResult(paymentIntent))
91
- confirmPromise?.resolve(pi)
92
- handleCardActionPromise?.resolve(pi)
93
- }
94
- StripeIntent.Status.RequiresAction -> {
95
- if (isPaymentIntentNextActionVoucherBased(paymentIntent.nextActionType)) {
96
- val pi = createResult("paymentIntent", mapFromPaymentIntentResult(paymentIntent))
97
- confirmPromise?.resolve(pi)
98
- handleCardActionPromise?.resolve(pi)
99
- } else {
100
- (paymentIntent.lastPaymentError)?.let {
101
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), it))
102
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Canceled.toString(), it))
103
- } ?: run {
104
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), "The payment has been canceled"))
105
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Canceled.toString(), "The payment has been canceled"))
106
- }
107
- }
108
- }
109
- StripeIntent.Status.RequiresPaymentMethod -> {
110
- val error = paymentIntent.lastPaymentError
111
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), error))
112
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Failed.toString(), error))
113
- }
114
- StripeIntent.Status.RequiresConfirmation -> {
115
- val pi = createResult("paymentIntent", mapFromPaymentIntentResult(paymentIntent))
116
- handleCardActionPromise?.resolve(pi)
117
- }
118
- StripeIntent.Status.Canceled -> {
119
- val error = paymentIntent.lastPaymentError
120
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), error))
121
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Canceled.toString(), error))
122
- }
123
- else -> {
124
- val errorMessage = "unhandled error: ${paymentIntent.status}"
125
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Unknown.toString(), errorMessage))
126
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Unknown.toString(), errorMessage))
127
- }
128
- }
129
- }
130
-
131
- override fun onError(e: Exception) {
132
- confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), e))
133
- handleCardActionPromise?.resolve(createError(NextPaymentActionErrorType.Failed.toString(), e))
134
- }
135
- })
136
-
137
81
  paymentSheetFragment?.activity?.activityResultRegistry?.dispatchResult(requestCode, resultCode, data)
138
82
  googlePayFragment?.activity?.activityResultRegistry?.dispatchResult(requestCode, resultCode, data)
139
83
 
@@ -150,7 +94,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
150
94
  }
151
95
 
152
96
  init {
153
- reactContext.addActivityEventListener(mActivityEventListener);
97
+ reactContext.addActivityEventListener(mActivityEventListener)
154
98
  }
155
99
 
156
100
  private fun configure3dSecure(params: ReadableMap) {
@@ -271,13 +215,14 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
271
215
  }
272
216
 
273
217
  @ReactMethod
218
+ @SuppressWarnings("unused")
274
219
  fun initialise(params: ReadableMap, promise: Promise) {
275
220
  val publishableKey = getValOr(params, "publishableKey", null) as String
276
221
  val appInfo = getMapOrNull(params, "appInfo") as ReadableMap
277
222
  this.stripeAccountId = getValOr(params, "stripeAccountId", null)
278
223
  val urlScheme = getValOr(params, "urlScheme", null)
279
- val setUrlSchemeOnAndroid = getBooleanOrFalse(params, "setUrlSchemeOnAndroid")
280
- this.urlScheme = if (setUrlSchemeOnAndroid) urlScheme else null
224
+ val setReturnUrlSchemeOnAndroid = getBooleanOrFalse(params, "setReturnUrlSchemeOnAndroid")
225
+ this.urlScheme = if (setReturnUrlSchemeOnAndroid) urlScheme else null
281
226
 
282
227
  getMapOrNull(params, "threeDSecureParams")?.let {
283
228
  configure3dSecure(it)
@@ -295,11 +240,16 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
295
240
 
296
241
  PaymentConfiguration.init(reactApplicationContext, publishableKey, stripeAccountId)
297
242
 
243
+ paymentLauncherFragment = PaymentLauncherFragment(stripe, publishableKey, stripeAccountId)
244
+ (currentActivity as AppCompatActivity).supportFragmentManager.beginTransaction()
245
+ .add(paymentLauncherFragment, "payment_launcher_fragment")
246
+ .commit()
247
+
298
248
  val localBroadcastManager = LocalBroadcastManager.getInstance(reactApplicationContext)
299
- localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_PAYMENT_RESULT_ACTION));
300
- localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_PAYMENT_OPTION_ACTION));
301
- localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_CONFIGURE_FLOW_CONTROLLER));
302
- localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_INIT_PAYMENT_SHEET));
249
+ localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_PAYMENT_RESULT_ACTION))
250
+ localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_PAYMENT_OPTION_ACTION))
251
+ localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_CONFIGURE_FLOW_CONTROLLER))
252
+ localBroadcastManager.registerReceiver(mPaymentSheetReceiver, IntentFilter(ON_INIT_PAYMENT_SHEET))
303
253
 
304
254
  localBroadcastManager.registerReceiver(googlePayReceiver, IntentFilter(ON_GOOGLE_PAY_FRAGMENT_CREATED))
305
255
  localBroadcastManager.registerReceiver(googlePayReceiver, IntentFilter(ON_INIT_GOOGLE_PAY))
@@ -310,6 +260,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
310
260
  }
311
261
 
312
262
  @ReactMethod
263
+ @SuppressWarnings("unused")
313
264
  fun initPaymentSheet(params: ReadableMap, promise: Promise) {
314
265
  val activity = currentActivity as AppCompatActivity?
315
266
 
@@ -330,12 +281,14 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
330
281
  }
331
282
 
332
283
  @ReactMethod
284
+ @SuppressWarnings("unused")
333
285
  fun presentPaymentSheet(promise: Promise) {
334
286
  this.presentPaymentSheetPromise = promise
335
287
  paymentSheetFragment?.present()
336
288
  }
337
289
 
338
290
  @ReactMethod
291
+ @SuppressWarnings("unused")
339
292
  fun confirmPaymentSheetPayment(promise: Promise) {
340
293
  this.confirmPaymentSheetPaymentPromise = promise
341
294
  paymentSheetFragment?.confirmPayment()
@@ -343,22 +296,22 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
343
296
 
344
297
  private fun payWithFpx() {
345
298
  AddPaymentMethodActivityStarter(currentActivity as AppCompatActivity)
346
- .startForResult(AddPaymentMethodActivityStarter.Args.Builder()
347
- .setPaymentMethodType(PaymentMethod.Type.Fpx)
348
- .build()
299
+ .startForResult(
300
+ AddPaymentMethodActivityStarter.Args.Builder()
301
+ .setPaymentMethodType(PaymentMethod.Type.Fpx)
302
+ .build()
349
303
  )
350
304
  }
351
305
 
352
306
  private fun onFpxPaymentMethodResult(result: AddPaymentMethodActivityStarter.Result) {
353
307
  when (result) {
354
308
  is AddPaymentMethodActivityStarter.Result.Success -> {
355
- val activity = currentActivity as ComponentActivity
356
-
357
- stripe.confirmPayment(activity,
309
+ paymentLauncherFragment.paymentLauncher.confirm(
358
310
  ConfirmPaymentIntentParams.createWithPaymentMethodId(
359
311
  result.paymentMethod.id!!,
360
- confirmPaymentClientSecret!!,
361
- ));
312
+ confirmPaymentClientSecret!!
313
+ )
314
+ )
362
315
  }
363
316
  is AddPaymentMethodActivityStarter.Result.Failure -> {
364
317
  confirmPromise?.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), result.exception))
@@ -371,6 +324,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
371
324
  }
372
325
 
373
326
  @ReactMethod
327
+ @SuppressWarnings("unused")
374
328
  fun createPaymentMethod(data: ReadableMap, options: ReadableMap, promise: Promise) {
375
329
  val cardParams = (cardFieldView?.cardParams ?: cardFormView?.cardParams) ?: run {
376
330
  promise.resolve(createError("Failed", "Card details not complete"))
@@ -384,8 +338,8 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
384
338
  stripe.createPaymentMethod(
385
339
  paymentMethodCreateParams,
386
340
  callback = object : ApiResultCallback<PaymentMethod> {
387
- override fun onError(error: Exception) {
388
- promise.resolve(createError("Failed", error))
341
+ override fun onError(e: Exception) {
342
+ promise.resolve(createError("Failed", e))
389
343
  }
390
344
 
391
345
  override fun onSuccess(result: PaymentMethod) {
@@ -396,6 +350,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
396
350
  }
397
351
 
398
352
  @ReactMethod
353
+ @SuppressWarnings("unused")
399
354
  fun createToken(params: ReadableMap, promise: Promise) {
400
355
  val type = getValOr(params, "type", null)
401
356
  if (type == null) {
@@ -458,7 +413,8 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
458
413
  expYear = cardParamsMap["exp_year"] as Int,
459
414
  cvc = cardParamsMap["cvc"] as String,
460
415
  address = mapToAddress(address, cardAddress),
461
- name = getValOr(params, "name", null)
416
+ name = getValOr(params, "name", null),
417
+ currency = getValOr(params, "currency", null),
462
418
  )
463
419
 
464
420
  CoroutineScope(Dispatchers.IO).launch {
@@ -475,6 +431,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
475
431
  }
476
432
 
477
433
  @ReactMethod
434
+ @SuppressWarnings("unused")
478
435
  fun createTokenForCVCUpdate(cvc: String, promise: Promise) {
479
436
  stripe.createCvcUpdateToken(
480
437
  cvc,
@@ -486,53 +443,55 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
486
443
  promise.resolve(res)
487
444
  }
488
445
 
489
- override fun onError(error: Exception) {
490
- promise.resolve(createError("Failed", error))
446
+ override fun onError(e: Exception) {
447
+ promise.resolve(createError("Failed", e))
491
448
  }
492
449
  }
493
450
  )
494
451
  }
495
452
 
496
453
  @ReactMethod
497
- fun handleCardAction(paymentIntentClientSecret: String, promise: Promise) {
498
- val activity = currentActivity as ComponentActivity
499
- if (activity != null) {
500
- handleCardActionPromise = promise
501
- stripe.handleNextActionForPayment(activity, paymentIntentClientSecret)
502
- }
454
+ @SuppressWarnings("unused")
455
+ fun handleNextAction(paymentIntentClientSecret: String, promise: Promise) {
456
+ paymentLauncherFragment.clientSecret = paymentIntentClientSecret
457
+ paymentLauncherFragment.promise = promise
458
+ paymentLauncherFragment.paymentLauncher.handleNextActionForPaymentIntent(paymentIntentClientSecret)
503
459
  }
504
460
 
505
- private fun payWithWeChatPay(paymentIntentClientSecret: String, appId: String) {
506
- val activity = currentActivity as ComponentActivity
507
-
508
- activity.lifecycleScope.launch {
509
- stripe.createPaymentMethod(PaymentMethodCreateParams.createWeChatPay()).id?.let { paymentMethodId ->
510
- val confirmPaymentIntentParams =
511
- ConfirmPaymentIntentParams.createWithPaymentMethodId(
512
- paymentMethodId = paymentMethodId,
513
- clientSecret = paymentIntentClientSecret,
514
- paymentMethodOptions = PaymentMethodOptionsParams.WeChatPay(
515
- appId
516
- )
517
- )
518
- stripe.confirmPayment(activity, confirmPaymentIntentParams)
519
- }
520
- }
521
- }
461
+ // TODO: Uncomment when WeChat is re-enabled in stripe-ios
462
+ // private fun payWithWeChatPay(paymentIntentClientSecret: String, appId: String) {
463
+ // val activity = currentActivity as ComponentActivity
464
+ //
465
+ // activity.lifecycleScope.launch {
466
+ // stripe.createPaymentMethod(PaymentMethodCreateParams.createWeChatPay()).id?.let { paymentMethodId ->
467
+ // val confirmPaymentIntentParams =
468
+ // ConfirmPaymentIntentParams.createWithPaymentMethodId(
469
+ // paymentMethodId = paymentMethodId,
470
+ // clientSecret = paymentIntentClientSecret,
471
+ // paymentMethodOptions = PaymentMethodOptionsParams.WeChatPay(
472
+ // appId
473
+ // )
474
+ // )
475
+ // paymentLauncherFragment.paymentLauncher.confirm(confirmPaymentIntentParams)
476
+ // }
477
+ // }
478
+ // }
522
479
 
523
480
  @ReactMethod
481
+ @SuppressWarnings("unused")
524
482
  fun confirmPayment(paymentIntentClientSecret: String, params: ReadableMap, options: ReadableMap, promise: Promise) {
525
- confirmPromise = promise
526
- confirmPaymentClientSecret = paymentIntentClientSecret
527
-
528
483
  val paymentMethodType = getValOr(params, "type")?.let { mapToPaymentMethodType(it) } ?: run {
529
484
  promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), "You must provide paymentMethodType"))
530
485
  return
531
486
  }
532
487
 
488
+ paymentLauncherFragment.clientSecret = paymentIntentClientSecret
489
+ paymentLauncherFragment.promise = promise
490
+
533
491
  val testOfflineBank = getBooleanOrFalse(params, "testOfflineBank")
534
492
 
535
493
  if (paymentMethodType == PaymentMethod.Type.Fpx && !testOfflineBank) {
494
+ confirmPaymentClientSecret = paymentIntentClientSecret
536
495
  payWithFpx()
537
496
  return
538
497
  }
@@ -550,18 +509,21 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
550
509
  val factory = PaymentMethodCreateParamsFactory(paymentIntentClientSecret, params, cardFieldView, cardFormView)
551
510
 
552
511
  try {
553
- val activity = currentActivity as ComponentActivity
554
512
  val confirmParams = factory.createConfirmParams(paymentMethodType)
513
+ urlScheme?.let {
514
+ confirmParams.returnUrl = mapToReturnURL(urlScheme)
515
+ }
555
516
  confirmParams.shipping = mapToShippingDetails(getMapOrNull(params, "shippingDetails"))
556
- stripe.confirmPayment(activity, confirmParams)
517
+ paymentLauncherFragment.paymentLauncher.confirm(confirmParams)
557
518
  } catch (error: PaymentMethodCreateParamsException) {
558
519
  promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), error))
559
520
  }
560
521
  }
561
522
 
562
523
  @ReactMethod
524
+ @SuppressWarnings("unused")
563
525
  fun retrievePaymentIntent(clientSecret: String, promise: Promise) {
564
- AsyncTask.execute {
526
+ CoroutineScope(Dispatchers.IO).launch {
565
527
  val paymentIntent = stripe.retrievePaymentIntentSynchronous(clientSecret)
566
528
  paymentIntent?.let {
567
529
  promise.resolve(createResult("paymentIntent", mapFromPaymentIntentResult(it)))
@@ -572,8 +534,9 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
572
534
  }
573
535
 
574
536
  @ReactMethod
537
+ @SuppressWarnings("unused")
575
538
  fun retrieveSetupIntent(clientSecret: String, promise: Promise) {
576
- AsyncTask.execute {
539
+ CoroutineScope(Dispatchers.IO).launch {
577
540
  val setupIntent = stripe.retrieveSetupIntentSynchronous(clientSecret)
578
541
  setupIntent?.let {
579
542
  promise.resolve(createResult("setupIntent", mapFromSetupIntentResult(it)))
@@ -584,6 +547,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
584
547
  }
585
548
 
586
549
  @ReactMethod
550
+ @SuppressWarnings("unused")
587
551
  fun confirmSetupIntent(setupIntentClientSecret: String, params: ReadableMap, options: ReadableMap, promise: Promise) {
588
552
  confirmSetupIntentPromise = promise
589
553
 
@@ -597,6 +561,9 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
597
561
  try {
598
562
  val activity = currentActivity as ComponentActivity
599
563
  val confirmParams = factory.createSetupParams(paymentMethodType)
564
+ urlScheme?.let {
565
+ confirmParams.returnUrl = mapToReturnURL(urlScheme)
566
+ }
600
567
  stripe.confirmSetupIntent(activity, confirmParams)
601
568
  } catch (error: PaymentMethodCreateParamsException) {
602
569
  promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), error))
@@ -604,6 +571,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
604
571
  }
605
572
 
606
573
  @ReactMethod
574
+ @SuppressWarnings("unused")
607
575
  fun isGooglePaySupported(params: ReadableMap?, promise: Promise) {
608
576
  val fragment = GooglePayPaymentMethodLauncherFragment(
609
577
  currentActivity as AppCompatActivity,
@@ -618,6 +586,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
618
586
  }
619
587
 
620
588
  @ReactMethod
589
+ @SuppressWarnings("unused")
621
590
  fun initGooglePay(params: ReadableMap, promise: Promise) {
622
591
  val activity = currentActivity as AppCompatActivity
623
592
  val fragment = GooglePayFragment().also {
@@ -633,6 +602,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
633
602
  }
634
603
 
635
604
  @ReactMethod
605
+ @SuppressWarnings("unused")
636
606
  fun presentGooglePay(params: ReadableMap, promise: Promise) {
637
607
  val clientSecret = getValOr(params, "clientSecret") ?: run {
638
608
  promise.resolve(createError(GooglePayErrorType.Failed.toString(), "you must provide clientSecret"))
@@ -651,6 +621,7 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
651
621
  }
652
622
 
653
623
  @ReactMethod
624
+ @SuppressWarnings("unused")
654
625
  fun createGooglePayPaymentMethod(params: ReadableMap, promise: Promise) {
655
626
  val currencyCode = getValOr(params, "currencyCode", null) ?: run {
656
627
  promise.resolve(createError(GooglePayErrorType.Failed.toString(), "you must provide currencyCode"))
@@ -664,17 +635,6 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
664
635
  googlePayFragment?.createPaymentMethod(currencyCode, amount)
665
636
  }
666
637
 
667
-
668
- /// Check paymentIntent.nextAction is voucher-based payment method.
669
- /// If it's voucher-based, the paymentIntent status stays in requiresAction until the voucher is paid or expired.
670
- /// Currently only OXXO payment is voucher-based.
671
- private fun isPaymentIntentNextActionVoucherBased(nextAction: StripeIntent.NextActionType?): Boolean {
672
- nextAction?.let {
673
- return it == StripeIntent.NextActionType.DisplayOxxoDetails
674
- }
675
- return false
676
- }
677
-
678
638
  companion object {
679
639
  const val NAME = "StripeSdk"
680
640
  }
@@ -11,6 +11,6 @@ class StripeSdkPackage : ReactPackage {
11
11
  }
12
12
 
13
13
  override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
14
- return listOf<ViewManager<*, *>>(StripeSdkCardViewManager(), AuBECSDebitFormViewManager(), StripeContainerManager(), CardFormViewManager(), GooglePayButtonManager())
14
+ return listOf<ViewManager<*, *>>(CardFieldViewManager(), AuBECSDebitFormViewManager(), StripeContainerManager(), CardFormViewManager(), GooglePayButtonManager())
15
15
  }
16
16
  }
package/ios/.DS_Store ADDED
Binary file
@@ -43,6 +43,21 @@ class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate {
43
43
  if let backgroundColor = formStyle["backgroundColor"] as? String {
44
44
  auBecsFormView?.formBackgroundColor = UIColor(hexString: backgroundColor)
45
45
  }
46
+ if let placeholderColor = formStyle["placeholderColor"] as? String {
47
+ auBecsFormView?.formPlaceholderColor = UIColor(hexString: placeholderColor)
48
+ }
49
+ if let textErrorColor = formStyle["textErrorColor"] as? String {
50
+ auBecsFormView?.formTextErrorColor = UIColor(hexString: textErrorColor)
51
+ }
52
+ if let borderColor = formStyle["borderColor"] as? String {
53
+ auBecsFormView?.layer.borderColor = UIColor(hexString: borderColor).cgColor
54
+ }
55
+ if let borderRadius = formStyle["borderRadius"] as? CGFloat {
56
+ auBecsFormView?.layer.cornerRadius = borderRadius
57
+ }
58
+ if let borderWidth = formStyle["borderWidth"] as? CGFloat {
59
+ auBecsFormView?.layer.borderWidth = borderWidth
60
+ }
46
61
  }
47
62
 
48
63
  func auBECSDebitForm(_ form: STPAUBECSDebitFormView, didChangeToStateComplete complete: Bool) {
package/ios/Errors.swift CHANGED
@@ -1,35 +1,9 @@
1
1
  import Stripe
2
2
 
3
- enum ConfirmPaymentErrorType: String {
4
- case Failed, Canceled, Unknown
5
- }
6
-
7
- enum ApplePayErrorType: String {
8
- case Failed, Canceled, Unknown
9
- }
10
-
11
- enum NextPaymentActionErrorType: String {
12
- case Failed, Canceled, Unknown
13
- }
14
-
15
- enum ConfirmSetupIntentErrorType: String {
16
- case Failed, Canceled, Unknown
17
- }
18
-
19
- enum RetrievePaymentIntentErrorType: String {
20
- case Unknown
21
- }
22
-
23
- enum RetrieveSetupIntentErrorType: String {
24
- case Unknown
25
- }
26
-
27
- enum PaymentSheetErrorType: String {
28
- case Failed, Canceled
29
- }
30
-
31
- enum CreateTokenErrorType: String {
32
- case Failed
3
+ enum ErrorType {
4
+ static let Failed = "Failed"
5
+ static let Canceled = "Canceled"
6
+ static let Unknown = "Unknown"
33
7
  }
34
8
 
35
9
  class Errors {
@@ -76,11 +50,11 @@ class Errors {
76
50
  class func createError (_ code: String, _ error: NSError?) -> NSDictionary {
77
51
  let value: NSDictionary = [
78
52
  "code": code,
79
- "message": error?.userInfo["com.stripe.lib:ErrorMessageKey"] ?? error?.userInfo["NSLocalizedDescription"] ?? NSNull(),
80
- "localizedMessage": error?.userInfo["NSLocalizedDescription"] ?? NSNull(),
81
- "declineCode": error?.userInfo["com.stripe.lib:DeclineCodeKey"] ?? NSNull(),
82
- "stripeErrorCode": error?.userInfo["com.stripe.lib:StripeErrorCodeKey"] ?? NSNull(),
83
- "type": error?.userInfo["com.stripe.lib:StripeErrorTypeKey"] ?? NSNull(),
53
+ "message": error?.userInfo[STPError.errorMessageKey] ?? NSNull(),
54
+ "localizedMessage": error?.localizedDescription ?? NSNull(),
55
+ "declineCode": error?.userInfo[STPError.stripeDeclineCodeKey] ?? NSNull(),
56
+ "stripeErrorCode": error?.userInfo[STPError.stripeErrorCodeKey] ?? NSNull(),
57
+ "type": error?.userInfo[STPError.stripeErrorTypeKey] ?? NSNull(),
84
58
  ]
85
59
 
86
60
  return ["error": value]