@tonder.io/rn-sdk 0.1.0-beta.DEV1355.6 → 0.1.0-beta.DEV1355.8

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 (471) hide show
  1. package/README.md +4 -3
  2. package/android/build.gradle +99 -0
  3. package/android/gradle.properties +5 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/android/src/main/AndroidManifestNew.xml +2 -0
  6. package/android/src/main/java/com/tonderio/rnsdk/RnSdkModule.kt +25 -0
  7. package/android/src/main/java/com/tonderio/rnsdk/RnSdkPackage.kt +17 -0
  8. package/ios/RnSdk-Bridging-Header.h +2 -0
  9. package/ios/RnSdk.mm +14 -0
  10. package/ios/RnSdk.swift +8 -0
  11. package/lib/commonjs/core/3DSHandler.js +17 -12
  12. package/lib/commonjs/core/3DSHandler.js.map +1 -1
  13. package/lib/commonjs/core/BaseCheckout/index.js +22 -23
  14. package/lib/commonjs/core/BaseCheckout/index.js.map +1 -1
  15. package/lib/commonjs/core/BaseEnrollment/index.js +8 -9
  16. package/lib/commonjs/core/BaseEnrollment/index.js.map +1 -1
  17. package/lib/commonjs/core/BaseSDK/index.js +3 -3
  18. package/lib/commonjs/core/BaseSDK/index.js.map +1 -1
  19. package/lib/commonjs/core/EnrollmentContainer/index.js +9 -10
  20. package/lib/commonjs/core/EnrollmentContainer/index.js.map +1 -1
  21. package/lib/commonjs/core/PaymentInlineContainer/index.js +5 -5
  22. package/lib/commonjs/core/PaymentInlineContainer/index.js.map +1 -1
  23. package/lib/commonjs/core/PaymentLiteContainer/index.js +12 -12
  24. package/lib/commonjs/core/PaymentLiteContainer/index.js.map +1 -1
  25. package/lib/commonjs/core/Tonder/index.js +16 -10
  26. package/lib/commonjs/core/Tonder/index.js.map +1 -1
  27. package/lib/commonjs/hooks/useTonder/index.js +1 -1
  28. package/lib/commonjs/hooks/useTonder/index.js.map +1 -1
  29. package/lib/commonjs/index.js +15 -0
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/infrastructure/HttpClient.js +7 -8
  32. package/lib/commonjs/infrastructure/HttpClient.js.map +1 -1
  33. package/lib/commonjs/infrastructure/ServiceManager.js +12 -13
  34. package/lib/commonjs/infrastructure/ServiceManager.js.map +1 -1
  35. package/lib/commonjs/services/BusinessService.js +3 -3
  36. package/lib/commonjs/services/BusinessService.js.map +1 -1
  37. package/lib/commonjs/services/CardService.js +7 -8
  38. package/lib/commonjs/services/CardService.js.map +1 -1
  39. package/lib/commonjs/services/CheckoutService.js +11 -11
  40. package/lib/commonjs/services/CheckoutService.js.map +1 -1
  41. package/lib/commonjs/services/CustomerService.js +5 -5
  42. package/lib/commonjs/services/CustomerService.js.map +1 -1
  43. package/lib/commonjs/services/PaymentMethodService.js +3 -3
  44. package/lib/commonjs/services/PaymentMethodService.js.map +1 -1
  45. package/lib/commonjs/services/SkyflowService.js +4 -4
  46. package/lib/commonjs/services/SkyflowService.js.map +1 -1
  47. package/lib/commonjs/services/TokenService.js +4 -4
  48. package/lib/commonjs/services/TokenService.js.map +1 -1
  49. package/lib/commonjs/services/TransactionService.js +3 -3
  50. package/lib/commonjs/services/TransactionService.js.map +1 -1
  51. package/lib/commonjs/services/index.js +0 -11
  52. package/lib/commonjs/services/index.js.map +1 -1
  53. package/lib/commonjs/shared/catalog/cardBrandCatalog.js +1 -1
  54. package/lib/commonjs/shared/catalog/paymentMethodsCatalog.js +2 -2
  55. package/lib/commonjs/shared/constants/environments.js +1 -1
  56. package/lib/commonjs/shared/constants/messages.js +90 -90
  57. package/lib/commonjs/shared/constants/messages.js.map +1 -1
  58. package/lib/commonjs/shared/utils/errors.js +2 -2
  59. package/lib/commonjs/shared/utils/errors.js.map +1 -1
  60. package/lib/commonjs/shared/utils/paymentMethodUtils.js +3 -3
  61. package/lib/commonjs/shared/utils/paymentMethodUtils.js.map +1 -1
  62. package/lib/commonjs/shared/utils/stringUtils.js +17 -1
  63. package/lib/commonjs/shared/utils/stringUtils.js.map +1 -1
  64. package/lib/commonjs/types/srn-temp.d.js +2 -0
  65. package/lib/commonjs/types/srn-temp.d.js.map +1 -0
  66. package/lib/commonjs/ui/components/Button/ProcessButton.js +1 -1
  67. package/lib/commonjs/ui/components/Button/ProcessButton.js.map +1 -1
  68. package/lib/commonjs/ui/components/CardForm/index.js +5 -5
  69. package/lib/commonjs/ui/components/CardForm/index.js.map +1 -1
  70. package/lib/commonjs/ui/components/Input/CardCVVInput.js +6 -4
  71. package/lib/commonjs/ui/components/Input/CardCVVInput.js.map +1 -1
  72. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js +5 -5
  73. package/lib/commonjs/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  74. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js +6 -4
  75. package/lib/commonjs/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  76. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js +6 -4
  77. package/lib/commonjs/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  78. package/lib/commonjs/ui/components/Input/CardHolderInput.js +6 -4
  79. package/lib/commonjs/ui/components/Input/CardHolderInput.js.map +1 -1
  80. package/lib/commonjs/ui/components/Input/CardNumberInput.js +6 -4
  81. package/lib/commonjs/ui/components/Input/CardNumberInput.js.map +1 -1
  82. package/lib/commonjs/ui/components/PaymentMethodsList/index.js +7 -7
  83. package/lib/commonjs/ui/components/PaymentMethodsList/index.js.map +1 -1
  84. package/lib/commonjs/ui/components/SavedCardsList/index.js +6 -4
  85. package/lib/commonjs/ui/components/SavedCardsList/index.js.map +1 -1
  86. package/lib/commonjs/ui/features/TonderEnrollment/index.js +7 -7
  87. package/lib/commonjs/ui/features/TonderEnrollment/index.js.map +1 -1
  88. package/lib/commonjs/ui/features/TonderPayment/index.js +16 -17
  89. package/lib/commonjs/ui/features/TonderPayment/index.js.map +1 -1
  90. package/lib/commonjs/ui/providers/InnerProvider/index.js +1 -1
  91. package/lib/commonjs/ui/providers/InnerProvider/index.js.map +1 -1
  92. package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js +2 -2
  93. package/lib/commonjs/ui/providers/SkyflowContainerWrapper/index.js.map +1 -1
  94. package/lib/commonjs/ui/providers/TonderProvider/hook.js +1 -1
  95. package/lib/commonjs/ui/providers/TonderProvider/index.js +22 -20
  96. package/lib/commonjs/ui/providers/TonderProvider/index.js.map +1 -1
  97. package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js +3 -3
  98. package/lib/commonjs/ui/providers/TonderProvider/uiWrapper.js.map +1 -1
  99. package/lib/commonjs/ui/styles/skyflow.js +1 -1
  100. package/lib/module/core/3DSHandler.js +16 -11
  101. package/lib/module/core/3DSHandler.js.map +1 -1
  102. package/lib/module/core/BaseCheckout/index.js +9 -10
  103. package/lib/module/core/BaseCheckout/index.js.map +1 -1
  104. package/lib/module/core/BaseEnrollment/index.js +3 -4
  105. package/lib/module/core/BaseEnrollment/index.js.map +1 -1
  106. package/lib/module/core/BaseSDK/index.js +2 -2
  107. package/lib/module/core/BaseSDK/index.js.map +1 -1
  108. package/lib/module/core/EnrollmentContainer/index.js +4 -5
  109. package/lib/module/core/EnrollmentContainer/index.js.map +1 -1
  110. package/lib/module/core/PaymentInlineContainer/index.js +3 -3
  111. package/lib/module/core/PaymentInlineContainer/index.js.map +1 -1
  112. package/lib/module/core/PaymentLiteContainer/index.js +6 -6
  113. package/lib/module/core/PaymentLiteContainer/index.js.map +1 -1
  114. package/lib/module/core/Tonder/index.js +14 -8
  115. package/lib/module/core/Tonder/index.js.map +1 -1
  116. package/lib/module/hooks/useTonder/index.js +1 -1
  117. package/lib/module/hooks/useTonder/index.js.map +1 -1
  118. package/lib/module/index.js +13 -0
  119. package/lib/module/index.js.map +1 -1
  120. package/lib/module/infrastructure/HttpClient.js +2 -3
  121. package/lib/module/infrastructure/HttpClient.js.map +1 -1
  122. package/lib/module/infrastructure/ServiceManager.js +2 -3
  123. package/lib/module/infrastructure/ServiceManager.js.map +1 -1
  124. package/lib/module/services/BusinessService.js +2 -2
  125. package/lib/module/services/BusinessService.js.map +1 -1
  126. package/lib/module/services/CardService.js +2 -3
  127. package/lib/module/services/CardService.js.map +1 -1
  128. package/lib/module/services/CheckoutService.js +2 -2
  129. package/lib/module/services/CheckoutService.js.map +1 -1
  130. package/lib/module/services/CustomerService.js +2 -2
  131. package/lib/module/services/CustomerService.js.map +1 -1
  132. package/lib/module/services/PaymentMethodService.js +2 -2
  133. package/lib/module/services/PaymentMethodService.js.map +1 -1
  134. package/lib/module/services/SkyflowService.js +2 -2
  135. package/lib/module/services/SkyflowService.js.map +1 -1
  136. package/lib/module/services/TokenService.js +2 -2
  137. package/lib/module/services/TokenService.js.map +1 -1
  138. package/lib/module/services/TransactionService.js +2 -2
  139. package/lib/module/services/TransactionService.js.map +1 -1
  140. package/lib/module/services/index.js +0 -1
  141. package/lib/module/services/index.js.map +1 -1
  142. package/lib/module/shared/catalog/cardBrandCatalog.js +1 -1
  143. package/lib/module/shared/catalog/cardBrandCatalog.js.map +1 -1
  144. package/lib/module/shared/catalog/paymentMethodsCatalog.js +2 -2
  145. package/lib/module/shared/catalog/paymentMethodsCatalog.js.map +1 -1
  146. package/lib/module/shared/constants/environments.js +1 -1
  147. package/lib/module/shared/constants/messages.js +1 -1
  148. package/lib/module/shared/constants/messages.js.map +1 -1
  149. package/lib/module/shared/utils/errors.js +1 -1
  150. package/lib/module/shared/utils/errors.js.map +1 -1
  151. package/lib/module/shared/utils/paymentMethodUtils.js +2 -2
  152. package/lib/module/shared/utils/paymentMethodUtils.js.map +1 -1
  153. package/lib/module/shared/utils/stringUtils.js +15 -0
  154. package/lib/module/shared/utils/stringUtils.js.map +1 -1
  155. package/lib/module/types/srn-temp.d.js +2 -0
  156. package/lib/module/types/srn-temp.d.js.map +1 -0
  157. package/lib/module/ui/components/Button/ProcessButton.js +1 -1
  158. package/lib/module/ui/components/Button/ProcessButton.js.map +1 -1
  159. package/lib/module/ui/components/CardForm/index.js +5 -5
  160. package/lib/module/ui/components/CardForm/index.js.map +1 -1
  161. package/lib/module/ui/components/Input/CardCVVInput.js +5 -4
  162. package/lib/module/ui/components/Input/CardCVVInput.js.map +1 -1
  163. package/lib/module/ui/components/Input/CardExpirationDateInput.js +5 -5
  164. package/lib/module/ui/components/Input/CardExpirationDateInput.js.map +1 -1
  165. package/lib/module/ui/components/Input/CardExpirationMonthInput.js +6 -5
  166. package/lib/module/ui/components/Input/CardExpirationMonthInput.js.map +1 -1
  167. package/lib/module/ui/components/Input/CardExpirationYearInput.js +5 -4
  168. package/lib/module/ui/components/Input/CardExpirationYearInput.js.map +1 -1
  169. package/lib/module/ui/components/Input/CardHolderInput.js +5 -4
  170. package/lib/module/ui/components/Input/CardHolderInput.js.map +1 -1
  171. package/lib/module/ui/components/Input/CardNumberInput.js +5 -4
  172. package/lib/module/ui/components/Input/CardNumberInput.js.map +1 -1
  173. package/lib/module/ui/components/PaymentMethodsList/index.js +6 -6
  174. package/lib/module/ui/components/PaymentMethodsList/index.js.map +1 -1
  175. package/lib/module/ui/components/SavedCardsList/index.js +4 -3
  176. package/lib/module/ui/components/SavedCardsList/index.js.map +1 -1
  177. package/lib/module/ui/features/TonderEnrollment/index.js +6 -6
  178. package/lib/module/ui/features/TonderEnrollment/index.js.map +1 -1
  179. package/lib/module/ui/features/TonderPayment/index.js +12 -13
  180. package/lib/module/ui/features/TonderPayment/index.js.map +1 -1
  181. package/lib/module/ui/providers/InnerProvider/index.js +1 -1
  182. package/lib/module/ui/providers/InnerProvider/index.js.map +1 -1
  183. package/lib/module/ui/providers/SkyflowContainerWrapper/index.js +1 -1
  184. package/lib/module/ui/providers/SkyflowContainerWrapper/index.js.map +1 -1
  185. package/lib/module/ui/providers/TonderProvider/hook.js +1 -1
  186. package/lib/module/ui/providers/TonderProvider/hook.js.map +1 -1
  187. package/lib/module/ui/providers/TonderProvider/index.js +15 -13
  188. package/lib/module/ui/providers/TonderProvider/index.js.map +1 -1
  189. package/lib/module/ui/providers/TonderProvider/uiWrapper.js +2 -2
  190. package/lib/module/ui/providers/TonderProvider/uiWrapper.js.map +1 -1
  191. package/lib/module/ui/styles/skyflow.js +1 -1
  192. package/lib/typescript/commonjs/src/core/3DSHandler.d.ts +4 -4
  193. package/lib/typescript/commonjs/src/core/3DSHandler.d.ts.map +1 -1
  194. package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts +5 -5
  195. package/lib/typescript/commonjs/src/core/BaseCheckout/index.d.ts.map +1 -1
  196. package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts +5 -5
  197. package/lib/typescript/commonjs/src/core/BaseEnrollment/index.d.ts.map +1 -1
  198. package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts +2 -2
  199. package/lib/typescript/commonjs/src/core/BaseSDK/index.d.ts.map +1 -1
  200. package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts +4 -4
  201. package/lib/typescript/commonjs/src/core/EnrollmentContainer/index.d.ts.map +1 -1
  202. package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts +4 -4
  203. package/lib/typescript/commonjs/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  204. package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts +4 -4
  205. package/lib/typescript/commonjs/src/core/PaymentLiteContainer/index.d.ts.map +1 -1
  206. package/lib/typescript/commonjs/src/core/Tonder/index.d.ts +2 -2
  207. package/lib/typescript/commonjs/src/core/Tonder/index.d.ts.map +1 -1
  208. package/lib/typescript/commonjs/src/hooks/useTonder/index.d.ts +2 -2
  209. package/lib/typescript/commonjs/src/hooks/useTonder/index.d.ts.map +1 -1
  210. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  211. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  212. package/lib/typescript/commonjs/src/infrastructure/HttpClient.d.ts +1 -1
  213. package/lib/typescript/commonjs/src/infrastructure/HttpClient.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/src/infrastructure/ServiceManager.d.ts +2 -3
  215. package/lib/typescript/commonjs/src/infrastructure/ServiceManager.d.ts.map +1 -1
  216. package/lib/typescript/commonjs/src/services/BusinessService.d.ts +2 -2
  217. package/lib/typescript/commonjs/src/services/BusinessService.d.ts.map +1 -1
  218. package/lib/typescript/commonjs/src/services/CardService.d.ts +2 -2
  219. package/lib/typescript/commonjs/src/services/CardService.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/src/services/CheckoutService.d.ts +2 -2
  221. package/lib/typescript/commonjs/src/services/CheckoutService.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/src/services/CustomerService.d.ts +2 -2
  223. package/lib/typescript/commonjs/src/services/CustomerService.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/src/services/PaymentMethodService.d.ts +2 -2
  225. package/lib/typescript/commonjs/src/services/PaymentMethodService.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/src/services/SkyflowService.d.ts +1 -1
  227. package/lib/typescript/commonjs/src/services/SkyflowService.d.ts.map +1 -1
  228. package/lib/typescript/commonjs/src/services/TokenService.d.ts +2 -2
  229. package/lib/typescript/commonjs/src/services/TokenService.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/src/services/TransactionService.d.ts +2 -2
  231. package/lib/typescript/commonjs/src/services/TransactionService.d.ts.map +1 -1
  232. package/lib/typescript/commonjs/src/services/index.d.ts +0 -1
  233. package/lib/typescript/commonjs/src/services/index.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/src/shared/constants/environments.d.ts +1 -1
  235. package/lib/typescript/commonjs/src/shared/utils/common.d.ts +1 -1
  236. package/lib/typescript/commonjs/src/shared/utils/common.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/src/shared/utils/stringUtils.d.ts +3 -0
  238. package/lib/typescript/commonjs/src/shared/utils/stringUtils.d.ts.map +1 -1
  239. package/lib/typescript/commonjs/src/shared/utils/styleUtils.d.ts +1 -1
  240. package/lib/typescript/commonjs/src/shared/utils/styleUtils.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/src/types/base.d.ts +5 -5
  242. package/lib/typescript/commonjs/src/types/base.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/src/types/baseCheckout.d.ts +2 -2
  244. package/lib/typescript/commonjs/src/types/baseCheckout.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts +2 -2
  246. package/lib/typescript/commonjs/src/types/baseEnrollment.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/src/types/baseSDK.d.ts +2 -2
  248. package/lib/typescript/commonjs/src/types/baseSDK.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/src/types/common.d.ts +1 -1
  250. package/lib/typescript/commonjs/src/types/common.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/src/types/enrollment.d.ts +1 -1
  252. package/lib/typescript/commonjs/src/types/enrollment.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts +3 -3
  254. package/lib/typescript/commonjs/src/types/inlineCheckout.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/src/types/liteCheckout.d.ts +3 -3
  256. package/lib/typescript/commonjs/src/types/liteCheckout.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts +2 -2
  258. package/lib/typescript/commonjs/src/types/threeDSHandler.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/src/ui/components/Button/ProcessButton.d.ts +1 -1
  260. package/lib/typescript/commonjs/src/ui/components/Button/ProcessButton.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts +1 -1
  262. package/lib/typescript/commonjs/src/ui/components/CardForm/index.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts +1 -1
  264. package/lib/typescript/commonjs/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -1
  266. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts +1 -1
  268. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts +1 -1
  270. package/lib/typescript/commonjs/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts +1 -1
  272. package/lib/typescript/commonjs/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts +1 -1
  274. package/lib/typescript/commonjs/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/src/ui/components/PaymentMethodsList/index.d.ts +1 -1
  276. package/lib/typescript/commonjs/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/src/ui/components/RadioButton/index.d.ts +1 -1
  278. package/lib/typescript/commonjs/src/ui/components/RadioButton/index.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts +1 -1
  280. package/lib/typescript/commonjs/src/ui/components/SavedCardsList/index.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts +1 -1
  283. package/lib/typescript/commonjs/src/ui/providers/InnerProvider/index.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts +2 -2
  285. package/lib/typescript/commonjs/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/context.d.ts +2 -2
  287. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/context.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/hook.d.ts +1 -1
  289. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/hook.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/index.d.ts +1 -1
  291. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/index.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/uiWrapper.d.ts +1 -1
  293. package/lib/typescript/commonjs/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -1
  294. package/lib/typescript/module/src/core/3DSHandler.d.ts +4 -4
  295. package/lib/typescript/module/src/core/3DSHandler.d.ts.map +1 -1
  296. package/lib/typescript/module/src/core/BaseCheckout/index.d.ts +5 -5
  297. package/lib/typescript/module/src/core/BaseCheckout/index.d.ts.map +1 -1
  298. package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts +5 -5
  299. package/lib/typescript/module/src/core/BaseEnrollment/index.d.ts.map +1 -1
  300. package/lib/typescript/module/src/core/BaseSDK/index.d.ts +2 -2
  301. package/lib/typescript/module/src/core/BaseSDK/index.d.ts.map +1 -1
  302. package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts +4 -4
  303. package/lib/typescript/module/src/core/EnrollmentContainer/index.d.ts.map +1 -1
  304. package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts +4 -4
  305. package/lib/typescript/module/src/core/PaymentInlineContainer/index.d.ts.map +1 -1
  306. package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts +4 -4
  307. package/lib/typescript/module/src/core/PaymentLiteContainer/index.d.ts.map +1 -1
  308. package/lib/typescript/module/src/core/Tonder/index.d.ts +2 -2
  309. package/lib/typescript/module/src/core/Tonder/index.d.ts.map +1 -1
  310. package/lib/typescript/module/src/hooks/useTonder/index.d.ts +2 -2
  311. package/lib/typescript/module/src/hooks/useTonder/index.d.ts.map +1 -1
  312. package/lib/typescript/module/src/index.d.ts +1 -0
  313. package/lib/typescript/module/src/index.d.ts.map +1 -1
  314. package/lib/typescript/module/src/infrastructure/HttpClient.d.ts +1 -1
  315. package/lib/typescript/module/src/infrastructure/HttpClient.d.ts.map +1 -1
  316. package/lib/typescript/module/src/infrastructure/ServiceManager.d.ts +2 -3
  317. package/lib/typescript/module/src/infrastructure/ServiceManager.d.ts.map +1 -1
  318. package/lib/typescript/module/src/services/BusinessService.d.ts +2 -2
  319. package/lib/typescript/module/src/services/BusinessService.d.ts.map +1 -1
  320. package/lib/typescript/module/src/services/CardService.d.ts +2 -2
  321. package/lib/typescript/module/src/services/CardService.d.ts.map +1 -1
  322. package/lib/typescript/module/src/services/CheckoutService.d.ts +2 -2
  323. package/lib/typescript/module/src/services/CheckoutService.d.ts.map +1 -1
  324. package/lib/typescript/module/src/services/CustomerService.d.ts +2 -2
  325. package/lib/typescript/module/src/services/CustomerService.d.ts.map +1 -1
  326. package/lib/typescript/module/src/services/PaymentMethodService.d.ts +2 -2
  327. package/lib/typescript/module/src/services/PaymentMethodService.d.ts.map +1 -1
  328. package/lib/typescript/module/src/services/SkyflowService.d.ts +1 -1
  329. package/lib/typescript/module/src/services/SkyflowService.d.ts.map +1 -1
  330. package/lib/typescript/module/src/services/TokenService.d.ts +2 -2
  331. package/lib/typescript/module/src/services/TokenService.d.ts.map +1 -1
  332. package/lib/typescript/module/src/services/TransactionService.d.ts +2 -2
  333. package/lib/typescript/module/src/services/TransactionService.d.ts.map +1 -1
  334. package/lib/typescript/module/src/services/index.d.ts +0 -1
  335. package/lib/typescript/module/src/services/index.d.ts.map +1 -1
  336. package/lib/typescript/module/src/shared/constants/environments.d.ts +1 -1
  337. package/lib/typescript/module/src/shared/utils/common.d.ts +1 -1
  338. package/lib/typescript/module/src/shared/utils/common.d.ts.map +1 -1
  339. package/lib/typescript/module/src/shared/utils/stringUtils.d.ts +3 -0
  340. package/lib/typescript/module/src/shared/utils/stringUtils.d.ts.map +1 -1
  341. package/lib/typescript/module/src/shared/utils/styleUtils.d.ts +1 -1
  342. package/lib/typescript/module/src/shared/utils/styleUtils.d.ts.map +1 -1
  343. package/lib/typescript/module/src/types/base.d.ts +5 -5
  344. package/lib/typescript/module/src/types/base.d.ts.map +1 -1
  345. package/lib/typescript/module/src/types/baseCheckout.d.ts +2 -2
  346. package/lib/typescript/module/src/types/baseCheckout.d.ts.map +1 -1
  347. package/lib/typescript/module/src/types/baseEnrollment.d.ts +2 -2
  348. package/lib/typescript/module/src/types/baseEnrollment.d.ts.map +1 -1
  349. package/lib/typescript/module/src/types/baseSDK.d.ts +2 -2
  350. package/lib/typescript/module/src/types/baseSDK.d.ts.map +1 -1
  351. package/lib/typescript/module/src/types/common.d.ts +1 -1
  352. package/lib/typescript/module/src/types/common.d.ts.map +1 -1
  353. package/lib/typescript/module/src/types/enrollment.d.ts +1 -1
  354. package/lib/typescript/module/src/types/enrollment.d.ts.map +1 -1
  355. package/lib/typescript/module/src/types/inlineCheckout.d.ts +3 -3
  356. package/lib/typescript/module/src/types/inlineCheckout.d.ts.map +1 -1
  357. package/lib/typescript/module/src/types/liteCheckout.d.ts +3 -3
  358. package/lib/typescript/module/src/types/liteCheckout.d.ts.map +1 -1
  359. package/lib/typescript/module/src/types/threeDSHandler.d.ts +2 -2
  360. package/lib/typescript/module/src/types/threeDSHandler.d.ts.map +1 -1
  361. package/lib/typescript/module/src/ui/components/Button/ProcessButton.d.ts +1 -1
  362. package/lib/typescript/module/src/ui/components/Button/ProcessButton.d.ts.map +1 -1
  363. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts +1 -1
  364. package/lib/typescript/module/src/ui/components/CardForm/index.d.ts.map +1 -1
  365. package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts +1 -1
  366. package/lib/typescript/module/src/ui/components/Input/CardCVVInput.d.ts.map +1 -1
  367. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts +1 -1
  368. package/lib/typescript/module/src/ui/components/Input/CardExpirationDateInput.d.ts.map +1 -1
  369. package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts +1 -1
  370. package/lib/typescript/module/src/ui/components/Input/CardExpirationMonthInput.d.ts.map +1 -1
  371. package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts +1 -1
  372. package/lib/typescript/module/src/ui/components/Input/CardExpirationYearInput.d.ts.map +1 -1
  373. package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts +1 -1
  374. package/lib/typescript/module/src/ui/components/Input/CardHolderInput.d.ts.map +1 -1
  375. package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts +1 -1
  376. package/lib/typescript/module/src/ui/components/Input/CardNumberInput.d.ts.map +1 -1
  377. package/lib/typescript/module/src/ui/components/PaymentMethodsList/index.d.ts +1 -1
  378. package/lib/typescript/module/src/ui/components/PaymentMethodsList/index.d.ts.map +1 -1
  379. package/lib/typescript/module/src/ui/components/RadioButton/index.d.ts +1 -1
  380. package/lib/typescript/module/src/ui/components/RadioButton/index.d.ts.map +1 -1
  381. package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts +1 -1
  382. package/lib/typescript/module/src/ui/components/SavedCardsList/index.d.ts.map +1 -1
  383. package/lib/typescript/module/src/ui/features/TonderPayment/index.d.ts.map +1 -1
  384. package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts +1 -1
  385. package/lib/typescript/module/src/ui/providers/InnerProvider/index.d.ts.map +1 -1
  386. package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts +2 -2
  387. package/lib/typescript/module/src/ui/providers/SkyflowContainerWrapper/index.d.ts.map +1 -1
  388. package/lib/typescript/module/src/ui/providers/TonderProvider/context.d.ts +2 -2
  389. package/lib/typescript/module/src/ui/providers/TonderProvider/context.d.ts.map +1 -1
  390. package/lib/typescript/module/src/ui/providers/TonderProvider/hook.d.ts +1 -1
  391. package/lib/typescript/module/src/ui/providers/TonderProvider/hook.d.ts.map +1 -1
  392. package/lib/typescript/module/src/ui/providers/TonderProvider/index.d.ts +1 -1
  393. package/lib/typescript/module/src/ui/providers/TonderProvider/index.d.ts.map +1 -1
  394. package/lib/typescript/module/src/ui/providers/TonderProvider/uiWrapper.d.ts +1 -1
  395. package/lib/typescript/module/src/ui/providers/TonderProvider/uiWrapper.d.ts.map +1 -1
  396. package/package.json +24 -30
  397. package/src/core/3DSHandler.ts +26 -16
  398. package/src/core/BaseCheckout/index.ts +11 -12
  399. package/src/core/BaseEnrollment/index.ts +6 -7
  400. package/src/core/BaseSDK/index.ts +4 -4
  401. package/src/core/EnrollmentContainer/index.ts +7 -8
  402. package/src/core/PaymentInlineContainer/index.ts +6 -6
  403. package/src/core/PaymentLiteContainer/index.ts +9 -9
  404. package/src/core/Tonder/index.ts +13 -10
  405. package/src/hooks/useTonder/index.ts +2 -2
  406. package/src/index.tsx +23 -0
  407. package/src/infrastructure/HttpClient.ts +3 -4
  408. package/src/infrastructure/ServiceManager.ts +3 -6
  409. package/src/services/BusinessService.ts +4 -4
  410. package/src/services/CardService.ts +4 -5
  411. package/src/services/CheckoutService.ts +4 -4
  412. package/src/services/CustomerService.ts +4 -4
  413. package/src/services/PaymentMethodService.ts +4 -4
  414. package/src/services/SkyflowService.ts +3 -3
  415. package/src/services/TokenService.ts +4 -4
  416. package/src/services/TransactionService.ts +4 -4
  417. package/src/services/index.ts +0 -1
  418. package/src/shared/catalog/cardBrandCatalog.ts +1 -1
  419. package/src/shared/catalog/paymentMethodsCatalog.ts +2 -2
  420. package/src/shared/constants/environments.ts +1 -1
  421. package/src/shared/constants/messages.ts +1 -1
  422. package/src/shared/utils/common.ts +1 -1
  423. package/src/shared/utils/errors.ts +1 -1
  424. package/src/shared/utils/paymentMethodUtils.ts +2 -2
  425. package/src/shared/utils/stringUtils.ts +24 -0
  426. package/src/shared/utils/styleUtils.ts +1 -1
  427. package/src/types/base.ts +5 -5
  428. package/src/types/baseCheckout.ts +2 -3
  429. package/src/types/baseEnrollment.ts +2 -2
  430. package/src/types/baseSDK.ts +2 -2
  431. package/src/types/common.ts +1 -1
  432. package/src/types/enrollment.ts +1 -1
  433. package/src/types/inlineCheckout.ts +3 -3
  434. package/src/types/liteCheckout.ts +3 -3
  435. package/src/types/{skyflow-react-native.d.ts → srn-temp.d.ts} +1 -1
  436. package/src/types/threeDSHandler.ts +2 -2
  437. package/src/ui/components/Button/ProcessButton.tsx +2 -2
  438. package/src/ui/components/CardForm/index.tsx +6 -6
  439. package/src/ui/components/Input/CardCVVInput.tsx +6 -5
  440. package/src/ui/components/Input/CardExpirationDateInput.tsx +6 -6
  441. package/src/ui/components/Input/CardExpirationMonthInput.tsx +10 -6
  442. package/src/ui/components/Input/CardExpirationYearInput.tsx +6 -5
  443. package/src/ui/components/Input/CardHolderInput.tsx +6 -5
  444. package/src/ui/components/Input/CardNumberInput.tsx +6 -5
  445. package/src/ui/components/PaymentMethodsList/index.tsx +7 -7
  446. package/src/ui/components/RadioButton/index.tsx +1 -1
  447. package/src/ui/components/SavedCardsList/index.tsx +5 -4
  448. package/src/ui/features/TonderEnrollment/index.tsx +7 -7
  449. package/src/ui/features/TonderPayment/index.tsx +13 -20
  450. package/src/ui/providers/InnerProvider/index.tsx +2 -2
  451. package/src/ui/providers/SkyflowContainerWrapper/index.tsx +3 -3
  452. package/src/ui/providers/TonderProvider/context.tsx +3 -3
  453. package/src/ui/providers/TonderProvider/hook.ts +2 -2
  454. package/src/ui/providers/TonderProvider/index.tsx +24 -20
  455. package/src/ui/providers/TonderProvider/uiWrapper.ts +3 -3
  456. package/src/ui/styles/skyflow.ts +1 -1
  457. package/tonder-io-rn-sdk.podspec +41 -0
  458. package/.yarn/patches/skyflow-react-native-npm-1.7.0-0841655e49.patch +0 -13
  459. package/lib/commonjs/services/StorageService.js +0 -49
  460. package/lib/commonjs/services/StorageService.js.map +0 -1
  461. package/lib/commonjs/types/skyflow-react-native.d.js +0 -2
  462. package/lib/commonjs/types/skyflow-react-native.d.js.map +0 -1
  463. package/lib/module/services/StorageService.js +0 -43
  464. package/lib/module/services/StorageService.js.map +0 -1
  465. package/lib/module/types/skyflow-react-native.d.js +0 -2
  466. package/lib/module/types/skyflow-react-native.d.js.map +0 -1
  467. package/lib/typescript/commonjs/src/services/StorageService.d.ts +0 -7
  468. package/lib/typescript/commonjs/src/services/StorageService.d.ts.map +0 -1
  469. package/lib/typescript/module/src/services/StorageService.d.ts +0 -7
  470. package/lib/typescript/module/src/services/StorageService.d.ts.map +0 -1
  471. package/src/services/StorageService.ts +0 -56
@@ -1,6 +1,5 @@
1
- import type Tonder from '@core/Tonder';
2
- import BaseSDK from '@core/BaseSDK';
3
1
  import React from 'react';
2
+ import BaseSDK from '../BaseSDK';
4
3
  import type {
5
4
  ICardPaymentFields,
6
5
  ICheckoutResponse,
@@ -13,15 +12,15 @@ import type {
13
12
  IThreeDSHandler,
14
13
  ITransaction,
15
14
  SDKOptions,
16
- } from '@types';
17
- import { SDKType } from '@types';
18
- import { executeCallback, getAppInfo } from '@shared/utils/common';
19
- import { defaultTo, get } from 'lodash';
20
- import { MESSAGES_ES, TONDER_URL_BY_MODE } from '@shared/constants';
21
- import TonderError from '@shared/utils/errors';
22
- import { ErrorKeyEnum } from '@shared/enum';
23
- import { ThreeDSHandler } from '@core/3DSHandler';
24
- import { getPaymentMethodDetails } from '@shared/catalog/paymentMethodsCatalog';
15
+ } from '../../types';
16
+ import Tonder from '../Tonder';
17
+ import { ThreeDSHandler } from '../3DSHandler';
18
+ import { SDKType } from '../../types';
19
+ import TonderError from '../../shared/utils/errors';
20
+ import { ErrorKeyEnum, MESSAGES_ES, TONDER_URL_BY_MODE } from '../../shared';
21
+ import { executeCallback, getAppInfo } from '../../shared/utils/common';
22
+ import { getPaymentMethodDetails } from '../../shared/catalog/paymentMethodsCatalog';
23
+ import { defaultTo, get } from '../../shared/utils/stringUtils';
25
24
 
26
25
  class BaseCheckout extends BaseSDK {
27
26
  #process3ds: IThreeDSHandler;
@@ -302,7 +301,7 @@ class BaseCheckout extends BaseSDK {
302
301
  return;
303
302
  }
304
303
 
305
- await executeCallback({
304
+ executeCallback({
306
305
  callbacks: this.getState().callbacks,
307
306
  callback: 'onFinishPayment',
308
307
  data: { response: finalResponse },
@@ -1,14 +1,13 @@
1
- import TonderError from '@shared/utils/errors';
2
- import { MESSAGES_ES } from '@shared/constants';
1
+ import TonderError from '../../shared/utils/errors';
2
+ import { MESSAGES_ES, ErrorKeyEnum } from '../../shared';
3
3
  import type {
4
4
  ISaveCardResponse,
5
5
  SDKOptions,
6
6
  IEnrollmentCustomizationOptions,
7
- } from '@types';
8
- import { SDKType } from '@types';
9
- import { ErrorKeyEnum } from '@shared/enum';
10
- import BaseSDK from '@core/BaseSDK';
11
- import type Tonder from '@core/Tonder';
7
+ } from '../../types';
8
+ import { SDKType } from '../../types';
9
+ import BaseSDK from '../../core/BaseSDK';
10
+ import type Tonder from '../../core/Tonder';
12
11
  import React from 'react';
13
12
 
14
13
  class BaseEnrollment extends BaseSDK {
@@ -1,7 +1,7 @@
1
- import type Tonder from '@core/Tonder';
2
- import type { ICustomer, ICustomerResponse } from '@types';
3
- import TonderError from '@shared/utils/errors';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type Tonder from '../Tonder';
2
+ import type { ICustomer, ICustomerResponse } from '../../types';
3
+ import TonderError from '../../shared/utils/errors';
4
+ import { ErrorKeyEnum } from '../../shared';
5
5
  import React from 'react';
6
6
 
7
7
  class BaseSDK {
@@ -3,15 +3,14 @@ import type {
3
3
  IEnrollment,
4
4
  ISaveCardResponse,
5
5
  SDKOptions,
6
- } from '@types';
7
- import TonderError from '@shared/utils/errors';
8
- import { ErrorKeyEnum } from '@shared/enum';
9
- import { MESSAGES_ES } from '@shared/constants';
6
+ } from '../../types';
7
+ import TonderError from '../../shared/utils/errors';
8
+ import { ErrorKeyEnum, MESSAGES_ES } from '../../shared';
10
9
  import React from 'react';
11
- import { executeCallback } from '@shared/utils/common';
12
- import BaseEnrollment from '@core/BaseEnrollment';
13
- import { SDKType } from '@types';
14
- import Tonder from '@core/Tonder';
10
+ import { executeCallback } from '../../shared/utils/common';
11
+ import BaseEnrollment from '../../core/BaseEnrollment';
12
+ import { SDKType } from '../../types';
13
+ import Tonder from '../../core/Tonder';
15
14
 
16
15
  export class EnrollmentContainer implements IEnrollment {
17
16
  #tonderClient: Tonder;
@@ -1,6 +1,6 @@
1
- import type Tonder from '@core/Tonder';
2
- import TonderError from '@shared/utils/errors';
3
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type Tonder from '../../core/Tonder';
2
+ import TonderError from '../../shared/utils/errors';
3
+ import { ErrorKeyEnum } from '../../shared';
4
4
  import React from 'react';
5
5
  import type {
6
6
  IBaseProcessPaymentRequest,
@@ -10,9 +10,9 @@ import type {
10
10
  IProcessPaymentRequest,
11
11
  ITransaction,
12
12
  SDKOptions,
13
- } from '@types';
14
- import BaseCheckout from '@core/BaseCheckout';
15
- import { SDKType } from '@types';
13
+ } from '../../types';
14
+ import BaseCheckout from '../../core/BaseCheckout';
15
+ import { SDKType } from '../../types';
16
16
 
17
17
  class PaymentInlineContainer implements IPaymentInlineContainer {
18
18
  #tonderClient: Tonder;
@@ -1,6 +1,6 @@
1
- import type Tonder from '@core/Tonder';
2
- import TonderError from '@shared/utils/errors';
3
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type Tonder from '../../core/Tonder';
2
+ import TonderError from '../../shared/utils/errors';
3
+ import { ErrorKeyEnum } from '../../shared';
4
4
  import React from 'react';
5
5
  import type {
6
6
  IBaseResponse,
@@ -12,12 +12,12 @@ import type {
12
12
  ISaveCardResponse,
13
13
  ITransaction,
14
14
  SDKOptions,
15
- } from '@types';
16
- import BaseCheckout from '@core/BaseCheckout';
17
- import { SDKType } from '@types';
18
- import { defaultTo } from 'lodash';
19
- import { getPaymentMethodsWithDetails } from '@shared/utils/paymentMethodUtils';
20
- import { getCardType } from '@shared/catalog/cardBrandCatalog';
15
+ } from '../../types';
16
+ import BaseCheckout from '../../core/BaseCheckout';
17
+ import { SDKType } from '../../types';
18
+ import { getPaymentMethodsWithDetails } from '../../shared/utils/paymentMethodUtils';
19
+ import { getCardType } from '../../shared/catalog/cardBrandCatalog';
20
+ import { defaultTo } from '../../shared/utils/stringUtils';
21
21
 
22
22
  class PaymentLiteContainer implements IPaymentLiteContainer {
23
23
  #tonderClient: Tonder;
@@ -3,11 +3,10 @@ import type {
3
3
  ICustomerResponse,
4
4
  IPaymentMethod,
5
5
  ISDKBaseConfig,
6
- } from '@types';
7
- import { ServiceManager } from '@infrastructure/ServiceManager';
8
- import TonderError from '@shared/utils/errors';
9
- import { ErrorKeyEnum } from '@shared/enum';
10
- import { TONDER_URL_BY_MODE } from '@shared/constants';
6
+ } from '../../types';
7
+ import { ServiceManager } from '../../infrastructure';
8
+ import TonderError from '../../shared/utils/errors';
9
+ import { ErrorKeyEnum } from '../../shared';
11
10
 
12
11
  class Tonder {
13
12
  private config: ISDKBaseConfig;
@@ -82,9 +81,9 @@ class Tonder {
82
81
  ...(selectedMethod && selectedMethod !== ''
83
82
  ? {
84
83
  ...(card && card !== ''
85
- ? { card }
84
+ ? { card, payment_method: '' }
86
85
  : paymentMethod && paymentMethod !== ''
87
- ? { payment_method: paymentMethod }
86
+ ? { payment_method: paymentMethod, card: '' }
88
87
  : { card: '', payment_method: '' }),
89
88
  }
90
89
  : {}),
@@ -111,9 +110,13 @@ class Tonder {
111
110
  }
112
111
 
113
112
  public emit = (eventName: string, data: any): void => {
114
- const listeners = this.eventListeners.get(eventName);
115
- if (listeners) {
116
- listeners.forEach((listener) => listener(data));
113
+ try {
114
+ const listeners = this.eventListeners.get(eventName);
115
+ if (listeners) {
116
+ listeners.forEach((listener) => listener(data));
117
+ }
118
+ } catch (e) {
119
+ console.error('[Tonder | emit | ERROR]', e);
117
120
  }
118
121
  };
119
122
 
@@ -1,5 +1,5 @@
1
- import useTonderContext from '@ui/providers/TonderProvider/hook';
2
- import { SDKType } from '@types';
1
+ import useTonderContext from '../../ui/providers/TonderProvider/hook';
2
+ import { SDKType } from '../../types';
3
3
 
4
4
  const useTonder = <T extends SDKType>() => {
5
5
  const { sdk } = useTonderContext<T>();
package/src/index.tsx CHANGED
@@ -1,3 +1,26 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package '@tonder.io/rn-sdk' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo Go\n';
8
+
9
+ const RnSdk = NativeModules.RnSdk
10
+ ? NativeModules.RnSdk
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
+
20
+ export function multiply(a: number, b: number): Promise<number> {
21
+ return RnSdk.multiply(a, b);
22
+ }
23
+
1
24
  export * from './ui/components/Input/CardHolderInput';
2
25
  export * from './ui/components/Input/CardExpirationMonthInput';
3
26
  export * from './ui/components/Input/CardExpirationYearInput';
@@ -1,7 +1,6 @@
1
- import type { IApiConfig } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { TONDER_URL_BY_MODE } from '@shared/constants';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { IApiConfig } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { TONDER_URL_BY_MODE, ErrorKeyEnum } from '../shared';
5
4
 
6
5
  export class HttpClient {
7
6
  private readonly baseUrl: string;
@@ -1,5 +1,5 @@
1
- import { HttpClient } from '@infrastructure/HttpClient';
2
- import type { ISDKBaseConfig } from '@types';
1
+ import { HttpClient } from './HttpClient';
2
+ import type { ISDKBaseConfig } from '../types';
3
3
  import {
4
4
  CardService,
5
5
  CheckoutService,
@@ -11,8 +11,7 @@ import {
11
11
  BusinessService,
12
12
  MercadoPagoService,
13
13
  TransactionService,
14
- StorageService,
15
- } from '@services';
14
+ } from '../services';
16
15
 
17
16
  export class ServiceManager {
18
17
  private readonly http: HttpClient;
@@ -26,7 +25,6 @@ export class ServiceManager {
26
25
  readonly token: TokenService;
27
26
  readonly openPay: OpenPayService;
28
27
  readonly mercadoPago: MercadoPagoService;
29
- readonly storage: StorageService;
30
28
  readonly transaction: TransactionService;
31
29
 
32
30
  constructor(config: ISDKBaseConfig) {
@@ -44,7 +42,6 @@ export class ServiceManager {
44
42
  this.token = new TokenService(this.http);
45
43
  this.openPay = new OpenPayService();
46
44
  this.mercadoPago = new MercadoPagoService();
47
- this.storage = new StorageService();
48
45
  this.transaction = new TransactionService(this.http);
49
46
  }
50
47
 
@@ -1,7 +1,7 @@
1
- import type { GetBusinessResponse } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { HttpClient } from '@infrastructure/HttpClient';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { GetBusinessResponse } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { HttpClient } from '../infrastructure';
4
+ import { ErrorKeyEnum } from '../shared';
5
5
 
6
6
  export class BusinessService {
7
7
  private readonly BASE_PATH = '/api/v1/payments/business';
@@ -2,11 +2,10 @@ import type {
2
2
  ICustomerCardsResponse,
3
3
  ISaveCardResponse,
4
4
  ISaveCardSkyflowRequest,
5
- } from '@types';
6
- import TonderError from '@shared/utils/errors';
7
- import { HttpClient } from '@infrastructure/HttpClient';
8
- import { MESSAGES_EN } from '@shared/constants';
9
- import { ErrorKeyEnum } from '@shared/enum';
5
+ } from '../types';
6
+ import TonderError from '../shared/utils/errors';
7
+ import { HttpClient } from '../infrastructure';
8
+ import { MESSAGES_EN, ErrorKeyEnum } from '../shared';
10
9
 
11
10
  export class CardService {
12
11
  private readonly BASE_PATH = '/api/v1/business';
@@ -6,10 +6,10 @@ import type {
6
6
  ICheckoutResponse,
7
7
  ICreatePaymentRequest,
8
8
  ICreateOrderRequest,
9
- } from '@types';
10
- import TonderError from '@shared/utils/errors';
11
- import { HttpClient } from '@infrastructure/HttpClient';
12
- import { ErrorKeyEnum } from '@shared/enum';
9
+ } from '../types';
10
+ import TonderError from '../shared/utils/errors';
11
+ import { HttpClient } from '../infrastructure';
12
+ import { ErrorKeyEnum } from '../shared';
13
13
 
14
14
  export class CheckoutService {
15
15
  private readonly BASE_PATHS = {
@@ -1,7 +1,7 @@
1
- import type { ICustomer, ICustomerResponse } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { HttpClient } from '@infrastructure/HttpClient';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { ICustomer, ICustomerResponse } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { HttpClient } from '../infrastructure';
4
+ import { ErrorKeyEnum } from '../shared';
5
5
 
6
6
  export class CustomerService {
7
7
  private readonly BASE_PATH = '/api/v1/customer/';
@@ -1,7 +1,7 @@
1
- import type { IPaymentMethodResponse } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { HttpClient } from '@infrastructure/HttpClient';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { IPaymentMethodResponse } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { HttpClient } from '../infrastructure';
4
+ import { ErrorKeyEnum } from '../shared';
5
5
 
6
6
  export class PaymentMethodService {
7
7
  private readonly BASE_PATH = '/api/v1/payment_methods';
@@ -1,6 +1,6 @@
1
- import TonderError from '@shared/utils/errors';
2
- import { HttpClient } from '@infrastructure/HttpClient';
3
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import TonderError from '../shared/utils/errors';
2
+ import { HttpClient } from '../infrastructure';
3
+ import { ErrorKeyEnum } from '../shared';
4
4
  import type { IConfig } from 'skyflow-react-native';
5
5
  import { Env, LogLevel } from 'skyflow-react-native';
6
6
 
@@ -1,7 +1,7 @@
1
- import type { IGetSecureTokenResponse } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { HttpClient } from '@infrastructure/HttpClient';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { IGetSecureTokenResponse } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { HttpClient } from '../infrastructure';
4
+ import { ErrorKeyEnum } from '../shared';
5
5
 
6
6
  export class TokenService {
7
7
  private readonly BASE_PATH = '/api/secure-token/';
@@ -1,7 +1,7 @@
1
- import type { ITransaction } from '@types';
2
- import TonderError from '@shared/utils/errors';
3
- import { HttpClient } from '@infrastructure/HttpClient';
4
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import type { ITransaction } from '../types';
2
+ import TonderError from '../shared/utils/errors';
3
+ import { HttpClient } from '../infrastructure';
4
+ import { ErrorKeyEnum } from '../shared';
5
5
 
6
6
  export class TransactionService {
7
7
  private readonly http: HttpClient;
@@ -9,4 +9,3 @@ export * from './PaymentMethodService';
9
9
  export * from './BusinessService';
10
10
  export * from './MercadoPagoService';
11
11
  export * from './TransactionService';
12
- export * from './StorageService';
@@ -1,4 +1,4 @@
1
- import { clearSpace } from '@shared/utils/stringUtils';
1
+ import { clearSpace } from '../utils/stringUtils';
2
2
 
3
3
  const CARD_BRAND_CATALOG: {
4
4
  [key: string]: string;
@@ -1,5 +1,5 @@
1
- import { PAYMENT_METHODS } from '@shared/constants/paymentMethods';
2
- import { clearSpace } from '@shared/utils/stringUtils';
1
+ import { PAYMENT_METHODS } from '../constants/paymentMethods';
2
+ import { clearSpace } from '../utils/stringUtils';
3
3
 
4
4
  const PAYMENT_METHODS_CATALOG: {
5
5
  [key: string]: { label: string; icon: string };
@@ -2,7 +2,7 @@ const TONDER_URL_BY_MODE = Object.freeze({
2
2
  production: 'https://app.tonder.io',
3
3
  sandbox: 'https://sandbox.tonder.io',
4
4
  stage: 'https://stage.tonder.io',
5
- development: 'http://192.168.100.117:8000',
5
+ development: 'http://192.168.68.107:8000',
6
6
  });
7
7
 
8
8
  export { TONDER_URL_BY_MODE };
@@ -1,4 +1,4 @@
1
- import { ErrorKeyEnum } from '@shared/enum';
1
+ import { ErrorKeyEnum } from '../enum';
2
2
 
3
3
  export const MESSAGES_EN = {
4
4
  [ErrorKeyEnum.INIT_ERROR]: 'Error initializing the SDK.',
@@ -1,4 +1,4 @@
1
- import type { IBrowserInfo } from '@types';
1
+ import type { IBrowserInfo } from '../../types';
2
2
 
3
3
  export const getAppInfo = (): IBrowserInfo => {
4
4
  // TODO: IMPLEMENT getAppInfo IBrowserInfo
@@ -1,4 +1,4 @@
1
- import { MESSAGES_EN } from '@shared/constants';
1
+ import { MESSAGES_EN } from '../constants';
2
2
 
3
3
  export interface IParamsTonderError {
4
4
  code: string;
@@ -1,5 +1,5 @@
1
- import { defaultTo, get } from 'lodash';
2
- import { getPaymentMethodDetails } from '@shared/catalog/paymentMethodsCatalog';
1
+ import { getPaymentMethodDetails } from '../catalog/paymentMethodsCatalog';
2
+ import { defaultTo, get } from './stringUtils';
3
3
 
4
4
  export const getPaymentMethodsWithDetails = (response) => {
5
5
  return defaultTo(get(response, 'results'), [])
@@ -1,3 +1,27 @@
1
1
  export const clearSpace = (text: string) => {
2
2
  return text.trim().replace(/\s+/g, '');
3
3
  };
4
+
5
+ const defaultTo = (value, defaultValue) => {
6
+ return value == null || value === undefined ? defaultValue : value;
7
+ };
8
+
9
+
10
+ const get = (object, path, defaultValue = undefined) => {
11
+ if (object == null || object == undefined) return defaultValue;
12
+
13
+ const parts = Array.isArray(path)
14
+ ? path
15
+ : path.split('.').reduce((parts, part) => {
16
+ part.replace(/\[([^\]]+)\]/g, '.$1').split('.').forEach(p => parts.push(p));
17
+ return parts;
18
+ }, []);
19
+
20
+ const result = parts.reduce((obj, key) => {
21
+ return obj != null ? obj[key] : undefined;
22
+ }, object);
23
+
24
+ return result === undefined ? defaultValue : result;
25
+ };
26
+
27
+ export { defaultTo, get };
@@ -1,4 +1,4 @@
1
- import type { StylesBaseVariant } from '@types';
1
+ import type { StylesBaseVariant } from '../../types';
2
2
 
3
3
  const buildBaseStyleText = (style?: StylesBaseVariant) => {
4
4
  return {
package/src/types/base.ts CHANGED
@@ -8,11 +8,11 @@ import type {
8
8
  ILiteCheckoutState,
9
9
  IPaymentInlineContainer,
10
10
  IPaymentLiteContainer,
11
- } from '@types';
12
- import type TonderError from '@shared/utils/errors';
13
- import type PaymentInlineContainer from '@core/PaymentInlineContainer';
14
- import type PaymentLiteContainer from '@core/PaymentLiteContainer';
15
- import type { EnrollmentContainer } from '@core/EnrollmentContainer';
11
+ } from '.';
12
+ import type TonderError from '../shared/utils/errors';
13
+ import type PaymentInlineContainer from '../core/PaymentInlineContainer';
14
+ import type PaymentLiteContainer from '../core/PaymentLiteContainer';
15
+ import type { EnrollmentContainer } from '../core/EnrollmentContainer';
16
16
 
17
17
  export type Environment = 'production' | 'sandbox' | 'stage' | 'development';
18
18
 
@@ -11,10 +11,9 @@ import type {
11
11
  ILiteCustomizationOptions,
12
12
  IProcessPaymentRequest,
13
13
  ITransaction,
14
- } from '@types';
14
+ } from '.';
15
15
  import type { IConfig } from 'skyflow-react-native';
16
- import { SDKType } from '@types';
17
- import type TonderError from '@shared/utils/errors';
16
+ import { SDKType } from './base';
18
17
 
19
18
  export interface IBaseUIState {
20
19
  card?: string;
@@ -4,9 +4,9 @@ import type {
4
4
  ICustomer,
5
5
  ICustomerResponse,
6
6
  IEnrollmentCallbacks,
7
- } from '@types';
7
+ } from '.';
8
8
  import type { IConfig } from 'skyflow-react-native';
9
- import { SDKType } from '@types';
9
+ import { SDKType } from './base';
10
10
 
11
11
  export interface IBaseEnrollmentState extends IBaseState<SDKType.ENROLLMENT> {
12
12
  customer?: ICustomer;
@@ -1,6 +1,6 @@
1
- import type { Business, IBaseState, ICustomerResponse } from '@types';
1
+ import type { Business, IBaseState, ICustomerResponse } from '.';
2
2
  import type { IConfig } from 'skyflow-react-native';
3
- import { SDKType } from '@types';
3
+ import { SDKType } from './base';
4
4
 
5
5
  export interface IBaseSDKState<T extends SDKType> extends IBaseState<T> {
6
6
  customerData?: ICustomerResponse;
@@ -1,4 +1,4 @@
1
- import type { IUIWrapper } from '@ui/providers/TonderProvider/uiWrapper';
1
+ import type { IUIWrapper } from '../ui/providers/TonderProvider/uiWrapper';
2
2
  import type { Environment, SDKInstance } from './base';
3
3
  import type { IElementStyle } from './input';
4
4
  import { SDKType } from './base';
@@ -4,7 +4,7 @@ import { SDKType } from './base';
4
4
  import type { ISaveCardResponse } from './card';
5
5
  import type { IFormLabels, IFormPlaceholder, IStyles } from './common';
6
6
  import type { ICustomer } from './customer';
7
- import TonderError from '@shared/utils/errors';
7
+ import TonderError from '../shared/utils/errors';
8
8
 
9
9
  export interface IEnrollmentOptions extends IBaseCreateOptions {
10
10
  customer?: ICustomer;
@@ -11,9 +11,9 @@ import type {
11
11
  IBaseProcessPaymentRequest,
12
12
  IBaseCallback,
13
13
  IBaseResponse,
14
- } from '@tonder.io/rn-sdk';
15
- import { SDKType } from '@tonder.io/rn-sdk';
16
- import TonderError from '@shared/utils/errors';
14
+ } from '.';
15
+ import { SDKType } from './base';
16
+ import TonderError from '../shared/utils/errors';
17
17
 
18
18
  export interface IInlineCheckoutOptions extends IBaseCreateOptions {
19
19
  paymentData: IBaseProcessPaymentRequest;
@@ -10,9 +10,9 @@ import type {
10
10
  IBaseCallback,
11
11
  IInlineCallbacks,
12
12
  IBaseResponse,
13
- } from '@types';
14
- import { SDKType } from '@types';
15
- import TonderError from '@shared/utils/errors';
13
+ } from '.';
14
+ import { SDKType } from './base';
15
+ import TonderError from '../shared/utils/errors';
16
16
 
17
17
  export interface ILiteCheckoutOptions extends IBaseCreateOptions {
18
18
  paymentData: IProcessPaymentRequest;
@@ -1,5 +1,5 @@
1
1
  declare module 'skyflow-react-native' {
2
- import type { StylesBaseVariant } from '@tonder.io/rn-sdk';
2
+ import type { StylesBaseVariant } from '../types';
3
3
  export type IConfig = {
4
4
  vaultID: string;
5
5
  vaultURL: string;
@@ -1,5 +1,5 @@
1
- import type { ICheckoutResponse, ITransaction } from '@tonder.io/rn-sdk';
2
- import type TonderError from '@shared/utils/errors';
1
+ import type { ICheckoutResponse, ITransaction } from '.';
2
+ import type TonderError from '../shared/utils/errors';
3
3
 
4
4
  export interface IThreeDSHandler {
5
5
  verifyTransaction(): Promise<ITransaction>;
@@ -5,8 +5,8 @@ import {
5
5
  ActivityIndicator,
6
6
  StyleSheet,
7
7
  } from 'react-native';
8
- import type { StylesBaseVariant } from '@types';
9
- import { buildBaseStyleText } from '@shared/utils/styleUtils';
8
+ import type { StylesBaseVariant } from '../../../types';
9
+ import { buildBaseStyleText } from '../../../shared/utils/styleUtils';
10
10
 
11
11
  interface PayButtonProps {
12
12
  text: string;