react-native-tpay 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +555 -0
  3. package/android/build.gradle +95 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/tpay/TpayAmbiguousBLIKPaymentHandler.kt +21 -0
  8. package/android/src/main/java/com/tpay/TpayModule.kt +528 -0
  9. package/android/src/main/java/com/tpay/TpayPackage.kt +17 -0
  10. package/android/src/main/java/com/tpay/TpayResult.kt +12 -0
  11. package/android/src/main/java/com/tpay/TpayScreenlessPaymentHandler.kt +102 -0
  12. package/android/src/main/java/com/tpay/TpayScreenlessResult.kt +25 -0
  13. package/android/src/main/java/com/tpay/TpayScreenlessResultHandler.kt +121 -0
  14. package/android/src/main/java/com/tpay/delegate/AddCardDelegateImpl.kt +30 -0
  15. package/android/src/main/java/com/tpay/delegate/PaymentDelegateImpl.kt +33 -0
  16. package/android/src/main/java/com/tpay/extension/AmbiguousAlias+.kt +11 -0
  17. package/android/src/main/java/com/tpay/extension/BlikAlias+.kt +18 -0
  18. package/android/src/main/java/com/tpay/extension/CardTokenTransaction+.kt +19 -0
  19. package/android/src/main/java/com/tpay/extension/Exception.kt +3 -0
  20. package/android/src/main/java/com/tpay/extension/JSONObject+.kt +10 -0
  21. package/android/src/main/java/com/tpay/extension/PaymentChannel+.kt +22 -0
  22. package/android/src/main/java/com/tpay/extension/PaymentConstraint+.kt +24 -0
  23. package/android/src/main/java/com/tpay/extension/PaymentGroup+.kt +21 -0
  24. package/android/src/main/java/com/tpay/extension/SingleTransaction+.kt +14 -0
  25. package/android/src/main/java/com/tpay/extension/String+.kt +30 -0
  26. package/android/src/main/java/com/tpay/model/CertificateConfiguration.kt +20 -0
  27. package/android/src/main/java/com/tpay/model/Configuration.kt +5 -0
  28. package/android/src/main/java/com/tpay/model/ConfigurationMerchant.kt +33 -0
  29. package/android/src/main/java/com/tpay/model/Languages.kt +24 -0
  30. package/android/src/main/java/com/tpay/model/LocalizedString.kt +21 -0
  31. package/android/src/main/java/com/tpay/model/MerchantAuthorization.kt +20 -0
  32. package/android/src/main/java/com/tpay/model/MerchantDetails.kt +32 -0
  33. package/android/src/main/java/com/tpay/model/PaymentMethods.kt +90 -0
  34. package/android/src/main/java/com/tpay/model/TpayConfiguration.kt +50 -0
  35. package/android/src/main/java/com/tpay/model/WalletConfiguration.kt +14 -0
  36. package/android/src/main/java/com/tpay/model/googlePay/GooglePayConfiguration.kt +13 -0
  37. package/android/src/main/java/com/tpay/model/googlePay/GooglePayConfigureResult.kt +6 -0
  38. package/android/src/main/java/com/tpay/model/googlePay/GooglePayUtilsConfiguration.kt +57 -0
  39. package/android/src/main/java/com/tpay/model/screenless/AmbiguousBLIKAlias.kt +35 -0
  40. package/android/src/main/java/com/tpay/model/screenless/AmbiguousBLIKPayment.kt +26 -0
  41. package/android/src/main/java/com/tpay/model/screenless/BLIKScreenlessPayment.kt +28 -0
  42. package/android/src/main/java/com/tpay/model/screenless/CreditCardData.kt +10 -0
  43. package/android/src/main/java/com/tpay/model/screenless/CreditCardScreenlessPayment.kt +75 -0
  44. package/android/src/main/java/com/tpay/model/screenless/ExpirationDate.kt +22 -0
  45. package/android/src/main/java/com/tpay/model/screenless/GooglePayScreenlessPayment.kt +19 -0
  46. package/android/src/main/java/com/tpay/model/screenless/PaymentConstraintType.kt +5 -0
  47. package/android/src/main/java/com/tpay/model/screenless/RatyPekaoScreenlessPayment.kt +9 -0
  48. package/android/src/main/java/com/tpay/model/screenless/ScreenlessPayment.kt +87 -0
  49. package/android/src/main/java/com/tpay/model/screenless/TransferScreenlessPayment.kt +9 -0
  50. package/android/src/main/java/com/tpay/util/JsonUtil.kt +178 -0
  51. package/android/src/main/java/com/tpay/util/TpayBackpressUtil.kt +23 -0
  52. package/android/src/main/java/com/tpay/util/TpayUtil.kt +67 -0
  53. package/android/src/main/java/com/tpay/util/ValidationMessages.kt +19 -0
  54. package/ios/Source/Configuration/MerchantConfiguration.swift +120 -0
  55. package/ios/Source/Configuration/PaymentMethodConfiguration.swift +41 -0
  56. package/ios/Source/Configuration/TransactionConfiguration.swift +200 -0
  57. package/ios/Source/Extension/TPay+Setup.swift +32 -0
  58. package/ios/Source/Model/Domain/BankPayment.swift +12 -0
  59. package/ios/Source/Model/Domain/BlikPayment.swift +14 -0
  60. package/ios/Source/Model/Domain/CardPayment.swift +14 -0
  61. package/ios/Source/Model/Domain/ConfigurationResult.swift +98 -0
  62. package/ios/Source/Model/Domain/ContinuePayment.swift +10 -0
  63. package/ios/Source/Model/Domain/DigitalWalletPayment.swift +13 -0
  64. package/ios/Source/Model/Domain/PaymentChannelResult.swift +44 -0
  65. package/ios/Source/Model/Domain/ScreenlessResult.swift +67 -0
  66. package/ios/Source/Model/Domain/TokenisationData.swift +16 -0
  67. package/ios/Source/Model/Transportation/Transportation+AmbiguousAlias.swift +10 -0
  68. package/ios/Source/Model/Transportation/Transportation+Bank.swift +11 -0
  69. package/ios/Source/Model/Transportation/Transportation+BankPayment.swift +13 -0
  70. package/ios/Source/Model/Transportation/Transportation+BlikPayment+Alias.swift +9 -0
  71. package/ios/Source/Model/Transportation/Transportation+BlikPayment.swift +13 -0
  72. package/ios/Source/Model/Transportation/Transportation+Callbacks+Notifications.swift +10 -0
  73. package/ios/Source/Model/Transportation/Transportation+Callbacks+Redirects.swift +10 -0
  74. package/ios/Source/Model/Transportation/Transportation+Callbacks.swift +10 -0
  75. package/ios/Source/Model/Transportation/Transportation+CardDetails+Configuration.swift +9 -0
  76. package/ios/Source/Model/Transportation/Transportation+CardDetails+ExpiryDate.swift +10 -0
  77. package/ios/Source/Model/Transportation/Transportation+CardDetails.swift +12 -0
  78. package/ios/Source/Model/Transportation/Transportation+CardPayment.swift +13 -0
  79. package/ios/Source/Model/Transportation/Transportation+CardToken.swift +11 -0
  80. package/ios/Source/Model/Transportation/Transportation+ContinuePayment.swift +11 -0
  81. package/ios/Source/Model/Transportation/Transportation+DigitalWalletPayment.swift +12 -0
  82. package/ios/Source/Model/Transportation/Transportation+Environment.swift +23 -0
  83. package/ios/Source/Model/Transportation/Transportation+Languages.swift +10 -0
  84. package/ios/Source/Model/Transportation/Transportation+Merchant+Authorization.swift +10 -0
  85. package/ios/Source/Model/Transportation/Transportation+Merchant+CertificatePinning.swift +9 -0
  86. package/ios/Source/Model/Transportation/Transportation+Merchant+WalletConfiguration+ApplePay.swift +10 -0
  87. package/ios/Source/Model/Transportation/Transportation+Merchant+WalletConfiguration.swift +9 -0
  88. package/ios/Source/Model/Transportation/Transportation+Merchant.swift +13 -0
  89. package/ios/Source/Model/Transportation/Transportation+MerchantConfiguration.swift +12 -0
  90. package/ios/Source/Model/Transportation/Transportation+MerchantDetails+Detail.swift +10 -0
  91. package/ios/Source/Model/Transportation/Transportation+MerchantDetails.swift +11 -0
  92. package/ios/Source/Model/Transportation/Transportation+Payer+Address.swift +12 -0
  93. package/ios/Source/Model/Transportation/Transportation+Payer.swift +12 -0
  94. package/ios/Source/Model/Transportation/Transportation+PayerContext+AutomaticPaymentMethods+BlikAlias.swift +9 -0
  95. package/ios/Source/Model/Transportation/Transportation+PayerContext+AutomaticPaymentMethods.swift +10 -0
  96. package/ios/Source/Model/Transportation/Transportation+PayerContext.swift +10 -0
  97. package/ios/Source/Model/Transportation/Transportation+PaymentChannel.swift +21 -0
  98. package/ios/Source/Model/Transportation/Transportation+PaymentDetails.swift +10 -0
  99. package/ios/Source/Model/Transportation/Transportation+PaymentMethod.swift +47 -0
  100. package/ios/Source/Model/Transportation/Transportation+PaymentMethods.swift +11 -0
  101. package/ios/Source/Model/Transportation/Transportation+PaymentMethodsInfo.swift +12 -0
  102. package/ios/Source/Model/Transportation/Transportation+SingleTransaction.swift +11 -0
  103. package/ios/Source/Model/Transportation/Transportation+TokenPayment.swift +12 -0
  104. package/ios/Source/Model/Transportation/Transportation+Tokenisation.swift +12 -0
  105. package/ios/Source/Model/Transportation/Transportation.swift +3 -0
  106. package/ios/Source/Presentation/AddCardPresentation.swift +43 -0
  107. package/ios/Source/Presentation/CardTokenPresentation.swift +48 -0
  108. package/ios/Source/Presentation/PaymentPresentation.swift +48 -0
  109. package/ios/Source/Provider/DefaultMerchantDetailsProvider.swift +32 -0
  110. package/ios/Source/Provider/DefaultSSLCertificatesProvider.swift +14 -0
  111. package/ios/Source/TpaySDK.mm +35 -0
  112. package/ios/Source/TpaySDK.swift +324 -0
  113. package/ios/Tpay-Bridging-Header.h +2 -0
  114. package/lib/commonjs/assets/tpay_logo.png +0 -0
  115. package/lib/commonjs/assets/tpay_logo@2x.png +0 -0
  116. package/lib/commonjs/assets/tpay_logo@3x.png +0 -0
  117. package/lib/commonjs/component/tpay_button.js +38 -0
  118. package/lib/commonjs/component/tpay_button.js.map +1 -0
  119. package/lib/commonjs/index.js +856 -0
  120. package/lib/commonjs/index.js.map +1 -0
  121. package/lib/commonjs/model/language/language.js +12 -0
  122. package/lib/commonjs/model/language/language.js.map +1 -0
  123. package/lib/commonjs/model/language/languages.js +21 -0
  124. package/lib/commonjs/model/language/languages.js.map +1 -0
  125. package/lib/commonjs/model/language/localized_string.js +17 -0
  126. package/lib/commonjs/model/language/localized_string.js.map +1 -0
  127. package/lib/commonjs/model/merchant/apple_pay_configuration.js +22 -0
  128. package/lib/commonjs/model/merchant/apple_pay_configuration.js.map +1 -0
  129. package/lib/commonjs/model/merchant/certificate_configuration.js +20 -0
  130. package/lib/commonjs/model/merchant/certificate_configuration.js.map +1 -0
  131. package/lib/commonjs/model/merchant/google_pay_configuration.js +19 -0
  132. package/lib/commonjs/model/merchant/google_pay_configuration.js.map +1 -0
  133. package/lib/commonjs/model/merchant/merchant.js +27 -0
  134. package/lib/commonjs/model/merchant/merchant.js.map +1 -0
  135. package/lib/commonjs/model/merchant/merchant_authorization.js +21 -0
  136. package/lib/commonjs/model/merchant/merchant_authorization.js.map +1 -0
  137. package/lib/commonjs/model/merchant/merchant_details.js +23 -0
  138. package/lib/commonjs/model/merchant/merchant_details.js.map +1 -0
  139. package/lib/commonjs/model/merchant/tpay_environment.js +12 -0
  140. package/lib/commonjs/model/merchant/tpay_environment.js.map +1 -0
  141. package/lib/commonjs/model/merchant/wallet_configuration.js +21 -0
  142. package/lib/commonjs/model/merchant/wallet_configuration.js.map +1 -0
  143. package/lib/commonjs/model/payer/address.js +25 -0
  144. package/lib/commonjs/model/payer/address.js.map +1 -0
  145. package/lib/commonjs/model/payer/payer.js +25 -0
  146. package/lib/commonjs/model/payer/payer.js.map +1 -0
  147. package/lib/commonjs/model/payer/payer_context.js +21 -0
  148. package/lib/commonjs/model/payer/payer_context.js.map +1 -0
  149. package/lib/commonjs/model/payment_channel/payment_channel.js +35 -0
  150. package/lib/commonjs/model/payment_channel/payment_channel.js.map +1 -0
  151. package/lib/commonjs/model/payment_channel/payment_constraint.js +47 -0
  152. package/lib/commonjs/model/payment_channel/payment_constraint.js.map +1 -0
  153. package/lib/commonjs/model/payment_channel/payment_group.js +30 -0
  154. package/lib/commonjs/model/payment_channel/payment_group.js.map +1 -0
  155. package/lib/commonjs/model/payment_method/automatic_payment_methods.js +21 -0
  156. package/lib/commonjs/model/payment_method/automatic_payment_methods.js.map +1 -0
  157. package/lib/commonjs/model/payment_method/blik_alias.js +23 -0
  158. package/lib/commonjs/model/payment_method/blik_alias.js.map +1 -0
  159. package/lib/commonjs/model/payment_method/credit_card_brand.js +16 -0
  160. package/lib/commonjs/model/payment_method/credit_card_brand.js.map +1 -0
  161. package/lib/commonjs/model/payment_method/digital_wallet.js +15 -0
  162. package/lib/commonjs/model/payment_method/digital_wallet.js.map +1 -0
  163. package/lib/commonjs/model/payment_method/installment_payment.js +14 -0
  164. package/lib/commonjs/model/payment_method/installment_payment.js.map +1 -0
  165. package/lib/commonjs/model/payment_method/payment_method.js +16 -0
  166. package/lib/commonjs/model/payment_method/payment_method.js.map +1 -0
  167. package/lib/commonjs/model/payment_method/payment_methods.js +23 -0
  168. package/lib/commonjs/model/payment_method/payment_methods.js.map +1 -0
  169. package/lib/commonjs/model/payment_method/tokenized_card.js +23 -0
  170. package/lib/commonjs/model/payment_method/tokenized_card.js.map +1 -0
  171. package/lib/commonjs/model/result/google_pay_configure_result.js +33 -0
  172. package/lib/commonjs/model/result/google_pay_configure_result.js.map +1 -0
  173. package/lib/commonjs/model/result/google_pay_open_result.js +61 -0
  174. package/lib/commonjs/model/result/google_pay_open_result.js.map +1 -0
  175. package/lib/commonjs/model/result/payment_channels_result.js +42 -0
  176. package/lib/commonjs/model/result/payment_channels_result.js.map +1 -0
  177. package/lib/commonjs/model/result/result.js +96 -0
  178. package/lib/commonjs/model/result/result.js.map +1 -0
  179. package/lib/commonjs/model/result/screenless_result.js +141 -0
  180. package/lib/commonjs/model/result/screenless_result.js.map +1 -0
  181. package/lib/commonjs/model/screenless/ambiguous_alias.js +25 -0
  182. package/lib/commonjs/model/screenless/ambiguous_alias.js.map +1 -0
  183. package/lib/commonjs/model/screenless/ambiguous_blik_payment.js +23 -0
  184. package/lib/commonjs/model/screenless/ambiguous_blik_payment.js.map +1 -0
  185. package/lib/commonjs/model/screenless/apple_pay_payment.js +21 -0
  186. package/lib/commonjs/model/screenless/apple_pay_payment.js.map +1 -0
  187. package/lib/commonjs/model/screenless/blik_payment.js +26 -0
  188. package/lib/commonjs/model/screenless/blik_payment.js.map +1 -0
  189. package/lib/commonjs/model/screenless/callbacks.js +21 -0
  190. package/lib/commonjs/model/screenless/callbacks.js.map +1 -0
  191. package/lib/commonjs/model/screenless/credit_card.js +25 -0
  192. package/lib/commonjs/model/screenless/credit_card.js.map +1 -0
  193. package/lib/commonjs/model/screenless/credit_card_config.js +22 -0
  194. package/lib/commonjs/model/screenless/credit_card_config.js.map +1 -0
  195. package/lib/commonjs/model/screenless/credit_card_payment.js +26 -0
  196. package/lib/commonjs/model/screenless/credit_card_payment.js.map +1 -0
  197. package/lib/commonjs/model/screenless/expiration_date.js +21 -0
  198. package/lib/commonjs/model/screenless/expiration_date.js.map +1 -0
  199. package/lib/commonjs/model/screenless/frequency.js +18 -0
  200. package/lib/commonjs/model/screenless/frequency.js.map +1 -0
  201. package/lib/commonjs/model/screenless/google_pay_environment.js +15 -0
  202. package/lib/commonjs/model/screenless/google_pay_environment.js.map +1 -0
  203. package/lib/commonjs/model/screenless/google_pay_payment.js +21 -0
  204. package/lib/commonjs/model/screenless/google_pay_payment.js.map +1 -0
  205. package/lib/commonjs/model/screenless/google_pay_utils_configuration.js +27 -0
  206. package/lib/commonjs/model/screenless/google_pay_utils_configuration.js.map +1 -0
  207. package/lib/commonjs/model/screenless/notifications.js +21 -0
  208. package/lib/commonjs/model/screenless/notifications.js.map +1 -0
  209. package/lib/commonjs/model/screenless/payment_details.js +25 -0
  210. package/lib/commonjs/model/screenless/payment_details.js.map +1 -0
  211. package/lib/commonjs/model/screenless/raty_pekao_payment.js +21 -0
  212. package/lib/commonjs/model/screenless/raty_pekao_payment.js.map +1 -0
  213. package/lib/commonjs/model/screenless/recursive.js +23 -0
  214. package/lib/commonjs/model/screenless/recursive.js.map +1 -0
  215. package/lib/commonjs/model/screenless/redirects.js +21 -0
  216. package/lib/commonjs/model/screenless/redirects.js.map +1 -0
  217. package/lib/commonjs/model/screenless/screenless_payment.js +23 -0
  218. package/lib/commonjs/model/screenless/screenless_payment.js.map +1 -0
  219. package/lib/commonjs/model/screenless/transfer_payment.js +21 -0
  220. package/lib/commonjs/model/screenless/transfer_payment.js.map +1 -0
  221. package/lib/commonjs/model/tokenization/tokenization.js +21 -0
  222. package/lib/commonjs/model/tokenization/tokenization.js.map +1 -0
  223. package/lib/commonjs/model/tpay_configuration.js +25 -0
  224. package/lib/commonjs/model/tpay_configuration.js.map +1 -0
  225. package/lib/commonjs/model/transaction/single_transaction.js +24 -0
  226. package/lib/commonjs/model/transaction/single_transaction.js.map +1 -0
  227. package/lib/commonjs/model/transaction/token_payment.js +26 -0
  228. package/lib/commonjs/model/transaction/token_payment.js.map +1 -0
  229. package/lib/commonjs/model/transaction/transaction.js +23 -0
  230. package/lib/commonjs/model/transaction/transaction.js.map +1 -0
  231. package/lib/commonjs/util/google_pay_configuration_util.js +22 -0
  232. package/lib/commonjs/util/google_pay_configuration_util.js.map +1 -0
  233. package/lib/commonjs/util/google_pay_open_util.js +24 -0
  234. package/lib/commonjs/util/google_pay_open_util.js.map +1 -0
  235. package/lib/commonjs/util/payment_channels_util.js +22 -0
  236. package/lib/commonjs/util/payment_channels_util.js.map +1 -0
  237. package/lib/commonjs/util/result_util.js +40 -0
  238. package/lib/commonjs/util/result_util.js.map +1 -0
  239. package/lib/commonjs/util/screenless_result_util.js +38 -0
  240. package/lib/commonjs/util/screenless_result_util.js.map +1 -0
  241. package/lib/module/assets/tpay_logo.png +0 -0
  242. package/lib/module/assets/tpay_logo@2x.png +0 -0
  243. package/lib/module/assets/tpay_logo@3x.png +0 -0
  244. package/lib/module/component/tpay_button.js +31 -0
  245. package/lib/module/component/tpay_button.js.map +1 -0
  246. package/lib/module/index.js +204 -0
  247. package/lib/module/index.js.map +1 -0
  248. package/lib/module/model/language/language.js +6 -0
  249. package/lib/module/model/language/language.js.map +1 -0
  250. package/lib/module/model/language/languages.js +14 -0
  251. package/lib/module/model/language/languages.js.map +1 -0
  252. package/lib/module/model/language/localized_string.js +10 -0
  253. package/lib/module/model/language/localized_string.js.map +1 -0
  254. package/lib/module/model/merchant/apple_pay_configuration.js +15 -0
  255. package/lib/module/model/merchant/apple_pay_configuration.js.map +1 -0
  256. package/lib/module/model/merchant/certificate_configuration.js +13 -0
  257. package/lib/module/model/merchant/certificate_configuration.js.map +1 -0
  258. package/lib/module/model/merchant/google_pay_configuration.js +12 -0
  259. package/lib/module/model/merchant/google_pay_configuration.js.map +1 -0
  260. package/lib/module/model/merchant/merchant.js +20 -0
  261. package/lib/module/model/merchant/merchant.js.map +1 -0
  262. package/lib/module/model/merchant/merchant_authorization.js +14 -0
  263. package/lib/module/model/merchant/merchant_authorization.js.map +1 -0
  264. package/lib/module/model/merchant/merchant_details.js +16 -0
  265. package/lib/module/model/merchant/merchant_details.js.map +1 -0
  266. package/lib/module/model/merchant/tpay_environment.js +6 -0
  267. package/lib/module/model/merchant/tpay_environment.js.map +1 -0
  268. package/lib/module/model/merchant/wallet_configuration.js +14 -0
  269. package/lib/module/model/merchant/wallet_configuration.js.map +1 -0
  270. package/lib/module/model/payer/address.js +18 -0
  271. package/lib/module/model/payer/address.js.map +1 -0
  272. package/lib/module/model/payer/payer.js +18 -0
  273. package/lib/module/model/payer/payer.js.map +1 -0
  274. package/lib/module/model/payer/payer_context.js +14 -0
  275. package/lib/module/model/payer/payer_context.js.map +1 -0
  276. package/lib/module/model/payment_channel/payment_channel.js +28 -0
  277. package/lib/module/model/payment_channel/payment_channel.js.map +1 -0
  278. package/lib/module/model/payment_channel/payment_constraint.js +40 -0
  279. package/lib/module/model/payment_channel/payment_constraint.js.map +1 -0
  280. package/lib/module/model/payment_channel/payment_group.js +23 -0
  281. package/lib/module/model/payment_channel/payment_group.js.map +1 -0
  282. package/lib/module/model/payment_method/automatic_payment_methods.js +14 -0
  283. package/lib/module/model/payment_method/automatic_payment_methods.js.map +1 -0
  284. package/lib/module/model/payment_method/blik_alias.js +16 -0
  285. package/lib/module/model/payment_method/blik_alias.js.map +1 -0
  286. package/lib/module/model/payment_method/credit_card_brand.js +10 -0
  287. package/lib/module/model/payment_method/credit_card_brand.js.map +1 -0
  288. package/lib/module/model/payment_method/digital_wallet.js +9 -0
  289. package/lib/module/model/payment_method/digital_wallet.js.map +1 -0
  290. package/lib/module/model/payment_method/installment_payment.js +8 -0
  291. package/lib/module/model/payment_method/installment_payment.js.map +1 -0
  292. package/lib/module/model/payment_method/payment_method.js +10 -0
  293. package/lib/module/model/payment_method/payment_method.js.map +1 -0
  294. package/lib/module/model/payment_method/payment_methods.js +16 -0
  295. package/lib/module/model/payment_method/payment_methods.js.map +1 -0
  296. package/lib/module/model/payment_method/tokenized_card.js +16 -0
  297. package/lib/module/model/payment_method/tokenized_card.js.map +1 -0
  298. package/lib/module/model/result/google_pay_configure_result.js +24 -0
  299. package/lib/module/model/result/google_pay_configure_result.js.map +1 -0
  300. package/lib/module/model/result/google_pay_open_result.js +50 -0
  301. package/lib/module/model/result/google_pay_open_result.js.map +1 -0
  302. package/lib/module/model/result/payment_channels_result.js +33 -0
  303. package/lib/module/model/result/payment_channels_result.js.map +1 -0
  304. package/lib/module/model/result/result.js +81 -0
  305. package/lib/module/model/result/result.js.map +1 -0
  306. package/lib/module/model/result/screenless_result.js +127 -0
  307. package/lib/module/model/result/screenless_result.js.map +1 -0
  308. package/lib/module/model/screenless/ambiguous_alias.js +18 -0
  309. package/lib/module/model/screenless/ambiguous_alias.js.map +1 -0
  310. package/lib/module/model/screenless/ambiguous_blik_payment.js +16 -0
  311. package/lib/module/model/screenless/ambiguous_blik_payment.js.map +1 -0
  312. package/lib/module/model/screenless/apple_pay_payment.js +15 -0
  313. package/lib/module/model/screenless/apple_pay_payment.js.map +1 -0
  314. package/lib/module/model/screenless/blik_payment.js +20 -0
  315. package/lib/module/model/screenless/blik_payment.js.map +1 -0
  316. package/lib/module/model/screenless/callbacks.js +14 -0
  317. package/lib/module/model/screenless/callbacks.js.map +1 -0
  318. package/lib/module/model/screenless/credit_card.js +18 -0
  319. package/lib/module/model/screenless/credit_card.js.map +1 -0
  320. package/lib/module/model/screenless/credit_card_config.js +15 -0
  321. package/lib/module/model/screenless/credit_card_config.js.map +1 -0
  322. package/lib/module/model/screenless/credit_card_payment.js +20 -0
  323. package/lib/module/model/screenless/credit_card_payment.js.map +1 -0
  324. package/lib/module/model/screenless/expiration_date.js +14 -0
  325. package/lib/module/model/screenless/expiration_date.js.map +1 -0
  326. package/lib/module/model/screenless/frequency.js +12 -0
  327. package/lib/module/model/screenless/frequency.js.map +1 -0
  328. package/lib/module/model/screenless/google_pay_environment.js +9 -0
  329. package/lib/module/model/screenless/google_pay_environment.js.map +1 -0
  330. package/lib/module/model/screenless/google_pay_payment.js +15 -0
  331. package/lib/module/model/screenless/google_pay_payment.js.map +1 -0
  332. package/lib/module/model/screenless/google_pay_utils_configuration.js +20 -0
  333. package/lib/module/model/screenless/google_pay_utils_configuration.js.map +1 -0
  334. package/lib/module/model/screenless/notifications.js +14 -0
  335. package/lib/module/model/screenless/notifications.js.map +1 -0
  336. package/lib/module/model/screenless/payment_details.js +18 -0
  337. package/lib/module/model/screenless/payment_details.js.map +1 -0
  338. package/lib/module/model/screenless/raty_pekao_payment.js +15 -0
  339. package/lib/module/model/screenless/raty_pekao_payment.js.map +1 -0
  340. package/lib/module/model/screenless/recursive.js +16 -0
  341. package/lib/module/model/screenless/recursive.js.map +1 -0
  342. package/lib/module/model/screenless/redirects.js +14 -0
  343. package/lib/module/model/screenless/redirects.js.map +1 -0
  344. package/lib/module/model/screenless/screenless_payment.js +16 -0
  345. package/lib/module/model/screenless/screenless_payment.js.map +1 -0
  346. package/lib/module/model/screenless/transfer_payment.js +15 -0
  347. package/lib/module/model/screenless/transfer_payment.js.map +1 -0
  348. package/lib/module/model/tokenization/tokenization.js +14 -0
  349. package/lib/module/model/tokenization/tokenization.js.map +1 -0
  350. package/lib/module/model/tpay_configuration.js +18 -0
  351. package/lib/module/model/tpay_configuration.js.map +1 -0
  352. package/lib/module/model/transaction/single_transaction.js +18 -0
  353. package/lib/module/model/transaction/single_transaction.js.map +1 -0
  354. package/lib/module/model/transaction/token_payment.js +20 -0
  355. package/lib/module/model/transaction/token_payment.js.map +1 -0
  356. package/lib/module/model/transaction/transaction.js +16 -0
  357. package/lib/module/model/transaction/transaction.js.map +1 -0
  358. package/lib/module/util/google_pay_configuration_util.js +16 -0
  359. package/lib/module/util/google_pay_configuration_util.js.map +1 -0
  360. package/lib/module/util/google_pay_open_util.js +18 -0
  361. package/lib/module/util/google_pay_open_util.js.map +1 -0
  362. package/lib/module/util/payment_channels_util.js +16 -0
  363. package/lib/module/util/payment_channels_util.js.map +1 -0
  364. package/lib/module/util/result_util.js +41 -0
  365. package/lib/module/util/result_util.js.map +1 -0
  366. package/lib/module/util/screenless_result_util.js +32 -0
  367. package/lib/module/util/screenless_result_util.js.map +1 -0
  368. package/lib/typescript/src/component/tpay_button.d.ts +13 -0
  369. package/lib/typescript/src/component/tpay_button.d.ts.map +1 -0
  370. package/lib/typescript/src/index.d.ts +147 -0
  371. package/lib/typescript/src/index.d.ts.map +1 -0
  372. package/lib/typescript/src/model/language/language.d.ts +5 -0
  373. package/lib/typescript/src/model/language/language.d.ts.map +1 -0
  374. package/lib/typescript/src/model/language/languages.d.ts +14 -0
  375. package/lib/typescript/src/model/language/languages.d.ts.map +1 -0
  376. package/lib/typescript/src/model/language/localized_string.d.ts +10 -0
  377. package/lib/typescript/src/model/language/localized_string.d.ts.map +1 -0
  378. package/lib/typescript/src/model/merchant/apple_pay_configuration.d.ts +14 -0
  379. package/lib/typescript/src/model/merchant/apple_pay_configuration.d.ts.map +1 -0
  380. package/lib/typescript/src/model/merchant/certificate_configuration.d.ts +12 -0
  381. package/lib/typescript/src/model/merchant/certificate_configuration.d.ts.map +1 -0
  382. package/lib/typescript/src/model/merchant/google_pay_configuration.d.ts +11 -0
  383. package/lib/typescript/src/model/merchant/google_pay_configuration.d.ts.map +1 -0
  384. package/lib/typescript/src/model/merchant/merchant.d.ts +23 -0
  385. package/lib/typescript/src/model/merchant/merchant.d.ts.map +1 -0
  386. package/lib/typescript/src/model/merchant/merchant_authorization.d.ts +13 -0
  387. package/lib/typescript/src/model/merchant/merchant_authorization.d.ts.map +1 -0
  388. package/lib/typescript/src/model/merchant/merchant_details.d.ts +16 -0
  389. package/lib/typescript/src/model/merchant/merchant_details.d.ts.map +1 -0
  390. package/lib/typescript/src/model/merchant/tpay_environment.d.ts +5 -0
  391. package/lib/typescript/src/model/merchant/tpay_environment.d.ts.map +1 -0
  392. package/lib/typescript/src/model/merchant/wallet_configuration.d.ts +15 -0
  393. package/lib/typescript/src/model/merchant/wallet_configuration.d.ts.map +1 -0
  394. package/lib/typescript/src/model/payer/address.d.ts +17 -0
  395. package/lib/typescript/src/model/payer/address.d.ts.map +1 -0
  396. package/lib/typescript/src/model/payer/payer.d.ts +18 -0
  397. package/lib/typescript/src/model/payer/payer.d.ts.map +1 -0
  398. package/lib/typescript/src/model/payer/payer_context.d.ts +15 -0
  399. package/lib/typescript/src/model/payer/payer_context.d.ts.map +1 -0
  400. package/lib/typescript/src/model/payment_channel/payment_channel.d.ts +24 -0
  401. package/lib/typescript/src/model/payment_channel/payment_channel.d.ts.map +1 -0
  402. package/lib/typescript/src/model/payment_channel/payment_constraint.d.ts +31 -0
  403. package/lib/typescript/src/model/payment_channel/payment_constraint.d.ts.map +1 -0
  404. package/lib/typescript/src/model/payment_channel/payment_group.d.ts +19 -0
  405. package/lib/typescript/src/model/payment_channel/payment_group.d.ts.map +1 -0
  406. package/lib/typescript/src/model/payment_method/automatic_payment_methods.d.ts +15 -0
  407. package/lib/typescript/src/model/payment_method/automatic_payment_methods.d.ts.map +1 -0
  408. package/lib/typescript/src/model/payment_method/blik_alias.d.ts +15 -0
  409. package/lib/typescript/src/model/payment_method/blik_alias.d.ts.map +1 -0
  410. package/lib/typescript/src/model/payment_method/credit_card_brand.d.ts +9 -0
  411. package/lib/typescript/src/model/payment_method/credit_card_brand.d.ts.map +1 -0
  412. package/lib/typescript/src/model/payment_method/digital_wallet.d.ts +8 -0
  413. package/lib/typescript/src/model/payment_method/digital_wallet.d.ts.map +1 -0
  414. package/lib/typescript/src/model/payment_method/installment_payment.d.ts +7 -0
  415. package/lib/typescript/src/model/payment_method/installment_payment.d.ts.map +1 -0
  416. package/lib/typescript/src/model/payment_method/payment_method.d.ts +9 -0
  417. package/lib/typescript/src/model/payment_method/payment_method.d.ts.map +1 -0
  418. package/lib/typescript/src/model/payment_method/payment_methods.d.ts +18 -0
  419. package/lib/typescript/src/model/payment_method/payment_methods.d.ts.map +1 -0
  420. package/lib/typescript/src/model/payment_method/tokenized_card.d.ts +16 -0
  421. package/lib/typescript/src/model/payment_method/tokenized_card.d.ts.map +1 -0
  422. package/lib/typescript/src/model/result/google_pay_configure_result.d.ts +21 -0
  423. package/lib/typescript/src/model/result/google_pay_configure_result.d.ts.map +1 -0
  424. package/lib/typescript/src/model/result/google_pay_open_result.d.ts +44 -0
  425. package/lib/typescript/src/model/result/google_pay_open_result.d.ts.map +1 -0
  426. package/lib/typescript/src/model/result/payment_channels_result.d.ts +27 -0
  427. package/lib/typescript/src/model/result/payment_channels_result.d.ts.map +1 -0
  428. package/lib/typescript/src/model/result/result.d.ts +66 -0
  429. package/lib/typescript/src/model/result/result.d.ts.map +1 -0
  430. package/lib/typescript/src/model/result/screenless_result.d.ts +98 -0
  431. package/lib/typescript/src/model/result/screenless_result.d.ts.map +1 -0
  432. package/lib/typescript/src/model/screenless/ambiguous_alias.d.ts +15 -0
  433. package/lib/typescript/src/model/screenless/ambiguous_alias.d.ts.map +1 -0
  434. package/lib/typescript/src/model/screenless/ambiguous_blik_payment.d.ts +17 -0
  435. package/lib/typescript/src/model/screenless/ambiguous_blik_payment.d.ts.map +1 -0
  436. package/lib/typescript/src/model/screenless/apple_pay_payment.d.ts +15 -0
  437. package/lib/typescript/src/model/screenless/apple_pay_payment.d.ts.map +1 -0
  438. package/lib/typescript/src/model/screenless/blik_payment.d.ts +21 -0
  439. package/lib/typescript/src/model/screenless/blik_payment.d.ts.map +1 -0
  440. package/lib/typescript/src/model/screenless/callbacks.d.ts +15 -0
  441. package/lib/typescript/src/model/screenless/callbacks.d.ts.map +1 -0
  442. package/lib/typescript/src/model/screenless/credit_card.d.ts +19 -0
  443. package/lib/typescript/src/model/screenless/credit_card.d.ts.map +1 -0
  444. package/lib/typescript/src/model/screenless/credit_card_config.d.ts +14 -0
  445. package/lib/typescript/src/model/screenless/credit_card_config.d.ts.map +1 -0
  446. package/lib/typescript/src/model/screenless/credit_card_payment.d.ts +21 -0
  447. package/lib/typescript/src/model/screenless/credit_card_payment.d.ts.map +1 -0
  448. package/lib/typescript/src/model/screenless/expiration_date.d.ts +13 -0
  449. package/lib/typescript/src/model/screenless/expiration_date.d.ts.map +1 -0
  450. package/lib/typescript/src/model/screenless/frequency.d.ts +11 -0
  451. package/lib/typescript/src/model/screenless/frequency.d.ts.map +1 -0
  452. package/lib/typescript/src/model/screenless/google_pay_environment.d.ts +8 -0
  453. package/lib/typescript/src/model/screenless/google_pay_environment.d.ts.map +1 -0
  454. package/lib/typescript/src/model/screenless/google_pay_payment.d.ts +15 -0
  455. package/lib/typescript/src/model/screenless/google_pay_payment.d.ts.map +1 -0
  456. package/lib/typescript/src/model/screenless/google_pay_utils_configuration.d.ts +20 -0
  457. package/lib/typescript/src/model/screenless/google_pay_utils_configuration.d.ts.map +1 -0
  458. package/lib/typescript/src/model/screenless/notifications.d.ts +13 -0
  459. package/lib/typescript/src/model/screenless/notifications.d.ts.map +1 -0
  460. package/lib/typescript/src/model/screenless/payment_details.d.ts +18 -0
  461. package/lib/typescript/src/model/screenless/payment_details.d.ts.map +1 -0
  462. package/lib/typescript/src/model/screenless/raty_pekao_payment.d.ts +15 -0
  463. package/lib/typescript/src/model/screenless/raty_pekao_payment.d.ts.map +1 -0
  464. package/lib/typescript/src/model/screenless/recursive.d.ts +16 -0
  465. package/lib/typescript/src/model/screenless/recursive.d.ts.map +1 -0
  466. package/lib/typescript/src/model/screenless/redirects.d.ts +13 -0
  467. package/lib/typescript/src/model/screenless/redirects.d.ts.map +1 -0
  468. package/lib/typescript/src/model/screenless/screenless_payment.d.ts +18 -0
  469. package/lib/typescript/src/model/screenless/screenless_payment.d.ts.map +1 -0
  470. package/lib/typescript/src/model/screenless/transfer_payment.d.ts +15 -0
  471. package/lib/typescript/src/model/screenless/transfer_payment.d.ts.map +1 -0
  472. package/lib/typescript/src/model/tokenization/tokenization.d.ts +14 -0
  473. package/lib/typescript/src/model/tokenization/tokenization.d.ts.map +1 -0
  474. package/lib/typescript/src/model/tpay_configuration.d.ts +21 -0
  475. package/lib/typescript/src/model/tpay_configuration.d.ts.map +1 -0
  476. package/lib/typescript/src/model/transaction/single_transaction.d.ts +17 -0
  477. package/lib/typescript/src/model/transaction/single_transaction.d.ts.map +1 -0
  478. package/lib/typescript/src/model/transaction/token_payment.d.ts +19 -0
  479. package/lib/typescript/src/model/transaction/token_payment.d.ts.map +1 -0
  480. package/lib/typescript/src/model/transaction/transaction.d.ts +16 -0
  481. package/lib/typescript/src/model/transaction/transaction.d.ts.map +1 -0
  482. package/lib/typescript/src/util/google_pay_configuration_util.d.ts +3 -0
  483. package/lib/typescript/src/util/google_pay_configuration_util.d.ts.map +1 -0
  484. package/lib/typescript/src/util/google_pay_open_util.d.ts +3 -0
  485. package/lib/typescript/src/util/google_pay_open_util.d.ts.map +1 -0
  486. package/lib/typescript/src/util/payment_channels_util.d.ts +3 -0
  487. package/lib/typescript/src/util/payment_channels_util.d.ts.map +1 -0
  488. package/lib/typescript/src/util/result_util.d.ts +3 -0
  489. package/lib/typescript/src/util/result_util.d.ts.map +1 -0
  490. package/lib/typescript/src/util/screenless_result_util.d.ts +3 -0
  491. package/lib/typescript/src/util/screenless_result_util.d.ts.map +1 -0
  492. package/package.json +164 -0
  493. package/react-native-tpay.podspec +42 -0
  494. package/src/assets/tpay_logo.png +0 -0
  495. package/src/assets/tpay_logo@2x.png +0 -0
  496. package/src/assets/tpay_logo@3x.png +0 -0
  497. package/src/component/tpay_button.tsx +44 -0
  498. package/src/index.tsx +267 -0
  499. package/src/model/language/language.ts +4 -0
  500. package/src/model/language/languages.ts +21 -0
  501. package/src/model/language/localized_string.ts +14 -0
  502. package/src/model/merchant/apple_pay_configuration.ts +17 -0
  503. package/src/model/merchant/certificate_configuration.ts +15 -0
  504. package/src/model/merchant/google_pay_configuration.ts +13 -0
  505. package/src/model/merchant/merchant.ts +36 -0
  506. package/src/model/merchant/merchant_authorization.ts +16 -0
  507. package/src/model/merchant/merchant_details.ts +25 -0
  508. package/src/model/merchant/tpay_environment.ts +4 -0
  509. package/src/model/merchant/wallet_configuration.ts +22 -0
  510. package/src/model/payer/address.ts +27 -0
  511. package/src/model/payer/payer.ts +29 -0
  512. package/src/model/payer/payer_context.ts +22 -0
  513. package/src/model/payment_channel/payment_channel.ts +38 -0
  514. package/src/model/payment_channel/payment_constraint.ts +41 -0
  515. package/src/model/payment_channel/payment_group.ts +25 -0
  516. package/src/model/payment_method/automatic_payment_methods.ts +22 -0
  517. package/src/model/payment_method/blik_alias.ts +19 -0
  518. package/src/model/payment_method/credit_card_brand.ts +8 -0
  519. package/src/model/payment_method/digital_wallet.ts +7 -0
  520. package/src/model/payment_method/installment_payment.ts +6 -0
  521. package/src/model/payment_method/payment_method.ts +8 -0
  522. package/src/model/payment_method/payment_methods.ts +27 -0
  523. package/src/model/payment_method/tokenized_card.ts +21 -0
  524. package/src/model/result/google_pay_configure_result.ts +25 -0
  525. package/src/model/result/google_pay_open_result.ts +58 -0
  526. package/src/model/result/payment_channels_result.ts +36 -0
  527. package/src/model/result/result.ts +84 -0
  528. package/src/model/result/screenless_result.ts +138 -0
  529. package/src/model/screenless/ambiguous_alias.ts +19 -0
  530. package/src/model/screenless/ambiguous_blik_payment.ts +26 -0
  531. package/src/model/screenless/apple_pay_payment.ts +24 -0
  532. package/src/model/screenless/blik_payment.ts +32 -0
  533. package/src/model/screenless/callbacks.ts +22 -0
  534. package/src/model/screenless/credit_card.ts +30 -0
  535. package/src/model/screenless/credit_card_config.ts +18 -0
  536. package/src/model/screenless/credit_card_payment.ts +32 -0
  537. package/src/model/screenless/expiration_date.ts +16 -0
  538. package/src/model/screenless/frequency.ts +10 -0
  539. package/src/model/screenless/google_pay_environment.ts +7 -0
  540. package/src/model/screenless/google_pay_payment.ts +24 -0
  541. package/src/model/screenless/google_pay_utils_configuration.ts +33 -0
  542. package/src/model/screenless/notifications.ts +16 -0
  543. package/src/model/screenless/payment_details.ts +29 -0
  544. package/src/model/screenless/raty_pekao_payment.ts +24 -0
  545. package/src/model/screenless/recursive.ts +21 -0
  546. package/src/model/screenless/redirects.ts +16 -0
  547. package/src/model/screenless/screenless_payment.ts +27 -0
  548. package/src/model/screenless/transfer_payment.ts +24 -0
  549. package/src/model/tokenization/tokenization.ts +18 -0
  550. package/src/model/tpay_configuration.ts +32 -0
  551. package/src/model/transaction/single_transaction.ts +26 -0
  552. package/src/model/transaction/token_payment.ts +30 -0
  553. package/src/model/transaction/transaction.ts +25 -0
  554. package/src/util/google_pay_configuration_util.ts +25 -0
  555. package/src/util/google_pay_open_util.ts +31 -0
  556. package/src/util/payment_channels_util.ts +22 -0
  557. package/src/util/result_util.ts +44 -0
  558. package/src/util/screenless_result_util.ts +50 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Krajowy Integrator Płatności Spółka Akcyjna
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,555 @@
1
+ # react-native-tpay
2
+
3
+ The Tpay SDK empowers your app to seamlessly integrate Tpay’s payment functionalities, providing a comprehensive and developer-friendly solution for managing payments.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-tpay
9
+ ```
10
+
11
+ ## UI Module
12
+
13
+ Tpay package contains a UI module. Users can interact with it to make payments.
14
+
15
+ ## Setup
16
+
17
+ ### Android
18
+
19
+ Tpay UI module is a native Android bottom sheet. In order to handle system backpress events you need
20
+ to add the following code to your Activity.
21
+
22
+ ```kotlin
23
+ import com.tpay.util.TpayBackpressUtil;
24
+
25
+ class MainActivity : ReactActivity() {
26
+ override fun onBackPressed() {
27
+ if (TpayBackpressUtil.isModuleVisible) {
28
+ TpayBackpressUtil.onBackPressed()
29
+ } else {
30
+ super.onBackPressed()
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ### iOS
37
+
38
+ When integrating the Tpay payment module into your app, it’s important to ensure that the necessary permissions are correctly set up to ensure a smooth user experience.
39
+
40
+ #### Privacy - Camera Usage Description
41
+
42
+ The module allows the user to automatically fill the credit card form for secure payment processing. This feature requires you to setup the “Privacy - Camera Usage Description” in your app’s Info.plist file.
43
+
44
+ Integration Steps
45
+ 1. Open your project’s Info.plist file.
46
+ 2. Add the key-value pair for the “Privacy - Camera Usage Description” permission, explaining the purpose of camera access. Clearly state that the camera is used to facilitate the automatic filling of the credit card form for secure payment processing.
47
+
48
+ Example:
49
+ ```
50
+ <key>NSCameraUsageDescription</key>
51
+ <string>We need access to your camera to automatically fill the credit card form for secure payment processing.</string>
52
+ ```
53
+
54
+ ## Handling UI module events
55
+
56
+ ```typescript
57
+ function handleResult(result: Result) {
58
+ if (result instanceof TokenizationCompleted) {
59
+ // credit card was tokenized successfully
60
+ }
61
+ if (result instanceof TokenizationFailure) {
62
+ // credit card was not tokenized
63
+ }
64
+ if (result instanceof ConfigurationSuccess) {
65
+ // Tpay package was configured successfully
66
+ }
67
+ if (result instanceof ModuleClosed) {
68
+ // User closed the Tpay UI module
69
+ }
70
+ if (result instanceof ValidationError) {
71
+ // provided data is invalid
72
+ // check error message via result.message
73
+ }
74
+ if (result instanceof PaymentCompleted) {
75
+ // payment completed successfully
76
+ // read transactionId via result.transactionId
77
+ }
78
+ if (result instanceof PaymentCancelled) {
79
+ // payment was cancelled by user
80
+ // result.transactionId might not exist if
81
+ // an error occurred during payment creation
82
+ }
83
+ if (result instanceof MethodCallError) {
84
+ // package error occurred
85
+ // read error message via result.message
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Configure Tpay package
91
+
92
+ ```typescript
93
+ async function configureTpay() {
94
+ const authorization = new MerchantAuthorization('client id', 'client secret');
95
+ const certificateConfiguration = new CertificatePinningConfiguration(
96
+ 'public key hash'
97
+ );
98
+
99
+ const merchant = new Merchant(
100
+ authorization,
101
+ TpayEnvironment.production,
102
+ certificateConfiguration,
103
+ 'BLIK alias to register',
104
+ new WalletConfiguration(
105
+ new GooglePayConfiguration('merchant id'),
106
+ new ApplePayConfiguration('merchant identifier', 'country code')
107
+ )
108
+ );
109
+
110
+ const merchantDetails = new MerchantDetails(
111
+ [
112
+ new LocalizedString(Language.pl, 'Sklep'),
113
+ new LocalizedString(Language.en, 'Merchant'),
114
+ ],
115
+ [
116
+ new LocalizedString(Language.pl, 'Warszawie'),
117
+ new LocalizedString(Language.en, 'Warsaw'),
118
+ ],
119
+ [
120
+ new LocalizedString(Language.pl, 'polish url'),
121
+ new LocalizedString(Language.en, 'english url'),
122
+ ]
123
+ );
124
+
125
+ const languages = new Languages(Language.pl, [Language.en, Language.pl]);
126
+ const paymentMethods = new PaymentMethods(
127
+ [PaymentMethod.card, PaymentMethod.blik, PaymentMethod.transfer],
128
+ [DigitalWallet.googlePay, DigitalWallet.applePay],
129
+ [InstallmentPayment.ratyPekao]
130
+ );
131
+
132
+ const configuration = new TpayConfiguration(
133
+ merchant,
134
+ merchantDetails,
135
+ languages,
136
+ paymentMethods
137
+ );
138
+
139
+ const result = await configure(configuration);
140
+ handleResult(result);
141
+ }
142
+ ```
143
+
144
+ ## Payment with UI module
145
+
146
+ ```typescript
147
+ async function startUiPayment() {
148
+ // Create a payer object, phone number and address fields are optional
149
+ // Name and email fields can be empty, user will fill them in the UI
150
+ const payer = new Payer('John Doe', 'john.doe@example.com', null, null);
151
+
152
+ // Users can choose to save a credit card, it will result in your backend
153
+ // receiving the tokenized card data, provide it there to enable one click payment.
154
+ // You can also provide the BLIK alias to enable the one click BLIK payments.
155
+ // To register the BLIK alias user has to make a payment with 6-digit code first and save the alias.
156
+ // BLIK one click will be shown in the UI when the provided 'isRegistered' parameter is true.
157
+ const automaticPaymentMethods = new AutomaticPaymentMethods(
158
+ [new TokenizedCard('card token', 'card tail', CreditCardBrand.mastercard)],
159
+ new BlikAlias(true, 'alias value', 'alias label')
160
+ );
161
+
162
+ // Tokenized card and BLIK alias registration data will be sent to the notification url.
163
+ // Payments will result in a email notifications sent to notification email.
164
+ const notifications = new Notifications(
165
+ 'https://yourdomain.com/notifications',
166
+ 'store@yourdomain.com'
167
+ );
168
+
169
+ const payerContext = new PayerContext(payer, automaticPaymentMethods);
170
+
171
+ const transaction = new SingleTransaction(
172
+ payerContext,
173
+ 39.99,
174
+ 'transaction description',
175
+ notifications
176
+ );
177
+
178
+ const result = await startPayment(transaction);
179
+ handleResult(result);
180
+ }
181
+ ```
182
+
183
+ ## Credit card tokenization with UI module
184
+
185
+ ```typescript
186
+ async function startCreditCardTokenizationUi() {
187
+ // Create a payer object, phone number and address fields are optional
188
+ // Name and email fields can be empty, user will fill them in the UI
189
+ const payer = new Payer('John Doe', 'john.doe@example.com', null, null);
190
+
191
+ // Tokenized card data will be sent to notification url
192
+ const tokenization = new Tokenization(
193
+ payer,
194
+ 'https://yourdomain.com/notifications'
195
+ );
196
+
197
+ const result = await tokenizeCard(tokenization);
198
+ handleResult(result);
199
+ }
200
+ ```
201
+
202
+ ## Credit card token payment with UI module
203
+
204
+ ```typescript
205
+ async function startCreditCardTokenPaymentUi() {
206
+ // Create a payer object, phone number and address fields are optional
207
+ // Name and email fields are required, because user cannot fill them in the UI
208
+ const payer = new Payer('John Doe', 'john.doe@example.com', null, null);
209
+
210
+ const notifications = new Notifications(
211
+ 'https://yourdomain.com/notifications',
212
+ 'store@yourdomain.com'
213
+ );
214
+
215
+ const tokenPayment = new TokenPayment(
216
+ 'credit card token',
217
+ payer,
218
+ 39.99,
219
+ 'transaction description',
220
+ notifications
221
+ );
222
+
223
+ const result = await startCardTokenPayment(tokenPayment);
224
+ handleResult(result);
225
+ }
226
+ ```
227
+
228
+ ## Screenless Payments
229
+
230
+ Tpay package provides methods to create payments without displaying the UI module.
231
+
232
+ ## Handling screenless events
233
+
234
+ ```typescript
235
+ function handleScreenlessResult(result: ScreenlessResult) {
236
+ if (result instanceof ScreenlessPaid) {
237
+ // payment completed successfully
238
+ // read transactionId via result.transactionId
239
+ }
240
+ if (result instanceof ScreenlessPaymentCreated) {
241
+ // payment was successfully created
242
+ // if it was a BLIK payment user has to accept it in bank app
243
+ // if it was a credit card, transfer or installment payment you have to
244
+ // display result.paymentUrl to finish the payment
245
+ // it is advised to use long polling mechanism to observe payment status
246
+ // you can get transaction id from result.transactionId
247
+ }
248
+ if (result instanceof ScreenlessPaymentError) {
249
+ // creating payment failed
250
+ // read error message via result.error
251
+ }
252
+ if (result instanceof ScreenlessConfiguredPaymentFailed) {
253
+ // creating payment failed because of error with:
254
+ // - credit card data or credit card token
255
+ // - BLIK code or BLIK alias
256
+ }
257
+ if (result instanceof ScreenlessBlikAmbiguousAlias) {
258
+ // when using BLIK payment with alias this result indicates
259
+ // that user has alias registered in more than one bank
260
+ // display result.aliases to the user and
261
+ // continue payment using screenlessAmbiguousBLIKPayment(...) method
262
+ }
263
+ if (result instanceof ScreenlessValidationError) {
264
+ // provided data is invalid
265
+ // check error message via result.message
266
+ }
267
+ if (result instanceof ScreenlessMethodCallError) {
268
+ // package error occurred
269
+ // read error message via result.message
270
+ }
271
+ }
272
+ ```
273
+
274
+ ## Common screenless objects
275
+
276
+ Screenless payments require the following objects.
277
+
278
+ ```typescript
279
+ // Create a payer object, phone number and address fields are optional
280
+ // Name and email fields are required in screenless payments
281
+ const payer = new Payer('John Doe', 'john.doe@example.com', null, null);
282
+
283
+ // Hidden description can be used to search for transaction internally.
284
+ // Tpay website (if needed) will open in the provided language.
285
+ const paymentDetails = new PaymentDetails(
286
+ 39.99,
287
+ 'transaction description',
288
+ 'hidden description',
289
+ Language.pl
290
+ );
291
+
292
+ // User will be redirected to these urls after a payment on the Tpay website.
293
+ // Catch these urls in your web view to know if the payment was successful or not.
294
+ const redirects = new Redirects(
295
+ 'https://yourdomain.com/success',
296
+ 'https://yourdomain.com/error'
297
+ );
298
+
299
+ // Tokenized card and BLIK alias registration data will be sent to the notification url.
300
+ // Payments will result in a email notifications sent to notification email.
301
+ const notifications = new Notifications(
302
+ 'https://yourdomain.com/notifications',
303
+ 'store@yourdomain.com'
304
+ );
305
+
306
+ const callbacks = new Callbacks(redirects, notifications);
307
+ ```
308
+
309
+ ## Screenless BLIK payment
310
+
311
+ Using BLIK user can pay with 6-digit code or alias (for returning customers).
312
+
313
+ ```typescript
314
+ async function startScreenlessBlikPayment() {
315
+ // You have to provide either code or alias.
316
+ // If you provide both, package will try to register the alias.
317
+ // One alias can be registered in multiple banks.
318
+ const blikPayment = new BlikPayment(
319
+ '6-digit code',
320
+ new BlikAlias(true, 'alias value', 'alias label'),
321
+ paymentDetails,
322
+ payer,
323
+ callbacks
324
+ );
325
+
326
+ const screenlessResult = await screenlessBLIKPayment(blikPayment);
327
+ handleScreenlessResult(screenlessResult);
328
+ }
329
+ ```
330
+
331
+ ## Screenless ambiguous BLIK payment
332
+
333
+ screenlessBLIKPayment(...) method can return a ScreenlessBlikAmbiguousAlias result,
334
+ this means that user has BLIK alias registered in more than one bank.
335
+ You need to display ambiguous aliases provided in ScreenlessBlikAmbiguousAlias result to the user.
336
+ After that, you need to continue the payment with ambiguous alias selected by user using screenlessAmbiguousBLIKPayment(...) method.
337
+
338
+ ```typescript
339
+ async function startAmbiguousBlikPayment(
340
+ result: ScreenlessBlikAmbiguousAlias,
341
+ ambiguousAlias: AmbiguousAlias
342
+ ) {
343
+ // BLIK alias used to create payment with screenlessBLIKPayment(...) method
344
+ const blikAlias = new BlikAlias(true, 'alias value', 'alias label');
345
+
346
+ // Provide transaction id from result and ambiguous alias selected by user
347
+ const ambiguousBlikPayment = new AmbiguousBlikPayment(
348
+ result.transactionId,
349
+ blikAlias,
350
+ ambiguousAlias
351
+ );
352
+
353
+ const screenlessResult = await screenlessAmbiguousBLIKPayment(
354
+ ambiguousBlikPayment
355
+ );
356
+ handleScreenlessResult(screenlessResult);
357
+ }
358
+ ```
359
+
360
+ ## Screenless transfer payment
361
+
362
+ Transfer payment requires a channelId of bank in Tpay system.
363
+
364
+ ```typescript
365
+ async function startScreenlessTransferPayment() {
366
+ // Provide channelId of a bank
367
+ const transferPayment = new TransferPayment(
368
+ 3,
369
+ paymentDetails,
370
+ payer,
371
+ callbacks
372
+ );
373
+
374
+ const screenlessResult = await screenlessTransferPayment(transferPayment);
375
+ handleScreenlessResult(screenlessResult);
376
+ }
377
+ ```
378
+
379
+ ## Screenless Raty Pekao payment
380
+
381
+ Raty Pekao payment requires a channelId of Raty Pekao variant.
382
+
383
+ ```typescript
384
+ async function startScreenlessRatyPekaoPayment() {
385
+ // Provide channelId of Raty Pekao variant
386
+ const ratyPekaoPayment = new RatyPekaoPayment(
387
+ 80,
388
+ paymentDetails,
389
+ payer,
390
+ callbacks
391
+ );
392
+
393
+ const screenlessResult = await screenlessRatyPekaoPayment(ratyPekaoPayment);
394
+ handleScreenlessResult(screenlessResult);
395
+ }
396
+ ```
397
+
398
+ ## Screenless credit card payment
399
+
400
+ Credit card payment can be created with credit card data or credit card token (for returning customers).
401
+
402
+ ```typescript
403
+ async function startScreenlessCreditCardPayment() {
404
+ const creditCard = new CreditCard(
405
+ 'card number',
406
+ new ExpirationDate('month', 'year'),
407
+ 'cvv',
408
+ // Configure if the credit card should be tokenized after payment
409
+ // Provide your domain, it's used while encrypting the credit card data
410
+ new CreditCardConfig(false, 'yourdomain.com', null)
411
+ );
412
+ const creditCardToken = 'card token';
413
+
414
+ // You have to provide either credit card or credit card token
415
+ const creditCardPayment = new CreditCardPayment(
416
+ creditCard,
417
+ creditCardToken,
418
+ paymentDetails,
419
+ payer,
420
+ callbacks
421
+ );
422
+
423
+ const screenlessResult = await screenlessCreditCardPayment(creditCardPayment);
424
+ handleScreenlessResult(screenlessResult);
425
+ }
426
+ ```
427
+
428
+ ## Screenless Google Pay payment (Android only)
429
+
430
+ Google Pay payment requires a Google Pay token.
431
+
432
+ ```typescript
433
+ async function startScreenlessGooglePayPayment() {
434
+ const googlePayPayment = new GooglePayPayment(
435
+ 'Google Pay token',
436
+ paymentDetails,
437
+ payer,
438
+ callbacks
439
+ );
440
+
441
+ const screenlessResult = await screenlessGooglePayPayment(googlePayPayment);
442
+ handleScreenlessResult(screenlessResult);
443
+ }
444
+ ```
445
+
446
+ ## Screenless Apple Pay payment (iOS only)
447
+
448
+ Apple Pay payment requires a Apple Pay token.
449
+
450
+ ```typescript
451
+ async function startScreenlessApplePayPayment() {
452
+ const applePayPayment = new ApplePayPayment(
453
+ 'Apple Pay token',
454
+ paymentDetails,
455
+ payer,
456
+ callbacks
457
+ );
458
+
459
+ const screenlessResult = await screenlessApplePayPayment(applePayPayment);
460
+ handleScreenlessResult(screenlessResult);
461
+ }
462
+ ```
463
+
464
+ ## Google Pay utils (Android only)
465
+
466
+ Tpay package offers few convenience methods to interact with Google Pay.
467
+
468
+ ```typescript
469
+ async function googlePayUtils() {
470
+ // Create configuration object by providing the final price,
471
+ // your store name, your merchant id and a Google Pay environment
472
+ const googlePayUtilsConfiguration = new GooglePayUtilsConfiguration(
473
+ 39.99,
474
+ 'your store name',
475
+ 'your merchant id',
476
+ GooglePayEnvironment.production,
477
+ null
478
+ );
479
+ const configurationResult = await configureGooglePayUtils(
480
+ googlePayUtilsConfiguration
481
+ );
482
+
483
+ if (configurationResult instanceof GooglePayConfigureError) {
484
+ // configuration failed
485
+ // check error message via configurationResult.message
486
+ }
487
+ if (configurationResult instanceof GooglePayConfigureSuccess) {
488
+ // utils are configured
489
+
490
+ const isAvailable = await isGooglePayAvailable();
491
+ if (isAvailable) {
492
+ // show Google Pay button
493
+
494
+ // if user clicks on the button do the following
495
+ const googlePayOpenResult = await openGooglePay();
496
+
497
+ if (googlePayOpenResult instanceof GooglePayOpenSuccess) {
498
+ // credit card data was received
499
+ // read Google Pay token via googlePayOpenResult.token
500
+ // and use it with GooglePayPayment
501
+ }
502
+ if (googlePayOpenResult instanceof GooglePayOpenCancelled) {
503
+ // user closed Google Pay
504
+ }
505
+ if (googlePayOpenResult instanceof GooglePayOpenNotConfigured) {
506
+ // Google Pay utils not configured
507
+ }
508
+ if (googlePayOpenResult instanceof GooglePayOpenUnknownError) {
509
+ // unknown error has occurred
510
+ }
511
+ }
512
+ }
513
+ }
514
+ ```
515
+
516
+ ## Fetch payment channels
517
+
518
+ Fetch available payment channels for your merchant account. Filter channels based on availability and payment constraints.
519
+
520
+ ```typescript
521
+ async function fetchPaymentChannels() {
522
+ const result = await getPaymentChannels();
523
+ if (result instanceof PaymentChannelsSuccess) {
524
+ // payment channels received
525
+
526
+ result.channels.forEach((channel) => {
527
+ // channel can have payment constraints
528
+ // that need to be satisfied, otherwise the payment creation will fail
529
+ channel.constraints.forEach((constraint) => {
530
+ switch (constraint.type) {
531
+ case PaymentConstraintType.amount:
532
+ // check if your payment amount is between
533
+ // - amountConstraint.minimum
534
+ // - amountConstraint.maximum
535
+ // this constraint can have:
536
+ // - only minimum value
537
+ // - only maximum value
538
+ // - minimum and maximum values
539
+ const amountConstraint = constraint as AmountPaymentConstraint;
540
+ }
541
+ });
542
+
543
+ // display payment channel if all payment constraints are satisfied
544
+ });
545
+ }
546
+ if (result instanceof PaymentChannelsError) {
547
+ // error occurred
548
+ // read error message via result.message
549
+ }
550
+ }
551
+ ```
552
+
553
+ ## License
554
+
555
+ This library is released under the [MIT License](https://opensource.org/license/mit/).
@@ -0,0 +1,95 @@
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Tpay_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ def isNewArchitectureEnabled() {
18
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
+ }
20
+
21
+ apply plugin: "com.android.library"
22
+ apply plugin: "kotlin-android"
23
+
24
+ if (isNewArchitectureEnabled()) {
25
+ apply plugin: "com.facebook.react"
26
+ }
27
+
28
+ def getExtOrDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Tpay_" + name]
30
+ }
31
+
32
+ def getExtOrIntegerDefault(name) {
33
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Tpay_" + name]).toInteger()
34
+ }
35
+
36
+ def supportsNamespace() {
37
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38
+ def major = parsed[0].toInteger()
39
+ def minor = parsed[1].toInteger()
40
+
41
+ // Namespace support was added in 7.3.0
42
+ return (major == 7 && minor >= 3) || major >= 8
43
+ }
44
+
45
+ android {
46
+ if (supportsNamespace()) {
47
+ namespace "com.tpay"
48
+
49
+ sourceSets {
50
+ main {
51
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
52
+ }
53
+ }
54
+ }
55
+
56
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
57
+
58
+ defaultConfig {
59
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
60
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61
+
62
+ }
63
+
64
+ buildTypes {
65
+ release {
66
+ minifyEnabled false
67
+ }
68
+ }
69
+
70
+ lintOptions {
71
+ disable "GradleCompatible"
72
+ }
73
+
74
+ compileOptions {
75
+ sourceCompatibility JavaVersion.VERSION_1_8
76
+ targetCompatibility JavaVersion.VERSION_1_8
77
+ }
78
+ }
79
+
80
+ repositories {
81
+ mavenCentral()
82
+ google()
83
+ }
84
+
85
+ def kotlin_version = getExtOrDefault("kotlinVersion")
86
+
87
+ dependencies {
88
+ // For < 0.71, this will be from the local maven repo
89
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
90
+ //noinspection GradleDynamicVersion
91
+ implementation "com.facebook.react:react-native:+"
92
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
93
+ implementation 'com.tpay:sdk:1.1.0'
94
+ }
95
+
@@ -0,0 +1,5 @@
1
+ Tpay_kotlinVersion=1.7.0
2
+ Tpay_minSdkVersion=21
3
+ Tpay_targetSdkVersion=31
4
+ Tpay_compileSdkVersion=31
5
+ Tpay_ndkversion=21.4.7075529
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.tpay">
3
+ </manifest>
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,21 @@
1
+ package com.tpay
2
+
3
+ import com.tpay.model.screenless.*
4
+ import com.tpay.sdk.api.screenless.blik.*
5
+
6
+ class TpayAmbiguousBLIKPaymentHandler(
7
+ private val ambiguousBLIKPayment: AmbiguousBLIKPayment,
8
+ private val onResult: (TpayScreenlessResult) -> Unit
9
+ ) {
10
+ init {
11
+ ambiguousBLIKPayment.run {
12
+ BLIKAmbiguousAliasPayment.from(
13
+ transactionId = transactionId,
14
+ blikAlias = blikAlias,
15
+ ambiguousAlias = ambiguousBlikAlias.toAmbiguousAlias()
16
+ ).execute { createResult ->
17
+ onResult(TpayScreenlessResultHandler.handleBLIKCreateResult(createResult))
18
+ }
19
+ }
20
+ }
21
+ }