@spreeloop/orange_money 1.0.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 (333) hide show
  1. package/.eslintrc.js +47 -0
  2. package/.prettierrc +6 -0
  3. package/README.md +192 -0
  4. package/babel.config.js +3 -0
  5. package/dist/logging/index.d.ts +2 -0
  6. package/dist/logging/index.d.ts.map +1 -0
  7. package/dist/logging/index.js +18 -0
  8. package/dist/logging/index.js.map +1 -0
  9. package/dist/logging/src/log_level.d.ts +24 -0
  10. package/dist/logging/src/log_level.d.ts.map +1 -0
  11. package/dist/logging/src/log_level.js +34 -0
  12. package/dist/logging/src/log_level.js.map +1 -0
  13. package/dist/logging/src/logging.d.ts +50 -0
  14. package/dist/logging/src/logging.d.ts.map +1 -0
  15. package/dist/logging/src/logging.js +87 -0
  16. package/dist/logging/src/logging.js.map +1 -0
  17. package/dist/logging/src/printer.d.ts +10 -0
  18. package/dist/logging/src/printer.d.ts.map +1 -0
  19. package/dist/logging/src/printer.js +3 -0
  20. package/dist/logging/src/printer.js.map +1 -0
  21. package/dist/main.js +3 -0
  22. package/dist/main.js.LICENSE.txt +1 -0
  23. package/dist/main.js.map +1 -0
  24. package/dist/orange_money/index.d.ts +2 -0
  25. package/dist/orange_money/index.d.ts.map +1 -0
  26. package/dist/orange_money/index.js +18 -0
  27. package/dist/orange_money/index.js.map +1 -0
  28. package/dist/orange_money/src/common/utils/https.d.ts +77 -0
  29. package/dist/orange_money/src/common/utils/https.d.ts.map +1 -0
  30. package/dist/orange_money/src/common/utils/https.js +240 -0
  31. package/dist/orange_money/src/common/utils/https.js.map +1 -0
  32. package/dist/orange_money/src/common/utils/https.spec.d.ts +2 -0
  33. package/dist/orange_money/src/common/utils/https.spec.d.ts.map +1 -0
  34. package/dist/orange_money/src/common/utils/https.spec.js +77 -0
  35. package/dist/orange_money/src/common/utils/https.spec.js.map +1 -0
  36. package/dist/orange_money/src/common/utils/logging_interface.d.ts +23 -0
  37. package/dist/orange_money/src/common/utils/logging_interface.d.ts.map +1 -0
  38. package/dist/orange_money/src/common/utils/logging_interface.js +3 -0
  39. package/dist/orange_money/src/common/utils/logging_interface.js.map +1 -0
  40. package/dist/orange_money/src/common/utils/operation_response.d.ts +16 -0
  41. package/dist/orange_money/src/common/utils/operation_response.d.ts.map +1 -0
  42. package/dist/orange_money/src/common/utils/operation_response.js +3 -0
  43. package/dist/orange_money/src/common/utils/operation_response.js.map +1 -0
  44. package/dist/orange_money/src/common/utils/utils.d.ts +6 -0
  45. package/dist/orange_money/src/common/utils/utils.d.ts.map +1 -0
  46. package/dist/orange_money/src/common/utils/utils.js +10 -0
  47. package/dist/orange_money/src/common/utils/utils.js.map +1 -0
  48. package/dist/orange_money/src/constants.d.ts +95 -0
  49. package/dist/orange_money/src/constants.d.ts.map +1 -0
  50. package/dist/orange_money/src/constants.js +111 -0
  51. package/dist/orange_money/src/constants.js.map +1 -0
  52. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts +63 -0
  53. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts.map +1 -0
  54. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js +84 -0
  55. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js.map +1 -0
  56. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts +40 -0
  57. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts.map +1 -0
  58. package/dist/orange_money/src/disbursements/implementations/src/live.js +61 -0
  59. package/dist/orange_money/src/disbursements/implementations/src/live.js.map +1 -0
  60. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts +40 -0
  61. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts.map +1 -0
  62. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js +110 -0
  63. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js.map +1 -0
  64. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts +28 -0
  65. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts.map +1 -0
  66. package/dist/orange_money/src/disbursements/operations/create_access_token.js +45 -0
  67. package/dist/orange_money/src/disbursements/operations/create_access_token.js.map +1 -0
  68. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts +2 -0
  69. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts.map +1 -0
  70. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js +106 -0
  71. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js.map +1 -0
  72. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts +114 -0
  73. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts.map +1 -0
  74. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js +128 -0
  75. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js.map +1 -0
  76. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts +2 -0
  77. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts.map +1 -0
  78. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js +148 -0
  79. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js.map +1 -0
  80. package/dist/orange_money/src/disbursements/operations/transfer.d.ts +45 -0
  81. package/dist/orange_money/src/disbursements/operations/transfer.d.ts.map +1 -0
  82. package/dist/orange_money/src/disbursements/operations/transfer.js +74 -0
  83. package/dist/orange_money/src/disbursements/operations/transfer.js.map +1 -0
  84. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts +2 -0
  85. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts.map +1 -0
  86. package/dist/orange_money/src/disbursements/operations/transfer.spec.js +178 -0
  87. package/dist/orange_money/src/disbursements/operations/transfer.spec.js.map +1 -0
  88. package/dist/orange_money/src/disbursements/routes/routes.d.ts +38 -0
  89. package/dist/orange_money/src/disbursements/routes/routes.d.ts.map +1 -0
  90. package/dist/orange_money/src/disbursements/routes/routes.js +53 -0
  91. package/dist/orange_money/src/disbursements/routes/routes.js.map +1 -0
  92. package/dist/orange_money/src/disbursements/utils/constants.d.ts +5 -0
  93. package/dist/orange_money/src/disbursements/utils/constants.d.ts.map +1 -0
  94. package/dist/orange_money/src/disbursements/utils/constants.js +9 -0
  95. package/dist/orange_money/src/disbursements/utils/constants.js.map +1 -0
  96. package/dist/orange_money/src/disbursements/utils/https.d.ts +74 -0
  97. package/dist/orange_money/src/disbursements/utils/https.d.ts.map +1 -0
  98. package/dist/orange_money/src/disbursements/utils/https.js +206 -0
  99. package/dist/orange_money/src/disbursements/utils/https.js.map +1 -0
  100. package/dist/orange_money/src/disbursements/utils/https.spec.d.ts +2 -0
  101. package/dist/orange_money/src/disbursements/utils/https.spec.d.ts.map +1 -0
  102. package/dist/orange_money/src/disbursements/utils/https.spec.js +77 -0
  103. package/dist/orange_money/src/disbursements/utils/https.spec.js.map +1 -0
  104. package/dist/orange_money/src/disbursements/utils/regex.d.ts +9 -0
  105. package/dist/orange_money/src/disbursements/utils/regex.d.ts.map +1 -0
  106. package/dist/orange_money/src/disbursements/utils/regex.js +12 -0
  107. package/dist/orange_money/src/disbursements/utils/regex.js.map +1 -0
  108. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts +2 -0
  109. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts.map +1 -0
  110. package/dist/orange_money/src/disbursements/utils/regex.spec.js +32 -0
  111. package/dist/orange_money/src/disbursements/utils/regex.spec.js.map +1 -0
  112. package/dist/orange_money/src/disbursements/utils/status.d.ts +53 -0
  113. package/dist/orange_money/src/disbursements/utils/status.d.ts.map +1 -0
  114. package/dist/orange_money/src/disbursements/utils/status.js +58 -0
  115. package/dist/orange_money/src/disbursements/utils/status.js.map +1 -0
  116. package/dist/orange_money/src/disbursements/utils/utils.d.ts +9 -0
  117. package/dist/orange_money/src/disbursements/utils/utils.d.ts.map +1 -0
  118. package/dist/orange_money/src/disbursements/utils/utils.js +26 -0
  119. package/dist/orange_money/src/disbursements/utils/utils.js.map +1 -0
  120. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts +2 -0
  121. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts.map +1 -0
  122. package/dist/orange_money/src/disbursements/utils/utils.spec.js +43 -0
  123. package/dist/orange_money/src/disbursements/utils/utils.spec.js.map +1 -0
  124. package/dist/orange_money/src/index.d.ts +8 -0
  125. package/dist/orange_money/src/index.d.ts.map +1 -0
  126. package/dist/orange_money/src/index.js +21 -0
  127. package/dist/orange_money/src/index.js.map +1 -0
  128. package/dist/orange_money/src/orange_money/orange_money.d.ts +58 -0
  129. package/dist/orange_money/src/orange_money/orange_money.d.ts.map +1 -0
  130. package/dist/orange_money/src/orange_money/orange_money.js +33 -0
  131. package/dist/orange_money/src/orange_money/orange_money.js.map +1 -0
  132. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.d.ts +7 -0
  133. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.d.ts.map +1 -0
  134. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.js +16 -0
  135. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.js.map +1 -0
  136. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.d.ts +29 -0
  137. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.d.ts.map +1 -0
  138. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.js +67 -0
  139. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.js.map +1 -0
  140. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.d.ts +2 -0
  141. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.d.ts.map +1 -0
  142. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.js +51 -0
  143. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.js.map +1 -0
  144. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.d.ts +105 -0
  145. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.d.ts.map +1 -0
  146. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.js +459 -0
  147. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.js.map +1 -0
  148. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.d.ts +2 -0
  149. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.d.ts.map +1 -0
  150. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.js +497 -0
  151. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.js.map +1 -0
  152. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.d.ts +26 -0
  153. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.d.ts.map +1 -0
  154. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.js +26 -0
  155. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.js.map +1 -0
  156. package/dist/orange_money/src/payments/implementations/fake.d.ts +33 -0
  157. package/dist/orange_money/src/payments/implementations/fake.d.ts.map +1 -0
  158. package/dist/orange_money/src/payments/implementations/fake.js +110 -0
  159. package/dist/orange_money/src/payments/implementations/fake.js.map +1 -0
  160. package/dist/orange_money/src/payments/implementations/live.d.ts +45 -0
  161. package/dist/orange_money/src/payments/implementations/live.d.ts.map +1 -0
  162. package/dist/orange_money/src/payments/implementations/live.js +69 -0
  163. package/dist/orange_money/src/payments/implementations/live.js.map +1 -0
  164. package/dist/orange_money/src/payments/implementations/payment_service.d.ts +44 -0
  165. package/dist/orange_money/src/payments/implementations/payment_service.d.ts.map +1 -0
  166. package/dist/orange_money/src/payments/implementations/payment_service.js +44 -0
  167. package/dist/orange_money/src/payments/implementations/payment_service.js.map +1 -0
  168. package/dist/orange_money/src/payments/implementations/src/fake.d.ts +31 -0
  169. package/dist/orange_money/src/payments/implementations/src/fake.d.ts.map +1 -0
  170. package/dist/orange_money/src/payments/implementations/src/fake.js +62 -0
  171. package/dist/orange_money/src/payments/implementations/src/fake.js.map +1 -0
  172. package/dist/orange_money/src/payments/implementations/src/live.d.ts +29 -0
  173. package/dist/orange_money/src/payments/implementations/src/live.d.ts.map +1 -0
  174. package/dist/orange_money/src/payments/implementations/src/live.js +44 -0
  175. package/dist/orange_money/src/payments/implementations/src/live.js.map +1 -0
  176. package/dist/orange_money/src/payments/operations/create_access_token.d.ts +19 -0
  177. package/dist/orange_money/src/payments/operations/create_access_token.d.ts.map +1 -0
  178. package/dist/orange_money/src/payments/operations/create_access_token.js +51 -0
  179. package/dist/orange_money/src/payments/operations/create_access_token.js.map +1 -0
  180. package/dist/orange_money/src/payments/operations/create_access_token.spec.d.ts +2 -0
  181. package/dist/orange_money/src/payments/operations/create_access_token.spec.d.ts.map +1 -0
  182. package/dist/orange_money/src/payments/operations/create_access_token.spec.js +70 -0
  183. package/dist/orange_money/src/payments/operations/create_access_token.spec.js.map +1 -0
  184. package/dist/orange_money/src/payments/operations/create_pay_token.d.ts +12 -0
  185. package/dist/orange_money/src/payments/operations/create_pay_token.d.ts.map +1 -0
  186. package/dist/orange_money/src/payments/operations/create_pay_token.js +62 -0
  187. package/dist/orange_money/src/payments/operations/create_pay_token.js.map +1 -0
  188. package/dist/orange_money/src/payments/operations/create_pay_token.spec.d.ts +2 -0
  189. package/dist/orange_money/src/payments/operations/create_pay_token.spec.d.ts.map +1 -0
  190. package/dist/orange_money/src/payments/operations/create_pay_token.spec.js +91 -0
  191. package/dist/orange_money/src/payments/operations/create_pay_token.spec.js.map +1 -0
  192. package/dist/orange_money/src/payments/operations/get_access_token.d.ts +11 -0
  193. package/dist/orange_money/src/payments/operations/get_access_token.d.ts.map +1 -0
  194. package/dist/orange_money/src/payments/operations/get_access_token.js +47 -0
  195. package/dist/orange_money/src/payments/operations/get_access_token.js.map +1 -0
  196. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts +2 -0
  197. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts.map +1 -0
  198. package/dist/orange_money/src/payments/operations/get_access_token.spec.js +75 -0
  199. package/dist/orange_money/src/payments/operations/get_access_token.spec.js.map +1 -0
  200. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts +12 -0
  201. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts.map +1 -0
  202. package/dist/orange_money/src/payments/operations/get_pay_token.js +43 -0
  203. package/dist/orange_money/src/payments/operations/get_pay_token.js.map +1 -0
  204. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts +2 -0
  205. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts.map +1 -0
  206. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js +75 -0
  207. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js.map +1 -0
  208. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts +23 -0
  209. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts.map +1 -0
  210. package/dist/orange_money/src/payments/operations/get_payment_status.js +51 -0
  211. package/dist/orange_money/src/payments/operations/get_payment_status.js.map +1 -0
  212. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts +2 -0
  213. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts.map +1 -0
  214. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js +102 -0
  215. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js.map +1 -0
  216. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts +22 -0
  217. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts.map +1 -0
  218. package/dist/orange_money/src/payments/operations/initialize_om_payment.js +124 -0
  219. package/dist/orange_money/src/payments/operations/initialize_om_payment.js.map +1 -0
  220. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts +2 -0
  221. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts.map +1 -0
  222. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js +246 -0
  223. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js.map +1 -0
  224. package/dist/orange_money/src/payments/operations/payment.d.ts +21 -0
  225. package/dist/orange_money/src/payments/operations/payment.d.ts.map +1 -0
  226. package/dist/orange_money/src/payments/operations/payment.js +204 -0
  227. package/dist/orange_money/src/payments/operations/payment.js.map +1 -0
  228. package/dist/orange_money/src/payments/operations/payment.spec.d.ts +2 -0
  229. package/dist/orange_money/src/payments/operations/payment.spec.d.ts.map +1 -0
  230. package/dist/orange_money/src/payments/operations/payment.spec.js +282 -0
  231. package/dist/orange_money/src/payments/operations/payment.spec.js.map +1 -0
  232. package/dist/orange_money/src/payments/payments.d.ts +57 -0
  233. package/dist/orange_money/src/payments/payments.d.ts.map +1 -0
  234. package/dist/orange_money/src/payments/payments.js +36 -0
  235. package/dist/orange_money/src/payments/payments.js.map +1 -0
  236. package/dist/orange_money/src/payments/routes/routes.d.ts +48 -0
  237. package/dist/orange_money/src/payments/routes/routes.d.ts.map +1 -0
  238. package/dist/orange_money/src/payments/routes/routes.js +61 -0
  239. package/dist/orange_money/src/payments/routes/routes.js.map +1 -0
  240. package/dist/orange_money/src/payments/utils/constants.d.ts +100 -0
  241. package/dist/orange_money/src/payments/utils/constants.d.ts.map +1 -0
  242. package/dist/orange_money/src/payments/utils/constants.js +117 -0
  243. package/dist/orange_money/src/payments/utils/constants.js.map +1 -0
  244. package/dist/orange_money/src/payments/utils/https.d.ts +43 -0
  245. package/dist/orange_money/src/payments/utils/https.d.ts.map +1 -0
  246. package/dist/orange_money/src/payments/utils/https.js +137 -0
  247. package/dist/orange_money/src/payments/utils/https.js.map +1 -0
  248. package/dist/orange_money/src/payments/utils/joi_schema.d.ts +71 -0
  249. package/dist/orange_money/src/payments/utils/joi_schema.d.ts.map +1 -0
  250. package/dist/orange_money/src/payments/utils/joi_schema.js +44 -0
  251. package/dist/orange_money/src/payments/utils/joi_schema.js.map +1 -0
  252. package/dist/orange_money/src/payments/utils/logging_interface.d.ts +23 -0
  253. package/dist/orange_money/src/payments/utils/logging_interface.d.ts.map +1 -0
  254. package/dist/orange_money/src/payments/utils/logging_interface.js +3 -0
  255. package/dist/orange_money/src/payments/utils/logging_interface.js.map +1 -0
  256. package/dist/orange_money/src/payments/utils/request_model.d.ts +75 -0
  257. package/dist/orange_money/src/payments/utils/request_model.d.ts.map +1 -0
  258. package/dist/orange_money/src/payments/utils/request_model.js +3 -0
  259. package/dist/orange_money/src/payments/utils/request_model.js.map +1 -0
  260. package/dist/orange_money/src/payments/utils/utils.d.ts +15 -0
  261. package/dist/orange_money/src/payments/utils/utils.d.ts.map +1 -0
  262. package/dist/orange_money/src/payments/utils/utils.js +27 -0
  263. package/dist/orange_money/src/payments/utils/utils.js.map +1 -0
  264. package/dist/orange_money/src/payments/utils/utils.spec.d.ts +2 -0
  265. package/dist/orange_money/src/payments/utils/utils.spec.d.ts.map +1 -0
  266. package/dist/orange_money/src/payments/utils/utils.spec.js +17 -0
  267. package/dist/orange_money/src/payments/utils/utils.spec.js.map +1 -0
  268. package/dist/orange_money/src/utils/logging_interface.d.ts +23 -0
  269. package/dist/orange_money/src/utils/logging_interface.d.ts.map +1 -0
  270. package/dist/orange_money/src/utils/logging_interface.js +3 -0
  271. package/dist/orange_money/src/utils/logging_interface.js.map +1 -0
  272. package/dist/orange_money/src/utils/requests_responses.d.ts +118 -0
  273. package/dist/orange_money/src/utils/requests_responses.d.ts.map +1 -0
  274. package/dist/orange_money/src/utils/requests_responses.js +31 -0
  275. package/dist/orange_money/src/utils/requests_responses.js.map +1 -0
  276. package/dist/orange_money/src/utils/resquest_params.d.ts +222 -0
  277. package/dist/orange_money/src/utils/resquest_params.d.ts.map +1 -0
  278. package/dist/orange_money/src/utils/resquest_params.js +57 -0
  279. package/dist/orange_money/src/utils/resquest_params.js.map +1 -0
  280. package/dist/orange_money/src/utils/utils.d.ts +65 -0
  281. package/dist/orange_money/src/utils/utils.d.ts.map +1 -0
  282. package/dist/orange_money/src/utils/utils.js +199 -0
  283. package/dist/orange_money/src/utils/utils.js.map +1 -0
  284. package/dist/orange_money/src/utils/utils.spec.d.ts +2 -0
  285. package/dist/orange_money/src/utils/utils.spec.d.ts.map +1 -0
  286. package/dist/orange_money/src/utils/utils.spec.js +17 -0
  287. package/dist/orange_money/src/utils/utils.spec.js.map +1 -0
  288. package/index.spec.ts +9 -0
  289. package/index.ts +1 -0
  290. package/jest.before-test.ts +3 -0
  291. package/jest.config.ts +54 -0
  292. package/package.json +52 -0
  293. package/src/disbursements/implementations/disbursement_service.ts +133 -0
  294. package/src/disbursements/implementations/src/live.ts +79 -0
  295. package/src/disbursements/implementations/src/sandbox.ts +124 -0
  296. package/src/disbursements/operations/create_access_token.spec.ts +87 -0
  297. package/src/disbursements/operations/create_access_token.ts +83 -0
  298. package/src/disbursements/operations/get_transfer_status.spec.ts +132 -0
  299. package/src/disbursements/operations/get_transfer_status.ts +265 -0
  300. package/src/disbursements/operations/transfer.spec.ts +158 -0
  301. package/src/disbursements/operations/transfer.ts +125 -0
  302. package/src/disbursements/routes/routes.ts +54 -0
  303. package/src/disbursements/utils/constants.ts +4 -0
  304. package/src/disbursements/utils/regex.spec.ts +39 -0
  305. package/src/disbursements/utils/regex.ts +10 -0
  306. package/src/disbursements/utils/status.ts +62 -0
  307. package/src/disbursements/utils/utils.spec.ts +42 -0
  308. package/src/disbursements/utils/utils.ts +24 -0
  309. package/src/index.ts +9 -0
  310. package/src/payments/implementations/fake.ts +133 -0
  311. package/src/payments/implementations/live.ts +87 -0
  312. package/src/payments/operations/get_access_token.spec.ts +60 -0
  313. package/src/payments/operations/get_access_token.ts +77 -0
  314. package/src/payments/operations/get_pay_token.spec.ts +65 -0
  315. package/src/payments/operations/get_pay_token.ts +66 -0
  316. package/src/payments/operations/get_payment_status.spec.ts +82 -0
  317. package/src/payments/operations/get_payment_status.ts +78 -0
  318. package/src/payments/operations/initialize_om_payment.spec.ts +234 -0
  319. package/src/payments/operations/initialize_om_payment.ts +191 -0
  320. package/src/payments/payments.ts +86 -0
  321. package/src/payments/routes/routes.ts +61 -0
  322. package/src/payments/utils/constants.ts +120 -0
  323. package/src/payments/utils/joi_schema.ts +117 -0
  324. package/src/payments/utils/request_model.ts +103 -0
  325. package/src/payments/utils/utils.ts +31 -0
  326. package/src/utils/https.spec.ts +101 -0
  327. package/src/utils/https.ts +266 -0
  328. package/src/utils/logging_interface.ts +25 -0
  329. package/src/utils/operation_response.ts +17 -0
  330. package/src/utils/utils.ts +5 -0
  331. package/tsconfig.build.json +4 -0
  332. package/tsconfig.dev.json +4 -0
  333. package/tsconfig.json +27 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joi_schema.js","sourceRoot":"","sources":["../../../../../src/payments/utils/joi_schema.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAGtB,2CAAuD;AA0BvD;;;GAGG;AACU,QAAA,4BAA4B,GACvC,aAAG,CAAC,MAAM,CAA6B;IACrC,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,aAAG,CAAC,MAAM,CAAC;QACf,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACzC,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,cAAc,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7D,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE;aACjB,KAAK,CACJ,oCAAwB,CAAC,cAAc,EACvC,oCAAwB,CAAC,eAAe,EACxC,oCAAwB,CAAC,iBAAiB,EAC1C,oCAAwB,CAAC,eAAe,EACxC,oCAAwB,CAAC,0BAA0B,CACpD;aACA,QAAQ,EAAE;QACb,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC3C,CAAC;SACC,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;CACjB,CAAC,CAAC;AAcQ,QAAA,qBAAqB,GAAG,aAAG,CAAC,MAAM,CAAwB;IACrE,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;SAC3B,QAAQ,EAAE;SACV,OAAO,CAAC,2BAA2B,CAAC;SACpC,OAAO,CACN,8FAA8F,CAC/F;IACH,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE;SAC5B,QAAQ,EAAE;SACV,OAAO,CAAC,2BAA2B,CAAC;SACpC,OAAO,CACN,+FAA+F,CAChG;IACH,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5C,kBAAkB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/D,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface LoggerInterface {
2
+ /**
3
+ * Logs a debug level message.
4
+ * @param {string[]} args
5
+ */
6
+ log(...args: string[]): void;
7
+ /**
8
+ * Logs an info level message.
9
+ * @param {string[]} args
10
+ */
11
+ info(...args: string[]): void;
12
+ /**
13
+ * Logs a waning level message.
14
+ * @param {string[]} args
15
+ */
16
+ warn(...args: string[]): void;
17
+ /**
18
+ * Logs an error level message.
19
+ * @param {string[]} args
20
+ */
21
+ error(...args: string[]): void;
22
+ }
23
+ //# sourceMappingURL=logging_interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging_interface.d.ts","sourceRoot":"","sources":["../../../../../src/payments/utils/logging_interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=logging_interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging_interface.js","sourceRoot":"","sources":["../../../../../src/payments/utils/logging_interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ import { OperationResponse } from '../../common/utils/operation_response';
2
+ import { ApiErrorType, OrangeMoneyPaymentStatus } from './constants';
3
+ import { AccessTokenRequestResponse, GenericRequestResponseData, PayTokenRequestResponse } from './joi_schema';
4
+ export declare type InitializeOrangeMoneyRequest = {
5
+ /**
6
+ * The phone number of the user making the payment.
7
+ */
8
+ subscriberNumber: string;
9
+ /**
10
+ * The phone number of the user receiving the payment.
11
+ */
12
+ channelUserNumber: string;
13
+ /**
14
+ * Unique identifier of the customer transaction.
15
+ */
16
+ transactionId: string;
17
+ /**
18
+ * The amount of the transaction.
19
+ */
20
+ amount: number;
21
+ /**
22
+ * The Pin code of the ChannelUser.
23
+ */
24
+ pinCode: string;
25
+ /**
26
+ * An http endpoint able to receive a post request with the following json body.
27
+ * {
28
+ * ”payToken” : ”payToken”,
29
+ * ”status” : status”,
30
+ * ”message” : ”message”
31
+ * }
32
+ */
33
+ notifUrl?: string;
34
+ /**
35
+ * The payment description.
36
+ */
37
+ description?: string;
38
+ /**
39
+ * The payToken value useful to make payment
40
+ * and track the status of payment.
41
+ */
42
+ payToken: string;
43
+ /**
44
+ * The access token for authorize the request.
45
+ */
46
+ accessToken: string;
47
+ };
48
+ export declare type GetOrangeMoneyPaymentRequest = {
49
+ /**
50
+ * The access token for authorize the request.
51
+ */
52
+ accessToken: string;
53
+ /**
54
+ * unique identifier used to obtain payment status.
55
+ */
56
+ payToken: string;
57
+ };
58
+ /**
59
+ * This response is obtained when we initiate a mobile payment request,
60
+ * the request would generate a payToken useful to make payment
61
+ * and track the status of payment.
62
+ */
63
+ export declare type InitializeOrangeMoneyResponse = OperationResponse<{
64
+ /**
65
+ * The payToken value useful to make payment
66
+ * and track the status of payment.
67
+ */
68
+ payToken: string;
69
+ }, GenericRequestResponseData, ApiErrorType>;
70
+ export declare type GetOrangeMoneyPaymentResponse = OperationResponse<{
71
+ status: OrangeMoneyPaymentStatus;
72
+ }, GenericRequestResponseData, ApiErrorType>;
73
+ export declare type GetAccessTokenResponse = OperationResponse<string, AccessTokenRequestResponse | undefined, ApiErrorType>;
74
+ export declare type GetPayTokenResponse = OperationResponse<string, PayTokenRequestResponse | undefined, ApiErrorType>;
75
+ //# sourceMappingURL=request_model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request_model.d.ts","sourceRoot":"","sources":["../../../../../src/payments/utils/request_model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAEtB,oBAAY,4BAA4B,GAAG;IACzC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,6BAA6B,GAAG,iBAAiB,CAC3D;IACE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,EACD,0BAA0B,EAC1B,YAAY,CACb,CAAC;AAEF,oBAAY,6BAA6B,GAAG,iBAAiB,CAC3D;IACE,MAAM,EAAE,wBAAwB,CAAC;CAClC,EACD,0BAA0B,EAC1B,YAAY,CACb,CAAC;AAEF,oBAAY,sBAAsB,GAAG,iBAAiB,CACpD,MAAM,EACN,0BAA0B,GAAG,SAAS,EACtC,YAAY,CACb,CAAC;AAEF,oBAAY,mBAAmB,GAAG,iBAAiB,CACjD,MAAM,EACN,uBAAuB,GAAG,SAAS,EACnC,YAAY,CACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request_model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request_model.js","sourceRoot":"","sources":["../../../../../src/payments/utils/request_model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import Joi from 'joi';
2
+ /**
3
+ * Checks if the data is valid type.
4
+ * @param {Record<string, unknown>} data .
5
+ * @param {Joi.PartialSchemaMap<T>} schema .
6
+ * @return {Record<string, unknown>}
7
+ */
8
+ export declare function validateData<T>(data: unknown, schema: Joi.ObjectSchema<T>): {
9
+ isValidData: true;
10
+ data: T;
11
+ } | {
12
+ isValidData: false;
13
+ message: string;
14
+ };
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/payments/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAC1B;IAAE,WAAW,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAmB1E"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateData = void 0;
4
+ /**
5
+ * Checks if the data is valid type.
6
+ * @param {Record<string, unknown>} data .
7
+ * @param {Joi.PartialSchemaMap<T>} schema .
8
+ * @return {Record<string, unknown>}
9
+ */
10
+ function validateData(data, schema) {
11
+ const { error, value } = schema.unknown(true).validate(data, {
12
+ abortEarly: false,
13
+ convert: false,
14
+ });
15
+ if (error) {
16
+ return {
17
+ isValidData: false,
18
+ message: JSON.stringify(error.details.map((e) => e.message), null, ' '),
19
+ };
20
+ }
21
+ return {
22
+ isValidData: true,
23
+ data: value,
24
+ };
25
+ }
26
+ exports.validateData = validateData;
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/payments/utils/utils.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,IAAa,EACb,MAA2B;IAE3B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC3D,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IACH,IAAI,KAAK,EAAE;QACT,OAAO;YACL,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,IAAI,CAAC,SAAS,CACrB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EACnC,IAAI,EACJ,GAAG,CACJ;SACF,CAAC;KACH;IACD,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,KAAK;KACZ,CAAC;AACJ,CAAC;AAtBD,oCAsBC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.spec.d.ts","sourceRoot":"","sources":["../../../../../src/payments/utils/utils.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("./utils");
4
+ describe('Test the utils function', () => {
5
+ it('Generate the base 64 encoding', async () => {
6
+ const value = (0, utils_1.encodeToBase64)('123', '123');
7
+ expect(value).toEqual('MTIzOjEyMw');
8
+ });
9
+ it('encode the body request', async () => {
10
+ const body = {
11
+ amount: '123',
12
+ };
13
+ const value = (0, utils_1.encodeTheBodyOfRequest)(body);
14
+ expect(value).toEqual('amount=123');
15
+ });
16
+ });
17
+ //# sourceMappingURL=utils.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../../../../src/payments/utils/utils.spec.ts"],"names":[],"mappings":";;AAAA,mCAAiE;AAEjE,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,KAAK,GAAG,IAAA,sBAAc,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,IAAI,GAAG;YACX,MAAM,EAAE,KAAK;SACd,CAAC;QACF,MAAM,KAAK,GAAG,IAAA,8BAAsB,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface LoggerInterface {
2
+ /**
3
+ * Logs a debug level message.
4
+ * @param {string[]} args
5
+ */
6
+ log(...args: string[]): void;
7
+ /**
8
+ * Logs an info level message.
9
+ * @param {string[]} args
10
+ */
11
+ info(...args: string[]): void;
12
+ /**
13
+ * Logs a waning level message.
14
+ * @param {string[]} args
15
+ */
16
+ warn(...args: string[]): void;
17
+ /**
18
+ * Logs an error level message.
19
+ * @param {string[]} args
20
+ */
21
+ error(...args: string[]): void;
22
+ }
23
+ //# sourceMappingURL=logging_interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging_interface.d.ts","sourceRoot":"","sources":["../../../../src/utils/logging_interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=logging_interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging_interface.js","sourceRoot":"","sources":["../../../../src/utils/logging_interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,118 @@
1
+ import Joi from 'joi';
2
+ import { OrangeMoneyErrorType, OrangePaymentStatus } from '../constants';
3
+ export declare type ProviderPaymentRequestResponse = {
4
+ message: string;
5
+ data: {
6
+ id: number;
7
+ createtime: string;
8
+ subscriberMsisdn: null | string;
9
+ amount: number;
10
+ payToken: string;
11
+ txnid: string;
12
+ txnmode: string;
13
+ inittxnmessage: string;
14
+ inittxnstatus: string;
15
+ confirmtxnstatus: string | null;
16
+ confirmtxnmessage: string | null;
17
+ status: OrangePaymentStatus;
18
+ notifUrl: string;
19
+ description: string;
20
+ channelUserMsisdn: string;
21
+ };
22
+ };
23
+ export declare const providerPaymentRequestResponseSchema: {
24
+ message: Joi.StringSchema<string>;
25
+ data: Joi.ObjectSchema<any>;
26
+ };
27
+ export declare type ProviderAccessTokenRequestResponse = {
28
+ access_token: string;
29
+ scope: string;
30
+ token_type: string;
31
+ expires_in: number;
32
+ };
33
+ export declare type ProviderPayTokenRequestResponse = {
34
+ message: string;
35
+ data: {
36
+ payToken: string;
37
+ };
38
+ };
39
+ /**
40
+ * The record return when the function failed.
41
+ */
42
+ export declare type ErrorResponse = {
43
+ message: string;
44
+ status: number;
45
+ data: unknown;
46
+ };
47
+ /**
48
+ * [AccessTokenResponse],Returns response values when
49
+ * the token is generated successfully.
50
+ */
51
+ export declare type AccessTokenResponse = {
52
+ /**
53
+ * The access tokens.
54
+ */
55
+ accessToken: string;
56
+ };
57
+ /**
58
+ * This response is obtained when we initiate a mobile payment request,
59
+ * the request would generate a payToken useful to make payment
60
+ * and track the status of payment.
61
+ */
62
+ export declare type PaymentInitializationResponse = {
63
+ /**
64
+ * The payment status.
65
+ */
66
+ status: OrangePaymentStatus;
67
+ /**
68
+ * The payToken value useful to make payment
69
+ * and track the status of payment.
70
+ */
71
+ payToken: string;
72
+ /**
73
+ * URL generated to finalize the web payment.
74
+ */
75
+ paymentUrl?: string;
76
+ };
77
+ /**
78
+ * This response is obtained when we initiate a mobile payment request,
79
+ * the request would generate a payToken useful to make payment
80
+ * and track the status of payment.
81
+ */
82
+ export declare type MobilePaymentInitializationResponse = {
83
+ /**
84
+ * The orange money error.
85
+ */
86
+ orangeMoneyError: OrangeMoneyErrorType;
87
+ } | {
88
+ /**
89
+ * The payment status.
90
+ */
91
+ status: OrangePaymentStatus;
92
+ /**
93
+ * The payToken value useful to make payment
94
+ * and track the status of payment.
95
+ */
96
+ payToken: string;
97
+ };
98
+ export declare type MobilePaymentCheckStatusResponse = {
99
+ /**
100
+ * The orange money error.
101
+ */
102
+ orangeMoneyError: OrangeMoneyErrorType;
103
+ } | {
104
+ /**
105
+ * The payment status.
106
+ */
107
+ status: OrangePaymentStatus;
108
+ };
109
+ /**
110
+ * This response is obtained when we generate a mobile paytoken request,
111
+ */
112
+ export declare type MobilePayTokenResponse = {
113
+ /**
114
+ * The paytoken retrieved.
115
+ */
116
+ payToken: string;
117
+ };
118
+ //# sourceMappingURL=requests_responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests_responses.d.ts","sourceRoot":"","sources":["../../../../src/utils/requests_responses.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEzE,oBAAY,8BAA8B,GAAG;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,MAAM,EAAE,mBAAmB,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,CAAC;AACF,eAAO,MAAM,oCAAoC;;;CA2BhD,CAAC;AAEF,oBAAY,kCAAkC,GAAG;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,oBAAY,+BAA+B,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,oBAAY,mBAAmB,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,6BAA6B,GAAG;IAC1C;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAE5B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,mCAAmC,GAC3C;IACE;;OAEG;IACH,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,GACD;IACE;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAE5B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,oBAAY,gCAAgC,GACxC;IACE;;OAEG;IACH,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,GACD;IACE;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEN;;GAEG;AACH,oBAAY,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.providerPaymentRequestResponseSchema = void 0;
7
+ const joi_1 = __importDefault(require("joi"));
8
+ const constants_1 = require("../constants");
9
+ exports.providerPaymentRequestResponseSchema = {
10
+ message: joi_1.default.string().required(),
11
+ data: joi_1.default.object({
12
+ id: joi_1.default.number().required(),
13
+ createtime: joi_1.default.string().allow('').required(),
14
+ subscriberMsisdn: joi_1.default.string().allow(null).required(),
15
+ amount: joi_1.default.number().required(),
16
+ payToken: joi_1.default.string().required(),
17
+ txnid: joi_1.default.string().allow('', null).required(),
18
+ txnmode: joi_1.default.string().allow('').required(),
19
+ inittxnmessage: joi_1.default.string().allow('').required(),
20
+ inittxnstatus: joi_1.default.string().required(),
21
+ confirmtxnstatus: joi_1.default.string().allow('').allow(null),
22
+ confirmtxnmessage: joi_1.default.string().allow('').allow(null),
23
+ status: joi_1.default.string()
24
+ .valid(constants_1.OrangePaymentStatus.FAILED_PAYMENT, constants_1.OrangePaymentStatus.PENDING_PAYMENT, constants_1.OrangePaymentStatus.CANCELLED_PAYMENT, constants_1.OrangePaymentStatus.EXPIRED_PAYMENT, constants_1.OrangePaymentStatus.SUCCESSFULL_MOBILE_PAYMENT)
25
+ .required(),
26
+ notifUrl: joi_1.default.string().allow('').required(),
27
+ description: joi_1.default.string().allow('').required(),
28
+ channelUserMsisdn: joi_1.default.string().allow('').required(),
29
+ }).required(),
30
+ };
31
+ //# sourceMappingURL=requests_responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests_responses.js","sourceRoot":"","sources":["../../../../src/utils/requests_responses.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,4CAAyE;AAsB5D,QAAA,oCAAoC,GAAG;IAClD,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,aAAG,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7C,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACrD,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;QAC9C,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC1C,cAAc,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QACjD,aAAa,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QACpD,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QACrD,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE;aACjB,KAAK,CACJ,+BAAmB,CAAC,cAAc,EAClC,+BAAmB,CAAC,eAAe,EACnC,+BAAmB,CAAC,iBAAiB,EACrC,+BAAmB,CAAC,eAAe,EACnC,+BAAmB,CAAC,0BAA0B,CAC/C;aACA,QAAQ,EAAE;QACb,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC3C,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC9C,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KACrD,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC"}
@@ -0,0 +1,222 @@
1
+ import * as Joi from 'joi';
2
+ export declare enum LanguageSupported {
3
+ en = "en",
4
+ fr = "fr"
5
+ }
6
+ export declare type MobileInitializationParams = {
7
+ /**
8
+ * The channelUser api username.
9
+ */
10
+ apiUserName: string;
11
+ /**
12
+ * The ChannelUser api password.
13
+ */
14
+ apiPassword: string;
15
+ /**
16
+ * The x-auth-token.
17
+ */
18
+ xAuthToken: string;
19
+ /**
20
+ * The phone number of the user making the payment.
21
+ */
22
+ userPhoneNumber: string;
23
+ /**
24
+ * The phone number of the user receiving the payment.
25
+ */
26
+ receiverPhoneNumber: string;
27
+ /**
28
+ * Unique identifier of the customer transaction.
29
+ */
30
+ transactionId: string;
31
+ /**
32
+ * The amount of the transaction.
33
+ */
34
+ amount: number;
35
+ /**
36
+ * The Pin code of the ChannelUser.
37
+ */
38
+ pinCode: string;
39
+ /**
40
+ * An http endpoint able to receive a post request with the following json body.
41
+ * {
42
+ * ”payToken” : ”payToken”,
43
+ * ”status” : status”,
44
+ * ”message” : ”message”
45
+ * }
46
+ */
47
+ notifUrl?: string;
48
+ /**
49
+ * The mobile orange money version apply for payment request.The default orange money version is
50
+ * 1.0.2: https://apiw.orange.cm/omcoreapis/1.0.2/mp/pay
51
+ */
52
+ orangeMoneyVersion?: string;
53
+ /**
54
+ * The payment description.
55
+ */
56
+ description?: string;
57
+ };
58
+ export declare type ProvideInitializationBodySchema = {
59
+ /**
60
+ * The x-auth-token.
61
+ */
62
+ orderId: string;
63
+ /**
64
+ * The phone number of the user making the payment.
65
+ */
66
+ description: string;
67
+ /**
68
+ * The phone number of the user receiving the payment.
69
+ */
70
+ orangeMoneyVersion?: string;
71
+ /**
72
+ * Unique identifier of the customer transaction.
73
+ */
74
+ notifUrl: string;
75
+ /**
76
+ * The amount of the transaction.
77
+ */
78
+ pin: string;
79
+ /**
80
+ * The Pin code of the ChannelUser.
81
+ */
82
+ payToken: string;
83
+ /**
84
+ * An http endpoint able to receive a post request with the following json body.
85
+ * {
86
+ * ”payToken” : ”payToken”,
87
+ * ”status” : status”,
88
+ * ”message” : ”message”
89
+ * }
90
+ */
91
+ amount: number;
92
+ /**
93
+ * The mobile orange money version apply for payment request.The default orange money version is
94
+ * 1.0.2: https://apiw.orange.cm/omcoreapis/1.0.2/mp/pay
95
+ */
96
+ channelUserMsisdn: string;
97
+ /**
98
+ * The payment description.
99
+ */
100
+ subscriberMsisdn: string;
101
+ };
102
+ export declare const provideInitializationBodySchema: {
103
+ subscriberMsisdn: Joi.StringSchema<string>;
104
+ channelUserMsisdn: Joi.StringSchema<string>;
105
+ amount: Joi.StringSchema<string>;
106
+ payToken: Joi.StringSchema<string>;
107
+ pin: Joi.StringSchema<string>;
108
+ notifUrl: Joi.StringSchema<string>;
109
+ orangeMoneyVersion: Joi.StringSchema<string>;
110
+ description: Joi.StringSchema<string>;
111
+ orderId: Joi.StringSchema<string>;
112
+ };
113
+ export declare const joiMobileStatusCheckValidatorParams: Joi.ObjectSchema<MobileParamsForCheckStatus>;
114
+ export declare type WebInitializationParams = {
115
+ /**
116
+ * The encode to base64 of api username and api password.
117
+ */
118
+ authorization?: string;
119
+ /**
120
+ * The channelUser secret code.
121
+ */
122
+ merchantKey?: string;
123
+ /**
124
+ * The currency to apply to the amount.
125
+ */
126
+ currency?: string;
127
+ /**
128
+ * The user language (en or fr)
129
+ */
130
+ language?: LanguageSupported;
131
+ /**
132
+ * An http url called when the user validates the payment.
133
+ */
134
+ returnUrl?: string;
135
+ /**
136
+ * An http url called when the user cancels the payment.
137
+ */
138
+ cancelUrl?: string;
139
+ /**
140
+ * Unique identifier of the customer transaction.
141
+ */
142
+ transactionId?: string;
143
+ /**
144
+ * The amount of the transaction.
145
+ */
146
+ amount?: string;
147
+ /**
148
+ * An http endpoint able to receive a post request with the following json body
149
+ * {
150
+ * ”payToken” : ”payToken”,
151
+ * ”status” : status”,
152
+ * ”message” : ”message”
153
+ * }
154
+ */
155
+ notifUrl?: string;
156
+ /**
157
+ * The web orange money version apply for generate an access token request.The default orange money version
158
+ * is v3. Use case: https://apiw.orange.cm/oauth/v3/token
159
+ */
160
+ weOmVersion?: string;
161
+ /**
162
+ * the payment reference. usually it takes as value the name of the channel.
163
+ */
164
+ reference?: string;
165
+ /**
166
+ * the channel country code.
167
+ * example: 'cm' for cameroon, 'ci' for Ivory coast
168
+ */
169
+ countryCode?: string;
170
+ };
171
+ export declare type MobileParamsForCheckStatus = {
172
+ /**
173
+ * unique identifier used to obtain payment status.
174
+ */
175
+ payToken: string;
176
+ /**
177
+ * The x-auth-token.
178
+ */
179
+ xAuthToken: string;
180
+ /**
181
+ * The mobile orange money version apply for payment request.The default orange money version used is
182
+ * 1.0.2.
183
+ */
184
+ mobileOmVersion?: string;
185
+ /**
186
+ * The channelUser api username.
187
+ */
188
+ apiUserName: string;
189
+ /**
190
+ * The ChannelUser api password.
191
+ */
192
+ apiPassword: string;
193
+ };
194
+ export declare type WebParamsForCheckStatus = {
195
+ /**
196
+ * The unique identifier used to obtain payment status.
197
+ */
198
+ payToken?: string;
199
+ /**
200
+ * The amount of the transaction.
201
+ */
202
+ amount?: string;
203
+ /**
204
+ * Unique identifier of the customer transaction.
205
+ */
206
+ transactionId?: string;
207
+ /**
208
+ * The encode to base64 of api username and api password.
209
+ */
210
+ authorization?: string;
211
+ /**
212
+ * Country code of the country where the request will be executed.
213
+ * example: 'cm' for cameroon, 'ci' for Ivory coast
214
+ */
215
+ countryCode?: string;
216
+ /**
217
+ * The web orange money version apply for generate an access token request.The default orange money version
218
+ * is v3. Use case: https://apiw.orange.cm/oauth/v3/token
219
+ */
220
+ weOmVersion?: string;
221
+ };
222
+ //# sourceMappingURL=resquest_params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resquest_params.d.ts","sourceRoot":"","sources":["../../../../src/utils/resquest_params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,oBAAY,iBAAiB;IAC3B,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,+BAA+B,GAAG;IAC5C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;CAgB3C,CAAC;AAEF,eAAO,MAAM,mCAAmC,8CAO5C,CAAC;AAEL,oBAAY,uBAAuB,GAAG;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}