@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,10 +5,9 @@ import com.facebook.react.bridge.ReadableMap
5
5
  import com.facebook.react.common.MapBuilder
6
6
  import com.facebook.react.uimanager.SimpleViewManager
7
7
  import com.facebook.react.uimanager.ThemedReactContext
8
- import com.facebook.react.uimanager.UIManagerModule
9
8
  import com.facebook.react.uimanager.annotations.ReactProp
10
9
 
11
- class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
10
+ class CardFieldViewManager : SimpleViewManager<CardFieldView>() {
12
11
  override fun getName() = "CardField"
13
12
 
14
13
  private var reactContextRef: ThemedReactContext? = null
@@ -19,7 +18,7 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
19
18
  CardChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onCardChange"))
20
19
  }
21
20
 
22
- override fun receiveCommand(root: StripeSdkCardView, commandId: String?, args: ReadableArray?) {
21
+ override fun receiveCommand(root: CardFieldView, commandId: String?, args: ReadableArray?) {
23
22
  when (commandId) {
24
23
  "focus" -> root.requestFocusFromJS()
25
24
  "blur" -> root.requestBlurFromJS()
@@ -28,33 +27,38 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
28
27
  }
29
28
 
30
29
  @ReactProp(name = "dangerouslyGetFullCardDetails")
31
- fun setDangerouslyGetFullCardDetails(view: StripeSdkCardView, dangerouslyGetFullCardDetails: Boolean = false) {
32
- view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails);
30
+ @SuppressWarnings("unused")
31
+ fun setDangerouslyGetFullCardDetails(view: CardFieldView, dangerouslyGetFullCardDetails: Boolean = false) {
32
+ view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails)
33
33
  }
34
34
 
35
35
  @ReactProp(name = "postalCodeEnabled")
36
- fun setPostalCodeEnabled(view: StripeSdkCardView, postalCodeEnabled: Boolean = true) {
37
- view.setPostalCodeEnabled(postalCodeEnabled);
36
+ @SuppressWarnings("unused")
37
+ fun setPostalCodeEnabled(view: CardFieldView, postalCodeEnabled: Boolean = true) {
38
+ view.setPostalCodeEnabled(postalCodeEnabled)
38
39
  }
39
40
 
40
41
  @ReactProp(name = "autofocus")
41
- fun setAutofocus(view: StripeSdkCardView, autofocus: Boolean = false) {
42
- view.setAutofocus(autofocus);
42
+ @SuppressWarnings("unused")
43
+ fun setAutofocus(view: CardFieldView, autofocus: Boolean = false) {
44
+ view.setAutofocus(autofocus)
43
45
  }
44
46
 
45
47
  @ReactProp(name = "cardStyle")
46
- fun setCardStyle(view: StripeSdkCardView, cardStyle: ReadableMap) {
47
- view.setCardStyle(cardStyle);
48
+ @SuppressWarnings("unused")
49
+ fun setCardStyle(view: CardFieldView, cardStyle: ReadableMap) {
50
+ view.setCardStyle(cardStyle)
48
51
  }
49
52
 
50
53
  @ReactProp(name = "placeholder")
51
- fun setPlaceHolders(view: StripeSdkCardView, placeholder: ReadableMap) {
52
- view.setPlaceHolders(placeholder);
54
+ @SuppressWarnings("unused")
55
+ fun setPlaceHolders(view: CardFieldView, placeholder: ReadableMap) {
56
+ view.setPlaceHolders(placeholder)
53
57
  }
54
58
 
55
- override fun createViewInstance(reactContext: ThemedReactContext): StripeSdkCardView {
59
+ override fun createViewInstance(reactContext: ThemedReactContext): CardFieldView {
56
60
  val stripeSdkModule: StripeSdkModule? = reactContext.getNativeModule(StripeSdkModule::class.java)
57
- val view = StripeSdkCardView(reactContext)
61
+ val view = CardFieldView(reactContext)
58
62
 
59
63
  reactContextRef = reactContext
60
64
 
@@ -62,7 +66,7 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
62
66
  return view
63
67
  }
64
68
 
65
- override fun onDropViewInstance(view: StripeSdkCardView) {
69
+ override fun onDropViewInstance(view: CardFieldView) {
66
70
  super.onDropViewInstance(view)
67
71
 
68
72
  val stripeSdkModule: StripeSdkModule? = reactContextRef?.getNativeModule(StripeSdkModule::class.java)
@@ -17,7 +17,7 @@ import com.stripe.android.model.PaymentMethodCreateParams
17
17
  import com.stripe.android.view.CardFormView
18
18
  import com.stripe.android.view.CardInputListener
19
19
 
20
- class CardFormView(private val context: ThemedReactContext) : FrameLayout(context) {
20
+ class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
21
21
  private var cardForm: CardFormView = CardFormView(context, null, R.style.StripeCardFormView_Borderless)
22
22
  private var mEventDispatcher: EventDispatcher? = context.getNativeModule(UIManagerModule::class.java)?.eventDispatcher
23
23
  private var dangerouslyGetFullCardDetails: Boolean = false
@@ -30,7 +30,6 @@ class CardFormView(private val context: ThemedReactContext) : FrameLayout(contex
30
30
  init {
31
31
  cardFormViewBinding.cardMultilineWidgetContainer.isFocusable = true
32
32
  cardFormViewBinding.cardMultilineWidgetContainer.isFocusableInTouchMode = true
33
- cardFormViewBinding.cardMultilineWidgetContainer.requestFocus()
34
33
 
35
34
  addView(cardForm)
36
35
  setListeners()
@@ -46,27 +45,28 @@ class CardFormView(private val context: ThemedReactContext) : FrameLayout(contex
46
45
  cardFormView.postalCodeContainer.visibility = visibility
47
46
  }
48
47
 
49
- fun setPlaceHolders(value: ReadableMap) {
50
- val cardFormView = StripeCardFormViewBinding.bind(cardForm)
51
-
52
- val numberPlaceholder = getValOr(value, "number", null)
53
- val expirationPlaceholder = getValOr(value, "expiration", null)
54
- val cvcPlaceholder = getValOr(value, "cvc", null)
55
- val postalCodePlaceholder = getValOr(value, "postalCode", null)
56
-
57
- numberPlaceholder?.let {
58
- // multilineWidgetBinding.tlCardNumber.hint = it
59
- }
60
- expirationPlaceholder?.let {
61
- multilineWidgetBinding.tlExpiry.hint = it
62
- }
63
- cvcPlaceholder?.let {
64
- multilineWidgetBinding.tlCvc.hint = it
65
- }
66
- postalCodePlaceholder?.let {
67
- cardFormView.postalCodeContainer.hint = it
68
- }
69
- }
48
+ // TODO: uncomment when ios-sdk allows for this
49
+ // fun setPlaceHolders(value: ReadableMap) {
50
+ // val cardFormView = StripeCardFormViewBinding.bind(cardForm)
51
+ //
52
+ // val numberPlaceholder = getValOr(value, "number", null)
53
+ // val expirationPlaceholder = getValOr(value, "expiration", null)
54
+ // val cvcPlaceholder = getValOr(value, "cvc", null)
55
+ // val postalCodePlaceholder = getValOr(value, "postalCode", null)
56
+ //
57
+ // numberPlaceholder?.let {
58
+ //// multilineWidgetBinding.tlCardNumber.hint = it
59
+ // }
60
+ // expirationPlaceholder?.let {
61
+ // multilineWidgetBinding.tlExpiry.hint = it
62
+ // }
63
+ // cvcPlaceholder?.let {
64
+ // multilineWidgetBinding.tlCvc.hint = it
65
+ // }
66
+ // postalCodePlaceholder?.let {
67
+ // cardFormView.postalCodeContainer.hint = it
68
+ // }
69
+ // }
70
70
 
71
71
  fun setAutofocus(value: Boolean) {
72
72
  if (value) {
@@ -3,7 +3,6 @@ package com.reactnativestripesdk
3
3
  import com.facebook.react.bridge.ReadableArray
4
4
  import com.facebook.react.bridge.ReadableMap
5
5
  import com.facebook.react.common.MapBuilder
6
- import com.facebook.react.uimanager.ReactStylesDiffMap
7
6
  import com.facebook.react.uimanager.SimpleViewManager
8
7
  import com.facebook.react.uimanager.ThemedReactContext
9
8
  import com.facebook.react.uimanager.annotations.ReactProp
@@ -28,28 +27,32 @@ class CardFormViewManager : SimpleViewManager<CardFormView>() {
28
27
  }
29
28
 
30
29
  @ReactProp(name = "dangerouslyGetFullCardDetails")
30
+ @SuppressWarnings("unused")
31
31
  fun setDangerouslyGetFullCardDetails(view: CardFormView, dangerouslyGetFullCardDetails: Boolean = false) {
32
- view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails);
32
+ view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails)
33
33
  }
34
34
 
35
35
  @ReactProp(name = "postalCodeEnabled")
36
+ @SuppressWarnings("unused")
36
37
  fun setPostalCodeEnabled(view: CardFormView, postalCodeEnabled: Boolean = false) {
37
- view.setPostalCodeEnabled(postalCodeEnabled);
38
+ view.setPostalCodeEnabled(postalCodeEnabled)
38
39
  }
39
40
 
40
41
  // @ReactProp(name = "placeholder")
41
42
  // fun setPlaceHolders(view: CardFormView, placeholder: ReadableMap) {
42
- // view.setPlaceHolders(placeholder);
43
+ // view.setPlaceHolders(placeholder)
43
44
  // }
44
45
 
45
46
  @ReactProp(name = "autofocus")
47
+ @SuppressWarnings("unused")
46
48
  fun setAutofocus(view: CardFormView, autofocus: Boolean = false) {
47
- view.setAutofocus(autofocus);
49
+ view.setAutofocus(autofocus)
48
50
  }
49
51
 
50
52
  @ReactProp(name = "cardStyle")
53
+ @SuppressWarnings("unused")
51
54
  fun setCardStyle(view: CardFormView, cardStyle: ReadableMap) {
52
- view.setCardStyle(cardStyle);
55
+ view.setCardStyle(cardStyle)
53
56
  }
54
57
 
55
58
  override fun createViewInstance(reactContext: ThemedReactContext): CardFormView {
@@ -3,9 +3,9 @@ package com.reactnativestripesdk
3
3
  import com.facebook.react.bridge.WritableMap
4
4
  import com.facebook.react.bridge.WritableNativeMap
5
5
  import com.stripe.android.core.exception.APIException
6
+ import com.stripe.android.core.exception.InvalidRequestException
6
7
  import com.stripe.android.exception.AuthenticationException
7
8
  import com.stripe.android.exception.CardException
8
- import com.stripe.android.core.exception.InvalidRequestException
9
9
  import com.stripe.android.model.PaymentIntent
10
10
  import com.stripe.android.model.SetupIntent
11
11
 
@@ -22,7 +22,7 @@ enum class NextPaymentActionErrorType {
22
22
  }
23
23
 
24
24
  enum class ConfirmSetupIntentErrorType {
25
- Failed, Canceled, Unknown
25
+ Failed, Canceled
26
26
  }
27
27
 
28
28
  enum class RetrievePaymentIntentErrorType {
@@ -38,7 +38,7 @@ enum class PaymentSheetErrorType {
38
38
  }
39
39
 
40
40
  enum class GooglePayErrorType {
41
- Failed, Canceled, Unknown
41
+ Failed, Canceled
42
42
  }
43
43
 
44
44
  internal fun mapError(code: String, message: String?, localizedMessage: String?, declineCode: String?, type: String?, stripeErrorCode: String?): WritableMap {
@@ -1,6 +1,5 @@
1
1
  package com.reactnativestripesdk
2
2
  import com.facebook.react.bridge.Arguments
3
- import com.facebook.react.bridge.ReadableMap
4
3
  import com.facebook.react.bridge.WritableMap
5
4
  import com.facebook.react.uimanager.events.Event
6
5
  import com.facebook.react.uimanager.events.RCTEventEmitter
@@ -16,6 +16,7 @@ class GooglePayButtonManager : SimpleViewManager<GooglePayButtonView?>() {
16
16
  }
17
17
 
18
18
  @ReactProp(name = "buttonType")
19
+ @SuppressWarnings("unused")
19
20
  fun buttonType(view: GooglePayButtonView, buttonType: String) {
20
21
  view.setType(buttonType)
21
22
  }
@@ -5,7 +5,7 @@ import android.widget.FrameLayout
5
5
  import com.facebook.react.uimanager.ThemedReactContext
6
6
 
7
7
  class GooglePayButtonView(private val context: ThemedReactContext) : FrameLayout(context) {
8
- var buttonType: String? = null
8
+ private var buttonType: String? = null
9
9
 
10
10
  fun initialize() {
11
11
  val type = when (buttonType) {
@@ -18,7 +18,7 @@ class GooglePayPaymentMethodLauncherFragment(
18
18
  private val promise: Promise
19
19
  ) : Fragment() {
20
20
  override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
21
- savedInstanceState: Bundle?): View? {
21
+ savedInstanceState: Bundle?): View {
22
22
  return FrameLayout(requireActivity()).also {
23
23
  it.visibility = View.GONE
24
24
  }
@@ -5,6 +5,8 @@ import android.util.Log
5
5
  import com.facebook.react.bridge.*
6
6
  import com.stripe.android.PaymentAuthConfig
7
7
  import com.stripe.android.model.*
8
+ import com.stripe.android.model.StripeIntent.NextActionType
9
+ import com.stripe.android.model.StripeIntent.NextActionData
8
10
 
9
11
  internal fun createResult(key: String, value: WritableMap): WritableMap {
10
12
  val map = WritableNativeMap()
@@ -199,6 +201,7 @@ internal fun mapFromBankAccount(bankAccount: BankAccount?): WritableMap? {
199
201
  return null
200
202
  }
201
203
 
204
+ bankAccountMap.putString("id", bankAccount.id)
202
205
  bankAccountMap.putString("bankName", bankAccount.bankName)
203
206
  bankAccountMap.putString("accountHolderName", bankAccount.accountHolderName)
204
207
  bankAccountMap.putString("accountHolderType", mapFromBankAccountType(bankAccount.accountHolderType))
@@ -235,6 +238,7 @@ internal fun mapFromCard(card: Card?): WritableMap? {
235
238
  cardMap.putNull("expYear")
236
239
  }
237
240
 
241
+ cardMap.putString("id", card.id)
238
242
  cardMap.putString("last4", card.last4)
239
243
  cardMap.putString("funding", card.funding?.name)
240
244
  cardMap.putString("name", card.name)
@@ -342,6 +346,7 @@ internal fun mapFromPaymentIntentResult(paymentIntent: PaymentIntent): WritableM
342
346
  map.putString("created", convertToUnixTimestamp(paymentIntent.created))
343
347
  map.putString("captureMethod", mapCaptureMethod(paymentIntent.captureMethod))
344
348
  map.putString("confirmationMethod", mapConfirmationMethod(paymentIntent.confirmationMethod))
349
+ map.putMap("nextAction", mapNextAction(paymentIntent.nextActionType, paymentIntent.nextActionData))
345
350
  map.putNull("lastPaymentError")
346
351
  map.putNull("shipping")
347
352
  map.putNull("amount")
@@ -368,12 +373,52 @@ internal fun mapFromPaymentIntentResult(paymentIntent: PaymentIntent): WritableM
368
373
  paymentIntent.amount?.let {
369
374
  map.putDouble("amount", it.toDouble())
370
375
  }
371
- paymentIntent.canceledAt?.let {
372
- map.putString("canceledAt", convertToUnixTimestamp(it))
373
- }
376
+ map.putString("canceledAt", convertToUnixTimestamp(paymentIntent.canceledAt))
374
377
  return map
375
378
  }
376
379
 
380
+ internal fun mapNextAction(type: NextActionType?, data: NextActionData?): WritableNativeMap? {
381
+ val nextActionMap = WritableNativeMap()
382
+ when (type) {
383
+ NextActionType.RedirectToUrl -> {
384
+ (data as? NextActionData.RedirectToUrl)?.let {
385
+ nextActionMap.putString("type", "urlRedirect")
386
+ nextActionMap.putString("redirectUrl", it.url.toString())
387
+ }
388
+ }
389
+ // TODO: This is currently private. Uncomment when ACHv2 is available on Android.
390
+ // NextActionType.VerifyWithMicrodeposits -> {
391
+ // (data as? NextActionData.VerifyWithMicrodeposits)?.let {
392
+ // nextActionMap.putString("type", "verifyWithMicrodeposits")
393
+ // nextActionMap.putString("arrivalDate", it.arrivalDate.toString())
394
+ // nextActionMap.putString("redirectUrl", it.hostedVerificationUrl)
395
+ // nextActionMap.putString("microdepositType", it.microdepositType.toString())
396
+ // }
397
+ // }
398
+ NextActionType.DisplayOxxoDetails -> {
399
+ (data as? NextActionData.DisplayOxxoDetails)?.let {
400
+ nextActionMap.putString("type", "oxxoVoucher")
401
+ nextActionMap.putInt("expiration", it.expiresAfter)
402
+ nextActionMap.putString("voucherURL", it.hostedVoucherUrl)
403
+ nextActionMap.putString("voucherNumber", it.number)
404
+ }
405
+ }
406
+ NextActionType.WeChatPayRedirect -> {
407
+ (data as? NextActionData.WeChatPayRedirect)?.let {
408
+ nextActionMap.putString("type", "weChatRedirect")
409
+ nextActionMap.putString("redirectUrl", it.weChat.qrCodeUrl)
410
+ }
411
+ }
412
+ NextActionType.AlipayRedirect -> { // TODO: Can't access, private
413
+ return null
414
+ }
415
+ NextActionType.BlikAuthorize, NextActionType.UseStripeSdk, null -> {
416
+ return null
417
+ }
418
+ }
419
+ return nextActionMap
420
+ }
421
+
377
422
  internal fun mapFromPaymentIntentLastErrorType(errorType: PaymentIntent.Error.Type?): String? {
378
423
  return when (errorType) {
379
424
  PaymentIntent.Error.Type.ApiConnectionError -> "api_connection_error"
@@ -486,10 +531,6 @@ fun getIntOrNull(map: ReadableMap?, key: String): Int? {
486
531
  return if (map?.hasKey(key) == true) map.getInt(key) else null
487
532
  }
488
533
 
489
- public fun getBooleanOrNull(map: ReadableMap?, key: String): Boolean? {
490
- return if (map?.hasKey(key) == true) map.getBoolean(key) else null
491
- }
492
-
493
534
  fun getMapOrNull(map: ReadableMap?, key: String): ReadableMap? {
494
535
  return if (map?.hasKey(key) == true) map.getMap(key) else null
495
536
  }
@@ -687,10 +728,8 @@ internal fun mapFromSetupIntentResult(setupIntent: SetupIntent): WritableMap {
687
728
  map.putString("clientSecret", setupIntent.clientSecret)
688
729
  map.putString("paymentMethodId", setupIntent.paymentMethodId)
689
730
  map.putString("usage", mapSetupIntentUsage(setupIntent.usage))
690
-
691
- if(setupIntent.created != null) {
692
- map.putString("created", convertToUnixTimestamp(setupIntent.created))
693
- }
731
+ map.putString("created", convertToUnixTimestamp(setupIntent.created))
732
+ map.putMap("nextAction", mapNextAction(setupIntent.nextActionType, setupIntent.nextActionData))
694
733
 
695
734
  setupIntent.lastSetupError?.let {
696
735
  val setupError: WritableMap = WritableNativeMap()
@@ -736,7 +775,7 @@ fun mapToPaymentIntentFutureUsage(type: String?): ConfirmPaymentIntentParams.Set
736
775
  }
737
776
  }
738
777
 
739
- fun toBundleObject(readableMap: ReadableMap?): Bundle? {
778
+ fun toBundleObject(readableMap: ReadableMap?): Bundle {
740
779
  val result = Bundle()
741
780
  if (readableMap == null) {
742
781
  return result
@@ -0,0 +1,122 @@
1
+ package com.reactnativestripesdk
2
+
3
+ import android.os.Bundle
4
+ import android.view.LayoutInflater
5
+ import android.view.View
6
+ import android.view.ViewGroup
7
+ import android.widget.FrameLayout
8
+ import androidx.fragment.app.Fragment
9
+ import com.facebook.react.bridge.Promise
10
+ import com.stripe.android.ApiResultCallback
11
+ import com.stripe.android.Stripe
12
+ import com.stripe.android.model.PaymentIntent
13
+ import com.stripe.android.model.StripeIntent
14
+ import com.stripe.android.payments.paymentlauncher.PaymentLauncher
15
+ import com.stripe.android.payments.paymentlauncher.PaymentResult
16
+
17
+ class PaymentLauncherFragment(
18
+ private val stripe: Stripe,
19
+ private val publishableKey: String,
20
+ private val stripeAccountId: String?,
21
+ ) : Fragment() {
22
+ lateinit var paymentLauncher: PaymentLauncher
23
+
24
+ var clientSecret: String? = null
25
+ var promise: Promise? = null
26
+
27
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
28
+ savedInstanceState: Bundle?): View {
29
+ paymentLauncher = createPaymentLauncher()
30
+ return FrameLayout(requireActivity()).also {
31
+ it.visibility = View.GONE
32
+ }
33
+ }
34
+
35
+ private fun createPaymentLauncher(): PaymentLauncher {
36
+ return PaymentLauncher.create(this, publishableKey, stripeAccountId) { paymentResult ->
37
+ when (paymentResult) {
38
+ is PaymentResult.Completed -> {
39
+ clientSecret?.let {
40
+ retrievePaymentIntent(it, stripeAccountId)
41
+ } ?: run {
42
+ throw Exception("Client secret must be set before responding to payment results.")
43
+ }
44
+ }
45
+ is PaymentResult.Canceled -> {
46
+ promise?.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), message = null))
47
+ ?: throw Exception("No promise is set to handle payment results.")
48
+ }
49
+ is PaymentResult.Failed -> {
50
+ promise?.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), paymentResult.throwable.localizedMessage))
51
+ ?: throw Exception("No promise is set to handle payment results.")
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ private fun retrievePaymentIntent(clientSecret: String, stripeAccountId: String?) {
58
+ val promise = promise ?: throw Exception("No promise is set to handle payment results.")
59
+ stripe.retrievePaymentIntent(clientSecret, stripeAccountId, object : ApiResultCallback<PaymentIntent> {
60
+ override fun onError(e: Exception) {
61
+ promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), e))
62
+ }
63
+
64
+ override fun onSuccess(result: PaymentIntent) {
65
+ when (result.status) {
66
+ StripeIntent.Status.Succeeded,
67
+ StripeIntent.Status.Processing,
68
+ StripeIntent.Status.RequiresCapture -> {
69
+ val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
70
+ promise.resolve(paymentIntent)
71
+ }
72
+ StripeIntent.Status.RequiresAction -> {
73
+ if (isNextActionSuccessState(result.nextActionType)) {
74
+ val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
75
+ promise.resolve(paymentIntent)
76
+ } else {
77
+ (result.lastPaymentError)?.let {
78
+ promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), it))
79
+ } ?: run {
80
+ promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), "The payment has been canceled"))
81
+ }
82
+ }
83
+ }
84
+ StripeIntent.Status.RequiresPaymentMethod -> {
85
+ val error = result.lastPaymentError
86
+ promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), error))
87
+ }
88
+ StripeIntent.Status.RequiresConfirmation -> {
89
+ val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
90
+ promise.resolve(paymentIntent)
91
+ }
92
+ StripeIntent.Status.Canceled -> {
93
+ val error = result.lastPaymentError
94
+ promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), error))
95
+ }
96
+ else -> {
97
+ val errorMessage = "unhandled error: ${result.status}"
98
+ promise.resolve(createError(ConfirmPaymentErrorType.Unknown.toString(), errorMessage))
99
+ }
100
+ }
101
+ }
102
+ })
103
+ }
104
+
105
+ /**
106
+ * Check if paymentIntent.nextAction is out-of-band, such as voucher-based or waiting
107
+ * on customer verification. If it is, then being in this state is considered "successful".
108
+ */
109
+ private fun isNextActionSuccessState(nextAction: StripeIntent.NextActionType?): Boolean {
110
+ return when (nextAction) {
111
+ StripeIntent.NextActionType.DisplayOxxoDetails,
112
+ StripeIntent.NextActionType.VerifyWithMicrodeposits -> true
113
+ StripeIntent.NextActionType.RedirectToUrl,
114
+ StripeIntent.NextActionType.UseStripeSdk,
115
+ StripeIntent.NextActionType.AlipayRedirect,
116
+ StripeIntent.NextActionType.BlikAuthorize,
117
+ StripeIntent.NextActionType.WeChatPayRedirect,
118
+ null -> false
119
+ }
120
+ }
121
+ }
122
+