@spreeloop/orange_money 1.0.4 → 1.0.6

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 (285) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +3 -0
  3. package/dist/logging/index.d.ts +0 -2
  4. package/dist/logging/index.d.ts.map +0 -1
  5. package/dist/logging/index.js +0 -18
  6. package/dist/logging/index.js.map +0 -1
  7. package/dist/logging/src/log_level.d.ts +0 -24
  8. package/dist/logging/src/log_level.d.ts.map +0 -1
  9. package/dist/logging/src/log_level.js +0 -34
  10. package/dist/logging/src/log_level.js.map +0 -1
  11. package/dist/logging/src/logging.d.ts +0 -50
  12. package/dist/logging/src/logging.d.ts.map +0 -1
  13. package/dist/logging/src/logging.js +0 -87
  14. package/dist/logging/src/logging.js.map +0 -1
  15. package/dist/logging/src/printer.d.ts +0 -10
  16. package/dist/logging/src/printer.d.ts.map +0 -1
  17. package/dist/logging/src/printer.js +0 -3
  18. package/dist/logging/src/printer.js.map +0 -1
  19. package/dist/main.js +0 -3
  20. package/dist/main.js.LICENSE.txt +0 -1
  21. package/dist/main.js.map +0 -1
  22. package/dist/orange_money/index.d.ts +0 -2
  23. package/dist/orange_money/index.d.ts.map +0 -1
  24. package/dist/orange_money/index.js +0 -18
  25. package/dist/orange_money/index.js.map +0 -1
  26. package/dist/orange_money/src/common/utils/https.d.ts +0 -77
  27. package/dist/orange_money/src/common/utils/https.d.ts.map +0 -1
  28. package/dist/orange_money/src/common/utils/https.js +0 -240
  29. package/dist/orange_money/src/common/utils/https.js.map +0 -1
  30. package/dist/orange_money/src/common/utils/https.spec.d.ts +0 -2
  31. package/dist/orange_money/src/common/utils/https.spec.d.ts.map +0 -1
  32. package/dist/orange_money/src/common/utils/https.spec.js +0 -77
  33. package/dist/orange_money/src/common/utils/https.spec.js.map +0 -1
  34. package/dist/orange_money/src/common/utils/logging_interface.d.ts +0 -23
  35. package/dist/orange_money/src/common/utils/logging_interface.d.ts.map +0 -1
  36. package/dist/orange_money/src/common/utils/logging_interface.js +0 -3
  37. package/dist/orange_money/src/common/utils/logging_interface.js.map +0 -1
  38. package/dist/orange_money/src/common/utils/operation_response.d.ts +0 -16
  39. package/dist/orange_money/src/common/utils/operation_response.d.ts.map +0 -1
  40. package/dist/orange_money/src/common/utils/operation_response.js +0 -3
  41. package/dist/orange_money/src/common/utils/operation_response.js.map +0 -1
  42. package/dist/orange_money/src/common/utils/utils.d.ts +0 -6
  43. package/dist/orange_money/src/common/utils/utils.d.ts.map +0 -1
  44. package/dist/orange_money/src/common/utils/utils.js +0 -10
  45. package/dist/orange_money/src/common/utils/utils.js.map +0 -1
  46. package/dist/orange_money/src/constants.d.ts +0 -95
  47. package/dist/orange_money/src/constants.d.ts.map +0 -1
  48. package/dist/orange_money/src/constants.js +0 -111
  49. package/dist/orange_money/src/constants.js.map +0 -1
  50. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts +0 -63
  51. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts.map +0 -1
  52. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js +0 -84
  53. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js.map +0 -1
  54. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts +0 -40
  55. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts.map +0 -1
  56. package/dist/orange_money/src/disbursements/implementations/src/live.js +0 -61
  57. package/dist/orange_money/src/disbursements/implementations/src/live.js.map +0 -1
  58. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts +0 -40
  59. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts.map +0 -1
  60. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js +0 -110
  61. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js.map +0 -1
  62. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts +0 -28
  63. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts.map +0 -1
  64. package/dist/orange_money/src/disbursements/operations/create_access_token.js +0 -45
  65. package/dist/orange_money/src/disbursements/operations/create_access_token.js.map +0 -1
  66. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts +0 -2
  67. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts.map +0 -1
  68. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js +0 -106
  69. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js.map +0 -1
  70. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts +0 -114
  71. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts.map +0 -1
  72. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js +0 -128
  73. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js.map +0 -1
  74. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts +0 -2
  75. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts.map +0 -1
  76. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js +0 -148
  77. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js.map +0 -1
  78. package/dist/orange_money/src/disbursements/operations/transfer.d.ts +0 -45
  79. package/dist/orange_money/src/disbursements/operations/transfer.d.ts.map +0 -1
  80. package/dist/orange_money/src/disbursements/operations/transfer.js +0 -74
  81. package/dist/orange_money/src/disbursements/operations/transfer.js.map +0 -1
  82. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts +0 -2
  83. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts.map +0 -1
  84. package/dist/orange_money/src/disbursements/operations/transfer.spec.js +0 -178
  85. package/dist/orange_money/src/disbursements/operations/transfer.spec.js.map +0 -1
  86. package/dist/orange_money/src/disbursements/routes/routes.d.ts +0 -38
  87. package/dist/orange_money/src/disbursements/routes/routes.d.ts.map +0 -1
  88. package/dist/orange_money/src/disbursements/routes/routes.js +0 -53
  89. package/dist/orange_money/src/disbursements/routes/routes.js.map +0 -1
  90. package/dist/orange_money/src/disbursements/utils/constants.d.ts +0 -5
  91. package/dist/orange_money/src/disbursements/utils/constants.d.ts.map +0 -1
  92. package/dist/orange_money/src/disbursements/utils/constants.js +0 -9
  93. package/dist/orange_money/src/disbursements/utils/constants.js.map +0 -1
  94. package/dist/orange_money/src/disbursements/utils/https.d.ts +0 -74
  95. package/dist/orange_money/src/disbursements/utils/https.d.ts.map +0 -1
  96. package/dist/orange_money/src/disbursements/utils/https.js +0 -206
  97. package/dist/orange_money/src/disbursements/utils/https.js.map +0 -1
  98. package/dist/orange_money/src/disbursements/utils/https.spec.d.ts +0 -2
  99. package/dist/orange_money/src/disbursements/utils/https.spec.d.ts.map +0 -1
  100. package/dist/orange_money/src/disbursements/utils/https.spec.js +0 -77
  101. package/dist/orange_money/src/disbursements/utils/https.spec.js.map +0 -1
  102. package/dist/orange_money/src/disbursements/utils/regex.d.ts +0 -9
  103. package/dist/orange_money/src/disbursements/utils/regex.d.ts.map +0 -1
  104. package/dist/orange_money/src/disbursements/utils/regex.js +0 -12
  105. package/dist/orange_money/src/disbursements/utils/regex.js.map +0 -1
  106. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts +0 -2
  107. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts.map +0 -1
  108. package/dist/orange_money/src/disbursements/utils/regex.spec.js +0 -32
  109. package/dist/orange_money/src/disbursements/utils/regex.spec.js.map +0 -1
  110. package/dist/orange_money/src/disbursements/utils/status.d.ts +0 -53
  111. package/dist/orange_money/src/disbursements/utils/status.d.ts.map +0 -1
  112. package/dist/orange_money/src/disbursements/utils/status.js +0 -58
  113. package/dist/orange_money/src/disbursements/utils/status.js.map +0 -1
  114. package/dist/orange_money/src/disbursements/utils/utils.d.ts +0 -9
  115. package/dist/orange_money/src/disbursements/utils/utils.d.ts.map +0 -1
  116. package/dist/orange_money/src/disbursements/utils/utils.js +0 -26
  117. package/dist/orange_money/src/disbursements/utils/utils.js.map +0 -1
  118. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts +0 -2
  119. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts.map +0 -1
  120. package/dist/orange_money/src/disbursements/utils/utils.spec.js +0 -43
  121. package/dist/orange_money/src/disbursements/utils/utils.spec.js.map +0 -1
  122. package/dist/orange_money/src/index.d.ts +0 -8
  123. package/dist/orange_money/src/index.d.ts.map +0 -1
  124. package/dist/orange_money/src/index.js +0 -21
  125. package/dist/orange_money/src/index.js.map +0 -1
  126. package/dist/orange_money/src/orange_money/orange_money.d.ts +0 -58
  127. package/dist/orange_money/src/orange_money/orange_money.d.ts.map +0 -1
  128. package/dist/orange_money/src/orange_money/orange_money.js +0 -33
  129. package/dist/orange_money/src/orange_money/orange_money.js.map +0 -1
  130. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.d.ts +0 -7
  131. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.d.ts.map +0 -1
  132. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.js +0 -16
  133. package/dist/orange_money/src/orange_money/orange_money_fake/fake_result.js.map +0 -1
  134. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.d.ts +0 -29
  135. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.d.ts.map +0 -1
  136. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.js +0 -67
  137. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.js.map +0 -1
  138. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.d.ts +0 -2
  139. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.d.ts.map +0 -1
  140. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.js +0 -51
  141. package/dist/orange_money/src/orange_money/orange_money_fake/orange_money_fake_payment.spec.js.map +0 -1
  142. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.d.ts +0 -105
  143. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.d.ts.map +0 -1
  144. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.js +0 -459
  145. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.js.map +0 -1
  146. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.d.ts +0 -2
  147. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.d.ts.map +0 -1
  148. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.js +0 -497
  149. package/dist/orange_money/src/orange_money/orange_money_live/mobile_platfom/mobile_platform.spec.js.map +0 -1
  150. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.d.ts +0 -26
  151. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.d.ts.map +0 -1
  152. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.js +0 -26
  153. package/dist/orange_money/src/orange_money/orange_money_live/orange_money_live_payment.js.map +0 -1
  154. package/dist/orange_money/src/payments/implementations/fake.d.ts +0 -33
  155. package/dist/orange_money/src/payments/implementations/fake.d.ts.map +0 -1
  156. package/dist/orange_money/src/payments/implementations/fake.js +0 -110
  157. package/dist/orange_money/src/payments/implementations/fake.js.map +0 -1
  158. package/dist/orange_money/src/payments/implementations/live.d.ts +0 -45
  159. package/dist/orange_money/src/payments/implementations/live.d.ts.map +0 -1
  160. package/dist/orange_money/src/payments/implementations/live.js +0 -69
  161. package/dist/orange_money/src/payments/implementations/live.js.map +0 -1
  162. package/dist/orange_money/src/payments/implementations/payment_service.d.ts +0 -44
  163. package/dist/orange_money/src/payments/implementations/payment_service.d.ts.map +0 -1
  164. package/dist/orange_money/src/payments/implementations/payment_service.js +0 -44
  165. package/dist/orange_money/src/payments/implementations/payment_service.js.map +0 -1
  166. package/dist/orange_money/src/payments/implementations/src/fake.d.ts +0 -31
  167. package/dist/orange_money/src/payments/implementations/src/fake.d.ts.map +0 -1
  168. package/dist/orange_money/src/payments/implementations/src/fake.js +0 -62
  169. package/dist/orange_money/src/payments/implementations/src/fake.js.map +0 -1
  170. package/dist/orange_money/src/payments/implementations/src/live.d.ts +0 -29
  171. package/dist/orange_money/src/payments/implementations/src/live.d.ts.map +0 -1
  172. package/dist/orange_money/src/payments/implementations/src/live.js +0 -44
  173. package/dist/orange_money/src/payments/implementations/src/live.js.map +0 -1
  174. package/dist/orange_money/src/payments/operations/create_access_token.d.ts +0 -19
  175. package/dist/orange_money/src/payments/operations/create_access_token.d.ts.map +0 -1
  176. package/dist/orange_money/src/payments/operations/create_access_token.js +0 -51
  177. package/dist/orange_money/src/payments/operations/create_access_token.js.map +0 -1
  178. package/dist/orange_money/src/payments/operations/create_access_token.spec.d.ts +0 -2
  179. package/dist/orange_money/src/payments/operations/create_access_token.spec.d.ts.map +0 -1
  180. package/dist/orange_money/src/payments/operations/create_access_token.spec.js +0 -70
  181. package/dist/orange_money/src/payments/operations/create_access_token.spec.js.map +0 -1
  182. package/dist/orange_money/src/payments/operations/create_pay_token.d.ts +0 -12
  183. package/dist/orange_money/src/payments/operations/create_pay_token.d.ts.map +0 -1
  184. package/dist/orange_money/src/payments/operations/create_pay_token.js +0 -62
  185. package/dist/orange_money/src/payments/operations/create_pay_token.js.map +0 -1
  186. package/dist/orange_money/src/payments/operations/create_pay_token.spec.d.ts +0 -2
  187. package/dist/orange_money/src/payments/operations/create_pay_token.spec.d.ts.map +0 -1
  188. package/dist/orange_money/src/payments/operations/create_pay_token.spec.js +0 -91
  189. package/dist/orange_money/src/payments/operations/create_pay_token.spec.js.map +0 -1
  190. package/dist/orange_money/src/payments/operations/get_access_token.d.ts +0 -11
  191. package/dist/orange_money/src/payments/operations/get_access_token.d.ts.map +0 -1
  192. package/dist/orange_money/src/payments/operations/get_access_token.js +0 -47
  193. package/dist/orange_money/src/payments/operations/get_access_token.js.map +0 -1
  194. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts +0 -2
  195. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts.map +0 -1
  196. package/dist/orange_money/src/payments/operations/get_access_token.spec.js +0 -75
  197. package/dist/orange_money/src/payments/operations/get_access_token.spec.js.map +0 -1
  198. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts +0 -12
  199. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts.map +0 -1
  200. package/dist/orange_money/src/payments/operations/get_pay_token.js +0 -43
  201. package/dist/orange_money/src/payments/operations/get_pay_token.js.map +0 -1
  202. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts +0 -2
  203. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts.map +0 -1
  204. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js +0 -75
  205. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js.map +0 -1
  206. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts +0 -23
  207. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts.map +0 -1
  208. package/dist/orange_money/src/payments/operations/get_payment_status.js +0 -51
  209. package/dist/orange_money/src/payments/operations/get_payment_status.js.map +0 -1
  210. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts +0 -2
  211. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts.map +0 -1
  212. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js +0 -102
  213. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js.map +0 -1
  214. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts +0 -22
  215. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts.map +0 -1
  216. package/dist/orange_money/src/payments/operations/initialize_om_payment.js +0 -124
  217. package/dist/orange_money/src/payments/operations/initialize_om_payment.js.map +0 -1
  218. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts +0 -2
  219. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts.map +0 -1
  220. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js +0 -246
  221. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js.map +0 -1
  222. package/dist/orange_money/src/payments/operations/payment.d.ts +0 -21
  223. package/dist/orange_money/src/payments/operations/payment.d.ts.map +0 -1
  224. package/dist/orange_money/src/payments/operations/payment.js +0 -204
  225. package/dist/orange_money/src/payments/operations/payment.js.map +0 -1
  226. package/dist/orange_money/src/payments/operations/payment.spec.d.ts +0 -2
  227. package/dist/orange_money/src/payments/operations/payment.spec.d.ts.map +0 -1
  228. package/dist/orange_money/src/payments/operations/payment.spec.js +0 -282
  229. package/dist/orange_money/src/payments/operations/payment.spec.js.map +0 -1
  230. package/dist/orange_money/src/payments/payments.d.ts +0 -57
  231. package/dist/orange_money/src/payments/payments.d.ts.map +0 -1
  232. package/dist/orange_money/src/payments/payments.js +0 -36
  233. package/dist/orange_money/src/payments/payments.js.map +0 -1
  234. package/dist/orange_money/src/payments/routes/routes.d.ts +0 -48
  235. package/dist/orange_money/src/payments/routes/routes.d.ts.map +0 -1
  236. package/dist/orange_money/src/payments/routes/routes.js +0 -61
  237. package/dist/orange_money/src/payments/routes/routes.js.map +0 -1
  238. package/dist/orange_money/src/payments/utils/constants.d.ts +0 -100
  239. package/dist/orange_money/src/payments/utils/constants.d.ts.map +0 -1
  240. package/dist/orange_money/src/payments/utils/constants.js +0 -117
  241. package/dist/orange_money/src/payments/utils/constants.js.map +0 -1
  242. package/dist/orange_money/src/payments/utils/https.d.ts +0 -43
  243. package/dist/orange_money/src/payments/utils/https.d.ts.map +0 -1
  244. package/dist/orange_money/src/payments/utils/https.js +0 -137
  245. package/dist/orange_money/src/payments/utils/https.js.map +0 -1
  246. package/dist/orange_money/src/payments/utils/joi_schema.d.ts +0 -71
  247. package/dist/orange_money/src/payments/utils/joi_schema.d.ts.map +0 -1
  248. package/dist/orange_money/src/payments/utils/joi_schema.js +0 -44
  249. package/dist/orange_money/src/payments/utils/joi_schema.js.map +0 -1
  250. package/dist/orange_money/src/payments/utils/logging_interface.d.ts +0 -23
  251. package/dist/orange_money/src/payments/utils/logging_interface.d.ts.map +0 -1
  252. package/dist/orange_money/src/payments/utils/logging_interface.js +0 -3
  253. package/dist/orange_money/src/payments/utils/logging_interface.js.map +0 -1
  254. package/dist/orange_money/src/payments/utils/request_model.d.ts +0 -75
  255. package/dist/orange_money/src/payments/utils/request_model.d.ts.map +0 -1
  256. package/dist/orange_money/src/payments/utils/request_model.js +0 -3
  257. package/dist/orange_money/src/payments/utils/request_model.js.map +0 -1
  258. package/dist/orange_money/src/payments/utils/utils.d.ts +0 -15
  259. package/dist/orange_money/src/payments/utils/utils.d.ts.map +0 -1
  260. package/dist/orange_money/src/payments/utils/utils.js +0 -27
  261. package/dist/orange_money/src/payments/utils/utils.js.map +0 -1
  262. package/dist/orange_money/src/payments/utils/utils.spec.d.ts +0 -2
  263. package/dist/orange_money/src/payments/utils/utils.spec.d.ts.map +0 -1
  264. package/dist/orange_money/src/payments/utils/utils.spec.js +0 -17
  265. package/dist/orange_money/src/payments/utils/utils.spec.js.map +0 -1
  266. package/dist/orange_money/src/utils/logging_interface.d.ts +0 -23
  267. package/dist/orange_money/src/utils/logging_interface.d.ts.map +0 -1
  268. package/dist/orange_money/src/utils/logging_interface.js +0 -3
  269. package/dist/orange_money/src/utils/logging_interface.js.map +0 -1
  270. package/dist/orange_money/src/utils/requests_responses.d.ts +0 -118
  271. package/dist/orange_money/src/utils/requests_responses.d.ts.map +0 -1
  272. package/dist/orange_money/src/utils/requests_responses.js +0 -31
  273. package/dist/orange_money/src/utils/requests_responses.js.map +0 -1
  274. package/dist/orange_money/src/utils/resquest_params.d.ts +0 -222
  275. package/dist/orange_money/src/utils/resquest_params.d.ts.map +0 -1
  276. package/dist/orange_money/src/utils/resquest_params.js +0 -57
  277. package/dist/orange_money/src/utils/resquest_params.js.map +0 -1
  278. package/dist/orange_money/src/utils/utils.d.ts +0 -65
  279. package/dist/orange_money/src/utils/utils.d.ts.map +0 -1
  280. package/dist/orange_money/src/utils/utils.js +0 -199
  281. package/dist/orange_money/src/utils/utils.js.map +0 -1
  282. package/dist/orange_money/src/utils/utils.spec.d.ts +0 -2
  283. package/dist/orange_money/src/utils/utils.spec.d.ts.map +0 -1
  284. package/dist/orange_money/src/utils/utils.spec.js +0 -17
  285. package/dist/orange_money/src/utils/utils.spec.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spreeloop/orange_money",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A orange money api integration package",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Disbursement } from './disbursements/implementations/disbursement_service';
2
+ export { DisbursementXTargetEnvironmentType } from './disbursements/utils/constants';
3
+ export { DisbursementInterface } from './disbursements/implementations/disbursement_service';
4
+ export { DisbursementStatus } from './disbursements/utils/status';
2
5
  export {
3
6
  OrangeMoneyPayment,
4
7
  OrangeMoneyPaymentInterface,
@@ -1,2 +0,0 @@
1
- export * from './src/logging';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../logging/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/logging"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../logging/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
@@ -1,24 +0,0 @@
1
- export declare enum LogLevel {
2
- /**
3
- * Development verbose information.
4
- */
5
- DEBUG = 0,
6
- /**
7
- * Significant messages.
8
- */
9
- INFO = 1,
10
- /**
11
- * Really important stuff.
12
- */
13
- WARN = 2,
14
- /**
15
- * General purpose error.
16
- */
17
- ERROR = 3,
18
- /**
19
- * Disable the logging system.
20
- */
21
- SILENT = 4
22
- }
23
- export declare const LevelName: Record<LogLevel, string>;
24
- //# sourceMappingURL=log_level.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log_level.d.ts","sourceRoot":"","sources":["../../../../logging/src/log_level.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,IAAA;IACL;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,KAAK,IAAA;IACL;;OAEG;IACH,MAAM,IAAA;CACP;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAM9C,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LevelName = exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- /**
7
- * Development verbose information.
8
- */
9
- LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
10
- /**
11
- * Significant messages.
12
- */
13
- LogLevel[LogLevel["INFO"] = 1] = "INFO";
14
- /**
15
- * Really important stuff.
16
- */
17
- LogLevel[LogLevel["WARN"] = 2] = "WARN";
18
- /**
19
- * General purpose error.
20
- */
21
- LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
22
- /**
23
- * Disable the logging system.
24
- */
25
- LogLevel[LogLevel["SILENT"] = 4] = "SILENT";
26
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
27
- exports.LevelName = {
28
- [LogLevel.DEBUG]: 'DEBUG',
29
- [LogLevel.INFO]: 'INFO',
30
- [LogLevel.WARN]: 'WARN',
31
- [LogLevel.ERROR]: 'ERROR',
32
- [LogLevel.SILENT]: 'SILENT',
33
- };
34
- //# sourceMappingURL=log_level.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log_level.js","sourceRoot":"","sources":["../../../../logging/src/log_level.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAqBX;AArBD,WAAY,QAAQ;IAClB;;OAEG;IACH,yCAAK,CAAA;IACL;;OAEG;IACH,uCAAI,CAAA;IACJ;;OAEG;IACH,uCAAI,CAAA;IACJ;;OAEG;IACH,yCAAK,CAAA;IACL;;OAEG;IACH,2CAAM,CAAA;AACR,CAAC,EArBW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAqBnB;AAEY,QAAA,SAAS,GAA6B;IACjD,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ;CAC5B,CAAC"}
@@ -1,50 +0,0 @@
1
- import { LogLevel } from './log_level';
2
- import { LogPrinter } from './printer';
3
- /**
4
- * The main class of our logging system.
5
- */
6
- export declare class Logger {
7
- private name;
8
- /**
9
- * The lowest log level to use.
10
- * Use LogLevel.SILENT to disable printing.
11
- */
12
- static level: LogLevel;
13
- /**
14
- * A variable that contains a printer configuration that will be
15
- * called for debugging some message to the output.
16
- */
17
- static printer: LogPrinter;
18
- /**
19
- * Constructs a new [Logger] implementation.
20
- * @param {string} name
21
- */
22
- constructor(name?: string);
23
- /**
24
- * Sends a print message to a registered printer.
25
- * @param {Object} props
26
- * @return {void}
27
- */
28
- private print;
29
- /**
30
- * Log a debug level message.
31
- * @param {string[]} args
32
- */
33
- log(...args: string[]): void;
34
- /**
35
- * Log an info level message.
36
- * @param {string[]} args
37
- */
38
- info(...args: string[]): void;
39
- /**
40
- * Log a waning level message.
41
- * @param {string[]} args
42
- */
43
- warn(...args: string[]): void;
44
- /**
45
- * Log an error level message.
46
- * @param {string[]} args
47
- */
48
- error(...args: string[]): void;
49
- }
50
- //# sourceMappingURL=logging.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../../logging/src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;GAEG;AACH,qBAAa,MAAM;IAmBL,OAAO,CAAC,IAAI;IAlBxB;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAkB;IAExC;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAExB;IAEF;;;OAGG;gBACiB,IAAI,GAAE,MAAW;IAErC;;;;OAIG;IACH,OAAO,CAAC,KAAK;IA0Bb;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG5B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG7B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG7B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;CAG/B"}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Logger = void 0;
4
- const log_level_1 = require("./log_level");
5
- /**
6
- * The main class of our logging system.
7
- */
8
- class Logger {
9
- /**
10
- * Constructs a new [Logger] implementation.
11
- * @param {string} name
12
- */
13
- constructor(name = '') {
14
- this.name = name;
15
- }
16
- /**
17
- * Sends a print message to a registered printer.
18
- * @param {Object} props
19
- * @return {void}
20
- */
21
- print(props) {
22
- if (props.level < Logger.level) {
23
- return;
24
- }
25
- Logger.printer({
26
- name: this.name,
27
- level: props.level,
28
- message: props.message,
29
- });
30
- switch (props.level) {
31
- case log_level_1.LogLevel.DEBUG:
32
- console.log(props.message);
33
- break;
34
- case log_level_1.LogLevel.INFO:
35
- console.info(props.message);
36
- break;
37
- case log_level_1.LogLevel.ERROR:
38
- console.error(props.message);
39
- break;
40
- case log_level_1.LogLevel.WARN:
41
- console.warn(props.message);
42
- break;
43
- }
44
- }
45
- /**
46
- * Log a debug level message.
47
- * @param {string[]} args
48
- */
49
- log(...args) {
50
- this.print({ level: log_level_1.LogLevel.DEBUG, message: args.join('\n') });
51
- }
52
- /**
53
- * Log an info level message.
54
- * @param {string[]} args
55
- */
56
- info(...args) {
57
- this.print({ level: log_level_1.LogLevel.INFO, message: args.join('\n') });
58
- }
59
- /**
60
- * Log a waning level message.
61
- * @param {string[]} args
62
- */
63
- warn(...args) {
64
- this.print({ level: log_level_1.LogLevel.WARN, message: args.join('\n') });
65
- }
66
- /**
67
- * Log an error level message.
68
- * @param {string[]} args
69
- */
70
- error(...args) {
71
- this.print({ level: log_level_1.LogLevel.ERROR, message: args.join('\n') });
72
- }
73
- }
74
- exports.Logger = Logger;
75
- /**
76
- * The lowest log level to use.
77
- * Use LogLevel.SILENT to disable printing.
78
- */
79
- Logger.level = log_level_1.LogLevel.DEBUG;
80
- /**
81
- * A variable that contains a printer configuration that will be
82
- * called for debugging some message to the output.
83
- */
84
- Logger.printer = () => {
85
- return;
86
- };
87
- //# sourceMappingURL=logging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../logging/src/logging.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAGvC;;GAEG;AACH,MAAa,MAAM;IAejB;;;OAGG;IACH,YAAoB,OAAe,EAAE;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC;;;;OAIG;IACK,KAAK,CAAC,KAA2C;QACvD,IAAI,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,CAAC,OAAO,CAAC;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,QAAQ,KAAK,CAAC,KAAK,EAAE;YACnB,KAAK,oBAAQ,CAAC,KAAK;gBACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3B,MAAM;YACR,KAAK,oBAAQ,CAAC,IAAI;gBAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM;YACR,KAAK,oBAAQ,CAAC,KAAK;gBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC7B,MAAM;YACR,KAAK,oBAAQ,CAAC,IAAI;gBAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM;SACT;IACH,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAc;QACnB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAc;QACpB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAc;QACpB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAc;QACrB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;;AA/EH,wBAgFC;AA/EC;;;GAGG;AACI,YAAK,GAAa,oBAAQ,CAAC,KAAK,CAAC;AAExC;;;GAGG;AACI,cAAO,GAAe,GAAG,EAAE;IAChC,OAAO;AACT,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { LogLevel } from './log_level';
2
- export declare type LogPrinterArgs = {
3
- name: string;
4
- level: LogLevel;
5
- message: string;
6
- errorObject?: object;
7
- stackTrace?: string;
8
- };
9
- export declare type LogPrinter = (param: LogPrinterArgs) => void;
10
- //# sourceMappingURL=printer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../../../../logging/src/printer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=printer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"printer.js","sourceRoot":"","sources":["../../../../logging/src/printer.ts"],"names":[],"mappings":""}
package/dist/main.js DELETED
@@ -1,3 +0,0 @@
1
- /*! For license information please see main.js.LICENSE.txt */
2
- (()=>{"use strict";var t,e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},r={};function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}e.r(r),e.d(r,{LanguageSupported:()=>c,OrangeMoneyErrorType:()=>u,OrangeMoneyPayment:()=>mt,OrangeMoneyPaymentType:()=>b,OrangePaymentStatus:()=>i}),function(t){t.keyAuthorization="Authorization",t.keyGrantType="grant_type",t.keyContentType="Content-Type",t.keyXAuthToken="X-AUTH-TOKEN",t.keyMerchantKey="merchant_key",t.keyCurrency="currency",t.keyOrderId="order_id",t.keyReturnUrl="return_url",t.keyCancelUrl="cancel_url",t.keyWebNotifyUrl="notif_url",t.keyLang="lang",t.keyReference="reference",t.keyAmount="amount",t.keyPayToken="pay_token",t.keySubscriberMsisdn="subscriberMsisdn",t.keyChannelUserMsisdn="channelUserMsisdn",t.keyDescription="description",t.keyMobileOrderId="orderId",t.keyPin="pin",t.keyMobilePayToken="payToken",t.keyMobileNotifUrl="notifUrl"}(t||(t={}));var i,u,c,s=o((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));a(s,"typeJson","application/json"),a(s,"TypeWwwFrom","application/x-www-form-urlencoded"),a(s,"basic","Basic "),a(s,"authorization","AUTHORIZATION"),a(s,"bearer","Bearer "),a(s,"grantType","grant_type"),a(s,"clientCredentials","client_credentials"),a(s,"xAuthToken","X-AUTH-TOKEN"),function(t){t.PENDING_PAYMENT="PENDING",t.CANCELLED_PAYMENT="CANCELLED",t.INITIATE_PAYMENT="INITIATED",t.SUCCESSFULL_MOBILE_PAYMENT="SUCCESSFULL",t.SUCCESS_WEB_PAYMENT="SUCCESS",t.FAILED_PAYMENT="FAILED",t.EXPIRED_PAYMENT="EXPIRED"}(i||(i={})),function(t){t.insufficientFunds="Insufficient fund",t.invalidOrangeMoneyNumber="Invalid orange money number",t.invalidData="Invalid data provided",t.failToInitiateThePayment="Failed to initiate the payment",t.failToGenerateAccessToken="Failed to generate the access token",t.failToCheckPaymentStatus="Failed to check the status of payment",t.failToGeneratePayToken="Failed to generate payToken"}(u||(u={})),function(t){t.en="en",t.fr="fr"}(c||(c={}));const l=require("axios");var f=e.n(l);const h=require("base64url");var p=e.n(h);const y=require("https");function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function v(){v=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new P(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function h(){}function p(){}var y={};u(y,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(O([])));m&&m!==e&&r.call(m,o)&&(y=m);var b=p.prototype=f.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,a,i,u){var c=s(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==d(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function E(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return h.prototype=p,u(b,"constructor",p),u(p,"constructor",h),h.displayName=u(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,i,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(k.prototype),u(k.prototype,a,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new k(c(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),u(b,i,"Generator"),u(b,o,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function g(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){g(a,n,o,i,u,"next",t)}function u(t){g(a,n,o,i,u,"throw",t)}i(void 0)}))}}var b,w=function(t,e){return p()("".concat(t,":").concat(e))};function k(t){return E.apply(this,arguments)}function E(){return(E=m(v().mark((function t(e){var r,n,o,a,i,u,c,s;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data,n=e.route,o=e.headers,a=e.logger,t.prev=1,i=new y.Agent({rejectUnauthorized:!1}),t.next=5,f()({method:"post",url:n,headers:o,data:r,httpsAgent:i});case 5:return u=t.sent,a.info("Request on the route ".concat(n," completed successfully with status ").concat(u.status," and data : ").concat(JSON.stringify(u.data))),t.abrupt("return",{data:u.data,status:u.status});case 10:if(t.prev=10,t.t0=t.catch(1),!f().isAxiosError(t.t0)){t.next=23;break}if(c=t.t0,!(s=c.response)){t.next=18;break}return a.warn("The POST request was made on the router ".concat(n," and the server responded with a status code ").concat(s.status," with data response: ").concat(JSON.stringify(s.data))),t.abrupt("return",{status:s.status,error:s.data});case 18:if(!c.request){t.next=21;break}return a.warn("The POST request was made on the router ".concat(n," but no response was received. config data: ").concat(c.config.data)),t.abrupt("return",{status:0,error:c.config.data});case 21:return a.warn("The POST request was made on the router ".concat(n," but Something happened in setting up the request that triggered an Error. Error message: ").concat(c.message)),t.abrupt("return",{status:404,error:c.message});case 23:return a.warn("[Axios] failed to send post request on the route: ".concat(n,"\n error: ").concat(t.t0)),t.abrupt("return",{status:404,error:t.t0});case 25:case"end":return t.stop()}}),t,null,[[1,10]])})))).apply(this,arguments)}function x(t){return T.apply(this,arguments)}function T(){return(T=m(v().mark((function t(e){var r,n,o,a,i,u,c,s;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data,n=e.route,o=e.headers,a=e.logger,t.prev=1,i=new y.Agent({rejectUnauthorized:!1}),t.next=5,f()({method:"get",url:n,headers:o,data:r,httpsAgent:i});case 5:return u=t.sent,a.info("Request on the route ".concat(n," completed successfully with status ").concat(u.status," and data : ").concat(JSON.stringify(u.data))),t.abrupt("return",{status:u.status,data:u.data});case 10:if(t.prev=10,t.t0=t.catch(1),!f().isAxiosError(t.t0)){t.next=23;break}if(c=t.t0,!(s=c.response)){t.next=18;break}return a.warn("The GET request was made on the router ".concat(n," and the server responded with a status code ").concat(s.status," with data response: ").concat(s.data)),t.abrupt("return",{status:s.status,error:s.data});case 18:if(!c.request){t.next=21;break}return a.warn("The GET request was made on the router ".concat(n," but no response was received. config data: ").concat(c.config.data)),t.abrupt("return",{status:0,error:c.config.data});case 21:return a.warn("The GET request was made on the router ".concat(n," but Something happened in setting up the request that triggered an Error. Error message: ").concat(c.message)),t.abrupt("return",{status:404,error:c.message});case 23:return a.warn("[Axios] failed to send post request on the route: ".concat(n,"\n error: ").concat(t.t0)),t.abrupt("return",{status:404,error:t.t0});case 25:case"end":return t.stop()}}),t,null,[[1,10]])})))).apply(this,arguments)}function P(t){var e=[];for(var r in t)if({}.hasOwnProperty.call(t,r)){var n=encodeURIComponent(r),o=encodeURIComponent(t[r]);e.push(n+"="+o)}return e.join("&")}!function(t){t[t.live=0]="live",t[t.fake=1]="fake"}(b||(b={}));var O=function(t){return 201===t||200===t||202===t};function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function N(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(){S=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=w(i,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function h(){}function p(){}var y={};u(y,o,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(T([])));v&&v!==e&&r.call(v,o)&&(y=v);var g=p.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function n(o,a,i,u){var c=s(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==L(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=p,u(g,"constructor",p),u(p,"constructor",h),h.displayName=u(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,i,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new b(c(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(g),u(g,i,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function _(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function I(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){_(a,n,o,i,u,"next",t)}function u(t){_(a,n,o,i,u,"throw",t)}i(void 0)}))}}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var U={initLivePayment:function(t,e){var r=null!=e?e:"1.0.2";return"".concat(t,"/omcoreapis/").concat(r,"/mp/pay")},getPaymentStatusUrl:function(t){var e,r=null!==(e=t.mobileOmVersion)&&void 0!==e?e:"1.0.2";return"".concat(t.liveRoute,"/omcoreapis/").concat(r,"/mp/paymentstatus/").concat(t.payToken)},mobilePayTokenUrl:function(t,e){var r=null!=e?e:"1.0.2";return"".concat(t,"/omcoreapis/").concat(r,"/mp/init")},mobileAccessTokenEndPoint:function(t){return"".concat(t,"/token")}},j=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.logger=e}var e,r,n,o;return e=t,r=[{key:"initializeMobilePayment",value:(o=I(S().mark((function t(e){var r,n,o,a,i,c,s,l,f,h,p,y,d;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.apiPassword,n=e.apiUserName,o=e.mobileEndPointURL,a=e.xAuthToken,i=e.transactionId,c=e.amount,s=e.userPhoneNumber,l=e.notifUrl,f=e.pinCode,h=e.receiverPhoneNumber,r&&n&&a&&c&&i&&s&&o&&f&&h){t.next=13;break}return this.logger.error("Initialization failed. Invalid data provided. ",JSON.stringify(e)),t.abrupt("return",{orangeMoneyError:u.invalidData});case 13:return t.next=15,C({apiPassword:r,apiUserName:n,mobileEndPointURL:o,logger:this.logger});case 15:if(p=t.sent){t.next=18;break}return t.abrupt("return",{orangeMoneyError:u.failToGenerateAccessToken});case 18:return y=p.accessToken,t.next=21,M({mobileOmVersion:e.orangeMoneyVersion,xAuthToken:a,accessToken:y,urlRoute:o,logger:this.logger});case 21:if(d=t.sent){t.next=24;break}return t.abrupt("return",{orangeMoneyError:u.failToGeneratePayToken});case 24:return t.abrupt("return",G({mobileOmVersion:e.orangeMoneyVersion,urlRoute:o,transactionId:i,amount:c,xAuthToken:a,userPhoneNumber:s,notifUrl:l,description:e.description,pinCode:f,receiverPhoneNumber:h,payToken:d.payToken,accessToken:y,logger:this.logger}));case 25:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"checkMobilePaymentStatus",value:(n=I(S().mark((function t(e){var r,n,o,a,i,c;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.apiPassword,n=e.apiUserName,o=e.statusEndPointUrl,a=e.xAuthToken,i=e.payToken,r&&n&&o&&a&&i){t.next=8;break}return this.logger.error(" Failed to check the status failed. Invalid data provided. ",JSON.stringify(e)),t.abrupt("return",{orangeMoneyError:u.invalidData});case 8:return t.next=10,R({mobileOmVersion:e.mobileOmVersion,xAuthToken:a,paytoken:i,apiUserName:n,apiPassword:r,mobileEndPointURL:o,logger:this.logger});case 10:return c=t.sent,t.abrupt("return",c);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})}],r&&A(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),R=function(){var e=I(S().mark((function e(r){var n,o,a,i,c,l,f,h,p,y,d,v,g;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.apiPassword,a=r.apiUserName,i=r.mobileEndPointURL,c=r.xAuthToken,l=r.paytoken,f=r.mobileOmVersion,h=r.logger,e.next=3,C({apiPassword:o,apiUserName:a,mobileEndPointURL:i,logger:h});case 3:if(p=e.sent){e.next=6;break}return e.abrupt("return",{orangeMoneyError:u.failToGenerateAccessToken});case 6:return N(n={},t.keyAuthorization,"Bearer ".concat(p.accessToken)),N(n,t.keyContentType,s.typeJson),N(n,t.keyXAuthToken,c),y=n,d=U.getPaymentStatusUrl({liveRoute:i,payToken:l,mobileOmVersion:f}),h.info("Checks the payment status with data: \nheaders: ".concat(JSON.stringify(y),"\nroute: ").concat(d)),e.next=11,x({headers:y,route:d,logger:h});case 11:if(v=e.sent,g=v.data,void 0!==O(v.status)&&void 0!==g){e.next=16;break}return h.error("Request failed to get the payment status. Request Status ".concat(v.status,", data:").concat(v.data)),e.abrupt("return",{orangeMoneyError:u.failToCheckPaymentStatus});case 16:return h.info("Status successful retrieve with result: ".concat(g)),e.abrupt("return",{status:g.data.status});case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=I(S().mark((function e(r){var n,o,a,i,u,c,l,f,h,p,y,d;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.mobileEndPointURL,a=r.apiUserName,i=r.apiPassword,u=r.logger,c=w(a,i),l="Basic ".concat(c),f=N({},t.keyGrantType,"client_credentials"),h=U.mobileAccessTokenEndPoint(o),N(n={},t.keyAuthorization,l),N(n,t.keyContentType,s.TypeWwwFrom),p=n,u.info("Generates the access token with data: \nheaders: ".concat(JSON.stringify(p),"\ndata: ").concat(JSON.stringify(P(f)),"\nroute: ").concat(h)),e.next=9,k({headers:p,data:P(f),route:h,logger:u});case 9:if(y=e.sent,O(y.status)&&void 0!==y.data){e.next=13;break}return u.error("Request failed to generate the access token.Request status ".concat(y.status," and data: ").concat(y.data)),e.abrupt("return");case 13:return d=y.data,e.abrupt("return",{accessToken:d.access_token});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(){var e=I(S().mark((function e(r){var n,o,a,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(n={},t.keyAuthorization,"Bearer ".concat(r.accessToken)),N(n,t.keyContentType,s.typeJson),N(n,t.keyXAuthToken,r.xAuthToken),o=n,r.logger.info("Generates the paytoken token with data: \nheaders: ".concat(JSON.stringify(o),"\nroute: ").concat(U.mobilePayTokenUrl(r.urlRoute,r.mobileOmVersion))),e.next=4,k({headers:o,logger:r.logger,route:U.mobilePayTokenUrl(r.urlRoute,r.mobileOmVersion)});case 4:if(a=e.sent,O(a.status)&&void 0!==a.data){e.next=8;break}return r.logger.error("Request failed to generate the payToken.Request status ".concat(a.status," data ").concat(a.data)),e.abrupt("return");case 8:return i=a.data,e.abrupt("return",{payToken:i.data.payToken});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function G(t){return F.apply(this,arguments)}function F(){return(F=I(S().mark((function e(r){var n,o,a,c,l,f,h,p,y,d;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(n={},t.keyAuthorization,"Bearer ".concat(r.accessToken)),N(n,t.keyContentType,s.typeJson),N(n,t.keyXAuthToken,r.xAuthToken),f=n,N(l={},t.keySubscriberMsisdn,r.userPhoneNumber),N(l,t.keyChannelUserMsisdn,r.receiverPhoneNumber),N(l,t.keyAmount,r.amount),N(l,t.keyDescription,null!==(o=r.description)&&void 0!==o?o:""),N(l,t.keyMobileOrderId,r.transactionId),N(l,t.keyPin,r.pinCode),N(l,t.keyMobilePayToken,r.payToken),N(l,t.keyMobileNotifUrl,null!==(a=r.notifUrl)&&void 0!==a?a:""),N(l,t.keyReturnUrl,null!==(c=r.notifUrl)&&void 0!==c?c:""),h=l,r.logger.info("Initiate the ORANGE MONEY Payment with data: \nheaders: ".concat(JSON.stringify(f),"\ndata: ").concat(JSON.stringify(h),"\nroute: ").concat(U.initLivePayment(r.urlRoute,r.mobileOmVersion))),e.next=5,k({logger:r.logger,headers:f,data:h,route:U.initLivePayment(r.urlRoute,r.mobileOmVersion)});case 5:if(417!==(p=e.sent).status){e.next=15;break}if("Beneficiaire introuvable"!==(y=p.error).data.inittxnmessage){e.next=11;break}return r.logger.error("Orange money Initialization failed with status ".concat(p.status,", Raison: ").concat(y.data.inittxnmessage)),e.abrupt("return",{orangeMoneyError:u.invalidOrangeMoneyNumber});case 11:if("Le solde du compte du payeur est insuffisant"!==y.data.inittxnmessage){e.next=14;break}return r.logger.error("Orange money Initialization failed with status ".concat(p.status,", Raison: ").concat(y.data.inittxnmessage)),e.abrupt("return",{orangeMoneyError:u.insufficientFunds});case 14:return e.abrupt("return",{orangeMoneyError:u.failToInitiateThePayment});case 15:if(O(p.status)&&void 0!==p.data){e.next=18;break}return r.logger.error("Orange money Initialization failed with status ".concat(p.status,", and error data: ").concat(p.error)),e.abrupt("return",{orangeMoneyError:u.failToInitiateThePayment});case 18:return d=p.data,e.abrupt("return",{status:i.PENDING_PAYMENT,payToken:d.data.payToken});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q(){q=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=w(i,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function h(){}function p(){}var y={};u(y,o,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(T([])));v&&v!==e&&r.call(v,o)&&(y=v);var g=p.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function n(o,a,i,u){var c=s(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==z(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=p,u(g,"constructor",p),u(p,"constructor",h),h.displayName=u(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,i,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new b(c(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(g),u(g,i,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function D(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Y(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){D(a,n,o,i,u,"next",t)}function u(t){D(a,n,o,i,u,"throw",t)}i(void 0)}))}}function W(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var B={liveRoute:"https://api.orange.com",initLivePayment:function(t){return"".concat(this.liveRoute,"/orange-money-webpay/").concat(t,"/v1/webpayment")},webAccessTokenEndPoint:function(t){var e=null!=t?t:"v3";return"".concat(this.liveRoute,"/oauth/").concat(e,"/token")},getPaymentStatusUrl:function(t){return"".concat(this.liveRoute,"/orange-money-webpay/").concat(t,"/v1/transactionstatus")}},V=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.logger=e}var e,r,n,o;return e=t,r=[{key:"initializeWebPayment",value:(o=Y(q().mark((function t(e){var r,n,o,a,i,u,c,s,l,f,h,p,y;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.language,n=e.authorization,o=e.countryCode,a=e.transactionId,i=e.amount,u=e.notifUrl,c=e.currency,s=e.reference,l=e.merchantKey,f=e.returnUrl,h=e.cancelUrl,r&&o&&i&&a&&u&&n&&c&&s&&l&&f&&h){t.next=14;break}return this.logger.error("Initialization failed. Invalid data provided. ",JSON.stringify(e)),t.abrupt("return",{message:"Initialization failed. Invalid data provided. ".concat(JSON.stringify(e)),status:404,data:e});case 14:return t.next=16,X({authorization:n,weOmVersion:e.weOmVersion,logger:this.logger});case 16:if((p=t.sent).accessToken){t.next=19;break}return t.abrupt("return",p);case 19:return y=p,t.abrupt("return",H({language:r,accessToken:y.accessToken,countryCode:o,transactionId:a,amount:i,notifUrl:u,currency:c,reference:s,merchantKey:l,returnUrl:f,cancelUrl:h,logger:this.logger}));case 21:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"checkWebPaymentStatus",value:(n=Y(q().mark((function t(e){var r,n,o,a,i;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.transactionId,n=e.amount,o=e.payToken,a=e.authorization,i=e.countryCode,n&&r&&a&&r&&o&&i){t.next=8;break}return this.logger.error("Failed to check the status: Invalid data provider"+JSON.stringify(e)),t.abrupt("return");case 8:return t.abrupt("return",K({payToken:o,transactionId:r,authorization:a,amount:n,countryCode:i,weOmVersion:e.weOmVersion,logger:this.logger}));case 9:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})}],r&&W(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),K=function(){var e=Y(q().mark((function e(r){var n,o,a,i,u,c,l,f,h,p,y,d,v,g,m;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.authorization,i=r.weOmVersion,u=r.transactionId,c=r.amount,l=r.payToken,f=r.countryCode,(h=r.logger).log("Initiates the check of payment status"),e.next=4,X({authorization:a,weOmVersion:i,logger:h});case 4:if((p=e.sent).accessToken){e.next=7;break}return e.abrupt("return");case 7:return J(n={},t.keyAuthorization,"Bearer ".concat(p.accessToken)),J(n,t.keyContentType,s.typeJson),y=n,J(o={},t.keyOrderId,u),J(o,t.keyAmount,c),J(o,t.keyPayToken,l),d=o,v=B.getPaymentStatusUrl(f),h.info("Gets the payment status with data: \nheaders: ".concat(JSON.stringify(y),"\ndata: ").concat(JSON.stringify(d),"\nroute: ").concat(v)),e.next=13,x({headers:y,data:d,route:v,logger:h});case 13:if(g=e.sent,O(g.status)){e.next=17;break}return h.error("Failed to get the status of payment. Request status ".concat(g.status,", data ").concat(g.data)),e.abrupt("return");case 17:return m=g.data,e.abrupt("return",m.status);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),X=function(){var e=Y(q().mark((function e(r){var n,o,a,i,u,c,l,f;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.authorization,a=r.weOmVersion,i=r.logger,u=J({},t.keyGrantType,"client_credentials"),J(n={},t.keyAuthorization,o),J(n,t.keyContentType,s.TypeWwwFrom),c=n,i.info("Generates the access token with data: \nheaders: ".concat(JSON.stringify(c),"\ndata: ").concat(JSON.stringify(P(u)),"\nroute: ").concat(B.webAccessTokenEndPoint(a))),e.next=6,k({headers:c,data:P(u),route:B.webAccessTokenEndPoint(a),logger:i});case 6:if(l=e.sent,O(l.status)){e.next=10;break}return i.error("Request failed to generate the access token.Request status ".concat(l.status," and data: ").concat(l.data)),e.abrupt("return",{message:"Request failed to generate the accessToken",status:l.status,data:l.data});case 10:return f=l.data,e.abrupt("return",{accessToken:f.access_token});case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(){var e=Y(q().mark((function e(r){var n,o,a,u,c,l;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return J(n={},t.keyAuthorization,"Bearer ".concat(r.accessToken)),J(n,t.keyContentType,s.typeJson),a=n,J(o={},t.keyLang,r.language),J(o,t.keyCurrency,r.currency),J(o,t.keyMerchantKey,r.merchantKey),J(o,t.keyOrderId,r.transactionId),J(o,t.keyAmount,r.amount),J(o,t.keyReturnUrl,r.returnUrl),J(o,t.keyCancelUrl,r.cancelUrl),J(o,t.keyWebNotifyUrl,r.notifUrl),J(o,t.keyReference,r.reference),u=o,r.logger.info("Initiate the ORANGE MONEY Payment with data: \nheaders: ".concat(JSON.stringify(a),"\ndata: ").concat(JSON.stringify(u),"\nroute: ").concat(B.initLivePayment(r.countryCode))),e.next=5,k({headers:a,data:u,route:B.initLivePayment(r.countryCode),logger:r.logger});case 5:if(c=e.sent,O(c.status)){e.next=9;break}return r.logger.error("Orange money Initialization failed with status ".concat(c.status,", data ").concat(c.data)),e.abrupt("return",{message:"Initialization failed",status:c.status,data:c.data});case 9:return l=c.data,e.abrupt("return",{status:i.INITIATE_PAYMENT,payToken:l.pay_token,paymentUrl:l.payment_url});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Q(t,e,r){return e&&Z(t.prototype,e),r&&Z(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var tt=Q((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"initializeMobilePayment",new j(this.logger).initializeMobilePayment),$(this,"initializeWebPayment",new V(this.logger).initializeWebPayment),$(this,"checkWebPaymentStatus",new V(this.logger).checkWebPaymentStatus),$(this,"checkMobilePaymentStatus",new j(this.logger).checkMobilePaymentStatus),this.logger=e})),et={status:i.PENDING_PAYMENT,payToken:"MP220806C74C8F5787A9C4F79AED"},rt={status:i.INITIATE_PAYMENT,payToken:"MP220806C74C8F5787A9C4F79AED",paymentUrl:"https://send.com/test"},nt=i.SUCCESS_WEB_PAYMENT,ot=i.SUCCESSFULL_MOBILE_PAYMENT;function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function it(){it=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=w(i,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function h(){}function p(){}var y={};u(y,o,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(T([])));v&&v!==e&&r.call(v,o)&&(y=v);var g=p.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function n(o,a,i,u){var c=s(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==at(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=p,u(g,"constructor",p),u(p,"constructor",h),h.displayName=u(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,i,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new b(c(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(g),u(g,i,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ut(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){ut(a,n,o,i,u,"next",t)}function u(t){ut(a,n,o,i,u,"throw",t)}i(void 0)}))}}function st(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var lt,ft,ht=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.logger=e}var e,r,n,o,a,i;return e=t,r=[{key:"checkMobilePaymentStatus",value:(i=ct(it().mark((function t(e){var r,n,o,a,i;return it().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.apiPassword,n=e.apiUserName,o=e.statusEndPointUrl,a=e.xAuthToken,i=e.payToken,r&&n&&o&&a&&i){t.next=8;break}return this.logger.error(" Failed to check the status. Invalid data provided: ",JSON.stringify(e)),t.abrupt("return",{errorCode:u.invalidData});case 8:return t.abrupt("return",{status:ot});case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"checkWebPaymentStatus",value:(a=ct(it().mark((function t(e){var r,n,o,a,i;return it().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.transactionId,n=e.amount,o=e.payToken,a=e.authorization,i=e.countryCode,n&&r&&a&&o&&i){t.next=8;break}return this.logger.error("Failed to check the status. Invalid data provider: "+JSON.stringify(e)),t.abrupt("return");case 8:return t.abrupt("return",nt);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"initializeMobilePayment",value:(o=ct(it().mark((function t(e){var r,n,o,a,i,c,s,l,f,h;return it().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.apiPassword,n=e.apiUserName,o=e.mobileEndPointURL,a=e.xAuthToken,i=e.transactionId,c=e.amount,s=e.userPhoneNumber,l=e.notifUrl,f=e.pinCode,h=e.receiverPhoneNumber,r&&n&&a&&c&&i&&s&&o&&l&&f&&h){t.next=13;break}return this.logger.error("Initialization failed. Invalid data provided. ",JSON.stringify(e)),t.abrupt("return",{orangeMoneyError:u.invalidData});case 13:return t.abrupt("return",et);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"initializeWebPayment",value:(n=ct(it().mark((function t(e){var r,n,o,a,i,u,c,s,l,f,h;return it().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.language,n=e.authorization,o=e.countryCode,a=e.transactionId,i=e.amount,u=e.notifUrl,c=e.currency,s=e.reference,l=e.merchantKey,f=e.returnUrl,h=e.cancelUrl,r&&o&&i&&a&&u&&n&&c&&s&&l&&f&&h){t.next=13;break}return t.abrupt("return",{message:"Initialization failed. Invalid data provided. ".concat(JSON.stringify(e)),status:404,data:e});case 13:return t.abrupt("return",rt);case 14:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})}],r&&st(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function dt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.SILENT=4]="SILENT"}(ft||(ft={})),pt(lt={},ft.DEBUG,"DEBUG"),pt(lt,ft.INFO,"INFO"),pt(lt,ft.WARN,"WARN"),pt(lt,ft.ERROR,"ERROR"),pt(lt,ft.SILENT,"SILENT");var vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e}var e,r;return e=t,r=[{key:"print",value:function(e){if(!(e.level<t.level))switch(t.printer({name:this.name,level:e.level,message:e.message}),e.level){case ft.DEBUG:console.log(e.message);break;case ft.INFO:console.info(e.message);break;case ft.ERROR:console.error(e.message);break;case ft.WARN:console.warn(e.message)}}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.print({level:ft.DEBUG,message:e.join("\n")})}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.print({level:ft.INFO,message:e.join("\n")})}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.print({level:ft.WARN,message:e.join("\n")})}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.print({level:ft.ERROR,message:e.join("\n")})}}],r&&yt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}dt(vt,"level",ft.DEBUG),dt(vt,"printer",(function(){}));var mt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"createPayment",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vt;switch(t){case b.live:return new tt(e);case b.fake:return new ht(e);default:return new tt(e)}}}],null&&gt(e.prototype,null),r&&gt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();module.exports=r})();
3
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */