ps-apimatic-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +231 -0
  4. data/bin/console +15 -0
  5. data/lib/paysecure_api_documentation_live/api_helper.rb +10 -0
  6. data/lib/paysecure_api_documentation_live/apis/ap_is_api.rb +2969 -0
  7. data/lib/paysecure_api_documentation_live/apis/api.rb +91 -0
  8. data/lib/paysecure_api_documentation_live/apis/base_api.rb +67 -0
  9. data/lib/paysecure_api_documentation_live/apis/cashier_ap_is_api.rb +466 -0
  10. data/lib/paysecure_api_documentation_live/apis/get_balance_api.rb +136 -0
  11. data/lib/paysecure_api_documentation_live/apis/get_balance_api_v2_orchestration_api.rb +40 -0
  12. data/lib/paysecure_api_documentation_live/apis/global_collection_api.rb +381 -0
  13. data/lib/paysecure_api_documentation_live/apis/m_paypal_wallet_api.rb +126 -0
  14. data/lib/paysecure_api_documentation_live/apis/m_virtual_cards_payout_api.rb +182 -0
  15. data/lib/paysecure_api_documentation_live/apis/pay_in_api.rb +1764 -0
  16. data/lib/paysecure_api_documentation_live/apis/pay_out_api.rb +844 -0
  17. data/lib/paysecure_api_documentation_live/apis/payin_api.rb +265 -0
  18. data/lib/paysecure_api_documentation_live/apis/payout_api.rb +196 -0
  19. data/lib/paysecure_api_documentation_live/apis/payout_manual_review_api.rb +175 -0
  20. data/lib/paysecure_api_documentation_live/apis/refund_api.rb +38 -0
  21. data/lib/paysecure_api_documentation_live/apis/transaction_reporting_api.rb +148 -0
  22. data/lib/paysecure_api_documentation_live/apis/trust_score_api.rb +347 -0
  23. data/lib/paysecure_api_documentation_live/client.rb +163 -0
  24. data/lib/paysecure_api_documentation_live/configuration.rb +181 -0
  25. data/lib/paysecure_api_documentation_live/exceptions/api_exception.rb +21 -0
  26. data/lib/paysecure_api_documentation_live/exceptions/cancel_exception.rb +363 -0
  27. data/lib/paysecure_api_documentation_live/exceptions/capture_exception.rb +377 -0
  28. data/lib/paysecure_api_documentation_live/exceptions/empty_refund_amt_exception.rb +51 -0
  29. data/lib/paysecure_api_documentation_live/exceptions/error1_exception.rb +51 -0
  30. data/lib/paysecure_api_documentation_live/exceptions/existing_customer_exception.rb +51 -0
  31. data/lib/paysecure_api_documentation_live/exceptions/failure_exception.rb +51 -0
  32. data/lib/paysecure_api_documentation_live/exceptions/invalid_customer_exception.rb +51 -0
  33. data/lib/paysecure_api_documentation_live/exceptions/invalid_purchase_id_exception.rb +51 -0
  34. data/lib/paysecure_api_documentation_live/exceptions/invalid_session_exception.rb +51 -0
  35. data/lib/paysecure_api_documentation_live/exceptions/m400_bad_request_exception.rb +51 -0
  36. data/lib/paysecure_api_documentation_live/exceptions/m401_unauthorized_exception.rb +51 -0
  37. data/lib/paysecure_api_documentation_live/exceptions/payment_error_exception.rb +51 -0
  38. data/lib/paysecure_api_documentation_live/exceptions/payment_methods_error_exception.rb +55 -0
  39. data/lib/paysecure_api_documentation_live/exceptions/refund_amt_exceeds_purchase_amt_exception.rb +51 -0
  40. data/lib/paysecure_api_documentation_live/exceptions/refund_amt_is0_or_ve_exception.rb +51 -0
  41. data/lib/paysecure_api_documentation_live/exceptions/refund_error_exception.rb +51 -0
  42. data/lib/paysecure_api_documentation_live/exceptions/refund_exceeds_remaining_balance_after_a_partial_refund_exception.rb +51 -0
  43. data/lib/paysecure_api_documentation_live/exceptions/refund_on_an_already_refunded_purchase_exception.rb +51 -0
  44. data/lib/paysecure_api_documentation_live/exceptions/refund_on_failed_or_pending_transactions_exception.rb +51 -0
  45. data/lib/paysecure_api_documentation_live/exceptions/success33_exception.rb +363 -0
  46. data/lib/paysecure_api_documentation_live/exceptions/success36_exception.rb +147 -0
  47. data/lib/paysecure_api_documentation_live/exceptions/success42_exception.rb +46 -0
  48. data/lib/paysecure_api_documentation_live/exceptions/success44_exception.rb +46 -0
  49. data/lib/paysecure_api_documentation_live/exceptions/success51_exception.rb +86 -0
  50. data/lib/paysecure_api_documentation_live/exceptions/transaction_already_refunded_exception.rb +51 -0
  51. data/lib/paysecure_api_documentation_live/exceptions/trust_score_error_exception.rb +51 -0
  52. data/lib/paysecure_api_documentation_live/exceptions/whitelist_upload_failure_exception.rb +57 -0
  53. data/lib/paysecure_api_documentation_live/http/api_response.rb +19 -0
  54. data/lib/paysecure_api_documentation_live/http/auth/oauth_2.rb +53 -0
  55. data/lib/paysecure_api_documentation_live/http/http_call_back.rb +10 -0
  56. data/lib/paysecure_api_documentation_live/http/http_method_enum.rb +10 -0
  57. data/lib/paysecure_api_documentation_live/http/http_request.rb +10 -0
  58. data/lib/paysecure_api_documentation_live/http/http_response.rb +10 -0
  59. data/lib/paysecure_api_documentation_live/http/proxy_settings.rb +22 -0
  60. data/lib/paysecure_api_documentation_live/logging/configuration/api_logging_configuration.rb +186 -0
  61. data/lib/paysecure_api_documentation_live/logging/sdk_logger.rb +17 -0
  62. data/lib/paysecure_api_documentation_live/models/action_status.rb +459 -0
  63. data/lib/paysecure_api_documentation_live/models/aft.rb +239 -0
  64. data/lib/paysecure_api_documentation_live/models/aggregated_balance.rb +104 -0
  65. data/lib/paysecure_api_documentation_live/models/all.rb +82 -0
  66. data/lib/paysecure_api_documentation_live/models/applepay_decrypted_payload.rb +142 -0
  67. data/lib/paysecure_api_documentation_live/models/applepay_param.rb +74 -0
  68. data/lib/paysecure_api_documentation_live/models/applepay_param1.rb +76 -0
  69. data/lib/paysecure_api_documentation_live/models/applepay_token.rb +100 -0
  70. data/lib/paysecure_api_documentation_live/models/approve_payout_with_remarks_request.rb +73 -0
  71. data/lib/paysecure_api_documentation_live/models/attempt.rb +147 -0
  72. data/lib/paysecure_api_documentation_live/models/attempt1.rb +138 -0
  73. data/lib/paysecure_api_documentation_live/models/attempt2.rb +142 -0
  74. data/lib/paysecure_api_documentation_live/models/attempt26.rb +147 -0
  75. data/lib/paysecure_api_documentation_live/models/attempt27.rb +138 -0
  76. data/lib/paysecure_api_documentation_live/models/attempt28.rb +147 -0
  77. data/lib/paysecure_api_documentation_live/models/attempt4.rb +138 -0
  78. data/lib/paysecure_api_documentation_live/models/attempt5.rb +138 -0
  79. data/lib/paysecure_api_documentation_live/models/balance.rb +104 -0
  80. data/lib/paysecure_api_documentation_live/models/balance1.rb +95 -0
  81. data/lib/paysecure_api_documentation_live/models/bank_account.rb +82 -0
  82. data/lib/paysecure_api_documentation_live/models/base_model.rb +110 -0
  83. data/lib/paysecure_api_documentation_live/models/beneficiary_detail.rb +110 -0
  84. data/lib/paysecure_api_documentation_live/models/beneficiary_detail1.rb +95 -0
  85. data/lib/paysecure_api_documentation_live/models/beneficiary_detail2.rb +96 -0
  86. data/lib/paysecure_api_documentation_live/models/beneficiary_detail3.rb +95 -0
  87. data/lib/paysecure_api_documentation_live/models/beneficiary_detail4.rb +134 -0
  88. data/lib/paysecure_api_documentation_live/models/beneficiary_detail5.rb +72 -0
  89. data/lib/paysecure_api_documentation_live/models/beneficiary_detail6.rb +82 -0
  90. data/lib/paysecure_api_documentation_live/models/bulk_update_invoice_no.rb +100 -0
  91. data/lib/paysecure_api_documentation_live/models/bulk_update_invoice_no_request.rb +82 -0
  92. data/lib/paysecure_api_documentation_live/models/by_country.rb +72 -0
  93. data/lib/paysecure_api_documentation_live/models/capture_request.rb +75 -0
  94. data/lib/paysecure_api_documentation_live/models/capture_txn.rb +318 -0
  95. data/lib/paysecure_api_documentation_live/models/check_transaction_allowed_request.rb +82 -0
  96. data/lib/paysecure_api_documentation_live/models/check_white_list_doesn_t_exists.rb +73 -0
  97. data/lib/paysecure_api_documentation_live/models/check_white_list_exists.rb +73 -0
  98. data/lib/paysecure_api_documentation_live/models/check_white_list_request.rb +82 -0
  99. data/lib/paysecure_api_documentation_live/models/checking_balance_partial_success.rb +119 -0
  100. data/lib/paysecure_api_documentation_live/models/checking_balance_payout_error.rb +82 -0
  101. data/lib/paysecure_api_documentation_live/models/checking_balance_payout_error2.rb +111 -0
  102. data/lib/paysecure_api_documentation_live/models/checking_balance_payout_success.rb +99 -0
  103. data/lib/paysecure_api_documentation_live/models/checking_balance_payout_success2.rb +119 -0
  104. data/lib/paysecure_api_documentation_live/models/checking_balance_request.rb +74 -0
  105. data/lib/paysecure_api_documentation_live/models/client.rb +146 -0
  106. data/lib/paysecure_api_documentation_live/models/client1.rb +154 -0
  107. data/lib/paysecure_api_documentation_live/models/client10.rb +180 -0
  108. data/lib/paysecure_api_documentation_live/models/client100.rb +146 -0
  109. data/lib/paysecure_api_documentation_live/models/client103.rb +154 -0
  110. data/lib/paysecure_api_documentation_live/models/client104.rb +192 -0
  111. data/lib/paysecure_api_documentation_live/models/client12.rb +216 -0
  112. data/lib/paysecure_api_documentation_live/models/client13.rb +109 -0
  113. data/lib/paysecure_api_documentation_live/models/client15.rb +180 -0
  114. data/lib/paysecure_api_documentation_live/models/client17.rb +100 -0
  115. data/lib/paysecure_api_documentation_live/models/client2.rb +268 -0
  116. data/lib/paysecure_api_documentation_live/models/client24.rb +154 -0
  117. data/lib/paysecure_api_documentation_live/models/client26.rb +90 -0
  118. data/lib/paysecure_api_documentation_live/models/client29.rb +164 -0
  119. data/lib/paysecure_api_documentation_live/models/client35.rb +162 -0
  120. data/lib/paysecure_api_documentation_live/models/client37.rb +109 -0
  121. data/lib/paysecure_api_documentation_live/models/client4.rb +172 -0
  122. data/lib/paysecure_api_documentation_live/models/client41.rb +146 -0
  123. data/lib/paysecure_api_documentation_live/models/client45.rb +117 -0
  124. data/lib/paysecure_api_documentation_live/models/client46.rb +126 -0
  125. data/lib/paysecure_api_documentation_live/models/client52.rb +162 -0
  126. data/lib/paysecure_api_documentation_live/models/client57.rb +73 -0
  127. data/lib/paysecure_api_documentation_live/models/client6.rb +250 -0
  128. data/lib/paysecure_api_documentation_live/models/client65.rb +127 -0
  129. data/lib/paysecure_api_documentation_live/models/client66.rb +162 -0
  130. data/lib/paysecure_api_documentation_live/models/client67.rb +109 -0
  131. data/lib/paysecure_api_documentation_live/models/client68.rb +117 -0
  132. data/lib/paysecure_api_documentation_live/models/client7.rb +154 -0
  133. data/lib/paysecure_api_documentation_live/models/client70.rb +162 -0
  134. data/lib/paysecure_api_documentation_live/models/client75.rb +180 -0
  135. data/lib/paysecure_api_documentation_live/models/client8.rb +135 -0
  136. data/lib/paysecure_api_documentation_live/models/client80.rb +146 -0
  137. data/lib/paysecure_api_documentation_live/models/client86.rb +127 -0
  138. data/lib/paysecure_api_documentation_live/models/client88.rb +162 -0
  139. data/lib/paysecure_api_documentation_live/models/client9.rb +190 -0
  140. data/lib/paysecure_api_documentation_live/models/content.rb +83 -0
  141. data/lib/paysecure_api_documentation_live/models/country_names.rb +72 -0
  142. data/lib/paysecure_api_documentation_live/models/create_brand_id.rb +100 -0
  143. data/lib/paysecure_api_documentation_live/models/create_brand_id_request.rb +72 -0
  144. data/lib/paysecure_api_documentation_live/models/create_customer_request.rb +165 -0
  145. data/lib/paysecure_api_documentation_live/models/create_customer_request1.rb +182 -0
  146. data/lib/paysecure_api_documentation_live/models/create_merchant_api.rb +100 -0
  147. data/lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb +348 -0
  148. data/lib/paysecure_api_documentation_live/models/create_merchant_api_token.rb +100 -0
  149. data/lib/paysecure_api_documentation_live/models/create_merchant_api_token_request.rb +82 -0
  150. data/lib/paysecure_api_documentation_live/models/create_pay_out_request.rb +140 -0
  151. data/lib/paysecure_api_documentation_live/models/create_pay_out_request1.rb +130 -0
  152. data/lib/paysecure_api_documentation_live/models/create_pay_out_request3.rb +170 -0
  153. data/lib/paysecure_api_documentation_live/models/create_pay_out_request4.rb +130 -0
  154. data/lib/paysecure_api_documentation_live/models/create_pay_out_request5.rb +139 -0
  155. data/lib/paysecure_api_documentation_live/models/create_pay_out_request6.rb +181 -0
  156. data/lib/paysecure_api_documentation_live/models/create_pay_out_request7.rb +140 -0
  157. data/lib/paysecure_api_documentation_live/models/create_payout_error.rb +82 -0
  158. data/lib/paysecure_api_documentation_live/models/create_payout_success.rb +630 -0
  159. data/lib/paysecure_api_documentation_live/models/create_payout_success1.rb +237 -0
  160. data/lib/paysecure_api_documentation_live/models/create_payout_success2.rb +229 -0
  161. data/lib/paysecure_api_documentation_live/models/create_purchase.rb +82 -0
  162. data/lib/paysecure_api_documentation_live/models/create_purchase_cit_request.rb +179 -0
  163. data/lib/paysecure_api_documentation_live/models/create_purchase_mit_request.rb +170 -0
  164. data/lib/paysecure_api_documentation_live/models/create_purchase_request.rb +141 -0
  165. data/lib/paysecure_api_documentation_live/models/create_purchase_request1.rb +153 -0
  166. data/lib/paysecure_api_documentation_live/models/create_purchase_request2.rb +161 -0
  167. data/lib/paysecure_api_documentation_live/models/create_session_cit_request.rb +188 -0
  168. data/lib/paysecure_api_documentation_live/models/customer_request.rb +182 -0
  169. data/lib/paysecure_api_documentation_live/models/customer_request1.rb +163 -0
  170. data/lib/paysecure_api_documentation_live/models/data.rb +154 -0
  171. data/lib/paysecure_api_documentation_live/models/data11.rb +91 -0
  172. data/lib/paysecure_api_documentation_live/models/data12.rb +91 -0
  173. data/lib/paysecure_api_documentation_live/models/data13.rb +92 -0
  174. data/lib/paysecure_api_documentation_live/models/data14.rb +99 -0
  175. data/lib/paysecure_api_documentation_live/models/data16.rb +109 -0
  176. data/lib/paysecure_api_documentation_live/models/data18.rb +84 -0
  177. data/lib/paysecure_api_documentation_live/models/data2.rb +242 -0
  178. data/lib/paysecure_api_documentation_live/models/data4.rb +91 -0
  179. data/lib/paysecure_api_documentation_live/models/data5.rb +90 -0
  180. data/lib/paysecure_api_documentation_live/models/data7.rb +74 -0
  181. data/lib/paysecure_api_documentation_live/models/data8.rb +91 -0
  182. data/lib/paysecure_api_documentation_live/models/data9.rb +348 -0
  183. data/lib/paysecure_api_documentation_live/models/datum.rb +82 -0
  184. data/lib/paysecure_api_documentation_live/models/delete_brand_id.rb +100 -0
  185. data/lib/paysecure_api_documentation_live/models/delete_merchant_api.rb +100 -0
  186. data/lib/paysecure_api_documentation_live/models/delete_merchant_token.rb +100 -0
  187. data/lib/paysecure_api_documentation_live/models/empty_refund_amt1.rb +82 -0
  188. data/lib/paysecure_api_documentation_live/models/error.rb +82 -0
  189. data/lib/paysecure_api_documentation_live/models/error3.rb +247 -0
  190. data/lib/paysecure_api_documentation_live/models/error7.rb +95 -0
  191. data/lib/paysecure_api_documentation_live/models/extra.rb +139 -0
  192. data/lib/paysecure_api_documentation_live/models/extra10.rb +82 -0
  193. data/lib/paysecure_api_documentation_live/models/extra5.rb +148 -0
  194. data/lib/paysecure_api_documentation_live/models/extra52.rb +148 -0
  195. data/lib/paysecure_api_documentation_live/models/extra57.rb +153 -0
  196. data/lib/paysecure_api_documentation_live/models/extra8.rb +82 -0
  197. data/lib/paysecure_api_documentation_live/models/extra_param.rb +102 -0
  198. data/lib/paysecure_api_documentation_live/models/extra_param1.rb +74 -0
  199. data/lib/paysecure_api_documentation_live/models/extra_param10.rb +100 -0
  200. data/lib/paysecure_api_documentation_live/models/extra_param13.rb +74 -0
  201. data/lib/paysecure_api_documentation_live/models/extra_param2.rb +75 -0
  202. data/lib/paysecure_api_documentation_live/models/extra_param20.rb +112 -0
  203. data/lib/paysecure_api_documentation_live/models/extra_param21.rb +86 -0
  204. data/lib/paysecure_api_documentation_live/models/extra_param25.rb +75 -0
  205. data/lib/paysecure_api_documentation_live/models/extra_param26.rb +72 -0
  206. data/lib/paysecure_api_documentation_live/models/extra_param3.rb +75 -0
  207. data/lib/paysecure_api_documentation_live/models/extra_param4.rb +74 -0
  208. data/lib/paysecure_api_documentation_live/models/extra_param5.rb +74 -0
  209. data/lib/paysecure_api_documentation_live/models/extra_param6.rb +75 -0
  210. data/lib/paysecure_api_documentation_live/models/extra_param7.rb +91 -0
  211. data/lib/paysecure_api_documentation_live/models/extra_param8.rb +91 -0
  212. data/lib/paysecure_api_documentation_live/models/extra_param9.rb +91 -0
  213. data/lib/paysecure_api_documentation_live/models/failure7.rb +243 -0
  214. data/lib/paysecure_api_documentation_live/models/fee.rb +118 -0
  215. data/lib/paysecure_api_documentation_live/models/gateway.rb +111 -0
  216. data/lib/paysecure_api_documentation_live/models/gateway1.rb +134 -0
  217. data/lib/paysecure_api_documentation_live/models/gateway2.rb +100 -0
  218. data/lib/paysecure_api_documentation_live/models/get_error_status.rb +82 -0
  219. data/lib/paysecure_api_documentation_live/models/get_global_accounts.rb +109 -0
  220. data/lib/paysecure_api_documentation_live/models/get_merchants.rb +100 -0
  221. data/lib/paysecure_api_documentation_live/models/get_missing_invoice_transactions.rb +100 -0
  222. data/lib/paysecure_api_documentation_live/models/get_settlement_data.rb +90 -0
  223. data/lib/paysecure_api_documentation_live/models/get_single_merchant.rb +100 -0
  224. data/lib/paysecure_api_documentation_live/models/get_status.rb +221 -0
  225. data/lib/paysecure_api_documentation_live/models/get_status_error.rb +82 -0
  226. data/lib/paysecure_api_documentation_live/models/get_success_status.rb +248 -0
  227. data/lib/paysecure_api_documentation_live/models/get_success_status1.rb +248 -0
  228. data/lib/paysecure_api_documentation_live/models/get_success_status2.rb +249 -0
  229. data/lib/paysecure_api_documentation_live/models/get_success_status3.rb +249 -0
  230. data/lib/paysecure_api_documentation_live/models/googlepay_decrypted_payload.rb +115 -0
  231. data/lib/paysecure_api_documentation_live/models/googlepay_param.rb +86 -0
  232. data/lib/paysecure_api_documentation_live/models/googlepay_param1.rb +87 -0
  233. data/lib/paysecure_api_documentation_live/models/header.rb +94 -0
  234. data/lib/paysecure_api_documentation_live/models/invalid_purchase_id1.rb +82 -0
  235. data/lib/paysecure_api_documentation_live/models/issuer_details.rb +159 -0
  236. data/lib/paysecure_api_documentation_live/models/issuer_details1.rb +168 -0
  237. data/lib/paysecure_api_documentation_live/models/issuer_details11.rb +101 -0
  238. data/lib/paysecure_api_documentation_live/models/m202_success.rb +563 -0
  239. data/lib/paysecure_api_documentation_live/models/mandate.rb +130 -0
  240. data/lib/paysecure_api_documentation_live/models/mandate2.rb +144 -0
  241. data/lib/paysecure_api_documentation_live/models/mandate4.rb +202 -0
  242. data/lib/paysecure_api_documentation_live/models/merchant.rb +348 -0
  243. data/lib/paysecure_api_documentation_live/models/metadata.rb +97 -0
  244. data/lib/paysecure_api_documentation_live/models/names.rb +265 -0
  245. data/lib/paysecure_api_documentation_live/models/new_request.rb +247 -0
  246. data/lib/paysecure_api_documentation_live/models/new_request_request.rb +139 -0
  247. data/lib/paysecure_api_documentation_live/models/open_banking_eu_uk.rb +515 -0
  248. data/lib/paysecure_api_documentation_live/models/optional_input.rb +795 -0
  249. data/lib/paysecure_api_documentation_live/models/pagination.rb +136 -0
  250. data/lib/paysecure_api_documentation_live/models/partial_refund_api_request.rb +82 -0
  251. data/lib/paysecure_api_documentation_live/models/partial_refund_status_api_request.rb +74 -0
  252. data/lib/paysecure_api_documentation_live/models/pause_mandate.rb +111 -0
  253. data/lib/paysecure_api_documentation_live/models/pause_mandate_request.rb +103 -0
  254. data/lib/paysecure_api_documentation_live/models/pay_in_details.rb +100 -0
  255. data/lib/paysecure_api_documentation_live/models/pay_in_details10.rb +109 -0
  256. data/lib/paysecure_api_documentation_live/models/pay_in_details2.rb +293 -0
  257. data/lib/paysecure_api_documentation_live/models/pay_in_details3.rb +93 -0
  258. data/lib/paysecure_api_documentation_live/models/pay_in_details4.rb +96 -0
  259. data/lib/paysecure_api_documentation_live/models/pay_in_details6.rb +83 -0
  260. data/lib/paysecure_api_documentation_live/models/pay_in_details7.rb +90 -0
  261. data/lib/paysecure_api_documentation_live/models/pay_out_details.rb +100 -0
  262. data/lib/paysecure_api_documentation_live/models/pay_out_details1.rb +92 -0
  263. data/lib/paysecure_api_documentation_live/models/pay_out_details3.rb +74 -0
  264. data/lib/paysecure_api_documentation_live/models/pay_out_request.rb +179 -0
  265. data/lib/paysecure_api_documentation_live/models/pay_out_request1.rb +180 -0
  266. data/lib/paysecure_api_documentation_live/models/pay_out_request3.rb +179 -0
  267. data/lib/paysecure_api_documentation_live/models/payin_api_request.rb +153 -0
  268. data/lib/paysecure_api_documentation_live/models/payment.rb +169 -0
  269. data/lib/paysecure_api_documentation_live/models/payment17.rb +169 -0
  270. data/lib/paysecure_api_documentation_live/models/payment3.rb +169 -0
  271. data/lib/paysecure_api_documentation_live/models/payment4.rb +169 -0
  272. data/lib/paysecure_api_documentation_live/models/payment_data.rb +85 -0
  273. data/lib/paysecure_api_documentation_live/models/payment_method_details.rb +120 -0
  274. data/lib/paysecure_api_documentation_live/models/payment_method_success.rb +111 -0
  275. data/lib/paysecure_api_documentation_live/models/payout_api_request.rb +170 -0
  276. data/lib/paysecure_api_documentation_live/models/payout_api_request1.rb +130 -0
  277. data/lib/paysecure_api_documentation_live/models/payout_request2.rb +161 -0
  278. data/lib/paysecure_api_documentation_live/models/payout_session.rb +118 -0
  279. data/lib/paysecure_api_documentation_live/models/payout_session_request.rb +197 -0
  280. data/lib/paysecure_api_documentation_live/models/payout_session_with_crypto_conversion.rb +118 -0
  281. data/lib/paysecure_api_documentation_live/models/pix_payload.rb +93 -0
  282. data/lib/paysecure_api_documentation_live/models/product.rb +82 -0
  283. data/lib/paysecure_api_documentation_live/models/product1.rb +109 -0
  284. data/lib/paysecure_api_documentation_live/models/product16.rb +73 -0
  285. data/lib/paysecure_api_documentation_live/models/product17.rb +73 -0
  286. data/lib/paysecure_api_documentation_live/models/product2.rb +109 -0
  287. data/lib/paysecure_api_documentation_live/models/product48.rb +82 -0
  288. data/lib/paysecure_api_documentation_live/models/product49.rb +109 -0
  289. data/lib/paysecure_api_documentation_live/models/product7.rb +82 -0
  290. data/lib/paysecure_api_documentation_live/models/purchase.rb +91 -0
  291. data/lib/paysecure_api_documentation_live/models/purchase1.rb +184 -0
  292. data/lib/paysecure_api_documentation_live/models/purchase10.rb +91 -0
  293. data/lib/paysecure_api_documentation_live/models/purchase16.rb +128 -0
  294. data/lib/paysecure_api_documentation_live/models/purchase17.rb +128 -0
  295. data/lib/paysecure_api_documentation_live/models/purchase2.rb +164 -0
  296. data/lib/paysecure_api_documentation_live/models/purchase21.rb +164 -0
  297. data/lib/paysecure_api_documentation_live/models/purchase24.rb +174 -0
  298. data/lib/paysecure_api_documentation_live/models/purchase26.rb +184 -0
  299. data/lib/paysecure_api_documentation_live/models/purchase45.rb +175 -0
  300. data/lib/paysecure_api_documentation_live/models/purchase47.rb +183 -0
  301. data/lib/paysecure_api_documentation_live/models/purchase48.rb +91 -0
  302. data/lib/paysecure_api_documentation_live/models/purchase49.rb +183 -0
  303. data/lib/paysecure_api_documentation_live/models/purchase52.rb +82 -0
  304. data/lib/paysecure_api_documentation_live/models/purchase55.rb +99 -0
  305. data/lib/paysecure_api_documentation_live/models/purchase56.rb +175 -0
  306. data/lib/paysecure_api_documentation_live/models/purchase62.rb +174 -0
  307. data/lib/paysecure_api_documentation_live/models/purchase7.rb +100 -0
  308. data/lib/paysecure_api_documentation_live/models/purchase73.rb +361 -0
  309. data/lib/paysecure_api_documentation_live/models/purchase8.rb +184 -0
  310. data/lib/paysecure_api_documentation_live/models/purchase9.rb +165 -0
  311. data/lib/paysecure_api_documentation_live/models/purchase_error.rb +82 -0
  312. data/lib/paysecure_api_documentation_live/models/purchase_request.rb +161 -0
  313. data/lib/paysecure_api_documentation_live/models/purchase_request1.rb +162 -0
  314. data/lib/paysecure_api_documentation_live/models/purchase_request2.rb +162 -0
  315. data/lib/paysecure_api_documentation_live/models/purchase_request3.rb +142 -0
  316. data/lib/paysecure_api_documentation_live/models/purchase_request4.rb +170 -0
  317. data/lib/paysecure_api_documentation_live/models/purchase_session_request.rb +189 -0
  318. data/lib/paysecure_api_documentation_live/models/purchase_success.rb +497 -0
  319. data/lib/paysecure_api_documentation_live/models/purchase_success1.rb +479 -0
  320. data/lib/paysecure_api_documentation_live/models/purchase_success2.rb +462 -0
  321. data/lib/paysecure_api_documentation_live/models/purchase_success3.rb +471 -0
  322. data/lib/paysecure_api_documentation_live/models/purchase_success4.rb +527 -0
  323. data/lib/paysecure_api_documentation_live/models/purchase_sucess.rb +471 -0
  324. data/lib/paysecure_api_documentation_live/models/purchases1.rb +479 -0
  325. data/lib/paysecure_api_documentation_live/models/purchases_decrypted_flow_request.rb +161 -0
  326. data/lib/paysecure_api_documentation_live/models/purchases_decrypted_flow_request1.rb +140 -0
  327. data/lib/paysecure_api_documentation_live/models/purchases_encrypted_flow_request.rb +161 -0
  328. data/lib/paysecure_api_documentation_live/models/purchases_encrypted_flow_request1.rb +140 -0
  329. data/lib/paysecure_api_documentation_live/models/purchases_error.rb +378 -0
  330. data/lib/paysecure_api_documentation_live/models/purchases_request.rb +153 -0
  331. data/lib/paysecure_api_documentation_live/models/purchases_request11.rb +161 -0
  332. data/lib/paysecure_api_documentation_live/models/purchases_request2.rb +161 -0
  333. data/lib/paysecure_api_documentation_live/models/purchases_request3.rb +153 -0
  334. data/lib/paysecure_api_documentation_live/models/purchases_request4.rb +161 -0
  335. data/lib/paysecure_api_documentation_live/models/purchases_request5.rb +153 -0
  336. data/lib/paysecure_api_documentation_live/models/purchases_request6.rb +153 -0
  337. data/lib/paysecure_api_documentation_live/models/purchases_request8.rb +161 -0
  338. data/lib/paysecure_api_documentation_live/models/purchases_request9.rb +171 -0
  339. data/lib/paysecure_api_documentation_live/models/purchases_success.rb +397 -0
  340. data/lib/paysecure_api_documentation_live/models/purchases_success1.rb +497 -0
  341. data/lib/paysecure_api_documentation_live/models/purchases_success2.rb +480 -0
  342. data/lib/paysecure_api_documentation_live/models/purchases_success5.rb +470 -0
  343. data/lib/paysecure_api_documentation_live/models/refund_amt_exceeds_purchase_amt1.rb +82 -0
  344. data/lib/paysecure_api_documentation_live/models/refund_amt_is0_or_ve1.rb +82 -0
  345. data/lib/paysecure_api_documentation_live/models/refund_exceeds_remaining_balance_after_a_partial_refund1.rb +82 -0
  346. data/lib/paysecure_api_documentation_live/models/refund_on_an_already_refunded_purchase1.rb +82 -0
  347. data/lib/paysecure_api_documentation_live/models/refund_on_failed_or_pending_transactions1.rb +82 -0
  348. data/lib/paysecure_api_documentation_live/models/refund_pending.rb +388 -0
  349. data/lib/paysecure_api_documentation_live/models/refund_pending1.rb +388 -0
  350. data/lib/paysecure_api_documentation_live/models/refund_success.rb +388 -0
  351. data/lib/paysecure_api_documentation_live/models/refund_success1.rb +388 -0
  352. data/lib/paysecure_api_documentation_live/models/reject_payout_with_remarks_request.rb +73 -0
  353. data/lib/paysecure_api_documentation_live/models/request_global_account.rb +90 -0
  354. data/lib/paysecure_api_documentation_live/models/request_global_account_request.rb +82 -0
  355. data/lib/paysecure_api_documentation_live/models/requiredinput.rb +90 -0
  356. data/lib/paysecure_api_documentation_live/models/revoke_mandate_request.rb +82 -0
  357. data/lib/paysecure_api_documentation_live/models/routing_param.rb +83 -0
  358. data/lib/paysecure_api_documentation_live/models/s2_s_api_request.rb +202 -0
  359. data/lib/paysecure_api_documentation_live/models/s2_s_payment_request.rb +184 -0
  360. data/lib/paysecure_api_documentation_live/models/s2_srequest.rb +202 -0
  361. data/lib/paysecure_api_documentation_live/models/session_with_crypto_conversion.rb +118 -0
  362. data/lib/paysecure_api_documentation_live/models/settlement.rb +109 -0
  363. data/lib/paysecure_api_documentation_live/models/status_history.rb +82 -0
  364. data/lib/paysecure_api_documentation_live/models/status_history8.rb +112 -0
  365. data/lib/paysecure_api_documentation_live/models/success.rb +535 -0
  366. data/lib/paysecure_api_documentation_live/models/success1.rb +90 -0
  367. data/lib/paysecure_api_documentation_live/models/success10.rb +470 -0
  368. data/lib/paysecure_api_documentation_live/models/success11.rb +470 -0
  369. data/lib/paysecure_api_documentation_live/models/success12.rb +268 -0
  370. data/lib/paysecure_api_documentation_live/models/success13.rb +526 -0
  371. data/lib/paysecure_api_documentation_live/models/success14.rb +118 -0
  372. data/lib/paysecure_api_documentation_live/models/success16.rb +450 -0
  373. data/lib/paysecure_api_documentation_live/models/success17.rb +461 -0
  374. data/lib/paysecure_api_documentation_live/models/success18.rb +247 -0
  375. data/lib/paysecure_api_documentation_live/models/success19.rb +228 -0
  376. data/lib/paysecure_api_documentation_live/models/success2.rb +369 -0
  377. data/lib/paysecure_api_documentation_live/models/success21.rb +256 -0
  378. data/lib/paysecure_api_documentation_live/models/success22.rb +462 -0
  379. data/lib/paysecure_api_documentation_live/models/success23.rb +252 -0
  380. data/lib/paysecure_api_documentation_live/models/success24.rb +99 -0
  381. data/lib/paysecure_api_documentation_live/models/success29.rb +221 -0
  382. data/lib/paysecure_api_documentation_live/models/success3.rb +462 -0
  383. data/lib/paysecure_api_documentation_live/models/success32.rb +129 -0
  384. data/lib/paysecure_api_documentation_live/models/success38.rb +552 -0
  385. data/lib/paysecure_api_documentation_live/models/success39.rb +100 -0
  386. data/lib/paysecure_api_documentation_live/models/success40.rb +82 -0
  387. data/lib/paysecure_api_documentation_live/models/success41.rb +553 -0
  388. data/lib/paysecure_api_documentation_live/models/success46.rb +85 -0
  389. data/lib/paysecure_api_documentation_live/models/success47.rb +527 -0
  390. data/lib/paysecure_api_documentation_live/models/success49.rb +73 -0
  391. data/lib/paysecure_api_documentation_live/models/success5.rb +229 -0
  392. data/lib/paysecure_api_documentation_live/models/success6.rb +100 -0
  393. data/lib/paysecure_api_documentation_live/models/success7.rb +453 -0
  394. data/lib/paysecure_api_documentation_live/models/success8.rb +243 -0
  395. data/lib/paysecure_api_documentation_live/models/to_address.rb +90 -0
  396. data/lib/paysecure_api_documentation_live/models/to_address1.rb +90 -0
  397. data/lib/paysecure_api_documentation_live/models/transaction.rb +101 -0
  398. data/lib/paysecure_api_documentation_live/models/transaction_already_refunded1.rb +82 -0
  399. data/lib/paysecure_api_documentation_live/models/transaction_data.rb +110 -0
  400. data/lib/paysecure_api_documentation_live/models/transaction_data1.rb +119 -0
  401. data/lib/paysecure_api_documentation_live/models/transaction_data2.rb +119 -0
  402. data/lib/paysecure_api_documentation_live/models/transaction_data3.rb +119 -0
  403. data/lib/paysecure_api_documentation_live/models/transaction_data37.rb +119 -0
  404. data/lib/paysecure_api_documentation_live/models/transaction_data40.rb +119 -0
  405. data/lib/paysecure_api_documentation_live/models/transaction_data41.rb +119 -0
  406. data/lib/paysecure_api_documentation_live/models/transaction_data6.rb +119 -0
  407. data/lib/paysecure_api_documentation_live/models/transaction_data7.rb +119 -0
  408. data/lib/paysecure_api_documentation_live/models/trust_score_detailed_request.rb +82 -0
  409. data/lib/paysecure_api_documentation_live/models/trust_score_exists.rb +145 -0
  410. data/lib/paysecure_api_documentation_live/models/trust_score_exists1.rb +75 -0
  411. data/lib/paysecure_api_documentation_live/models/update_merchant.rb +100 -0
  412. data/lib/paysecure_api_documentation_live/models/update_merchant_request.rb +302 -0
  413. data/lib/paysecure_api_documentation_live/models/whitelist_upload_success.rb +92 -0
  414. data/lib/paysecure_api_documentation_live/utilities/date_time_helper.rb +11 -0
  415. data/lib/paysecure_api_documentation_live/utilities/file_wrapper.rb +28 -0
  416. data/lib/paysecure_api_documentation_live/utilities/union_type_lookup.rb +50 -0
  417. data/lib/paysecure_api_documentation_live.rb +528 -0
  418. metadata +501 -0
@@ -0,0 +1,1764 @@
1
+ # paysecure_api_documentation_live
2
+ #
3
+ # This file was automatically generated
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module PaysecureApiDocumentationLive
7
+ # PayInApi
8
+ class PayInApi < BaseApi
9
+ # To Initiate a payment, the very first call to make is `/purchases` with
10
+ # the required data in the request body.
11
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
12
+ # request body) and `API key` (in the header) which can be located in the
13
+ # Dashboard section of your merchant account login.
14
+ # The request body structure is shown on the request body of the example
15
+ # request shown here.
16
+ # The following (see table below) are the mandatory parameters that are
17
+ # required to create a purchase request.
18
+ # ### **Mandatory parameters in the request body:**
19
+ # | **Parameter** | **Notes** |
20
+ # | --- | --- |
21
+ # | client.email | An Identifier for a user |
22
+ # | client.city | An Identifier for a user |
23
+ # | client.country | ISO-3166 Country Code. It must be upper case. <br>This
24
+ # should be "CA" for Interac |
25
+ # | client.stateCode | Example “AL”, “XZ”.. Must be in upper case. |
26
+ # | client.street_address | |
27
+ # | client.zip_code | |
28
+ # | client.phone | |
29
+ # | client.full_name | |
30
+ # | purchase.currency | ISO 4217 code for currency you want to send the
31
+ # transaction in. <br>This should be 'CAD' for Interac |
32
+ # | purchase.products.name | name of the product or service |
33
+ # | purchase.products.price | Price in decimal format. <br>example 1:
34
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
35
+ # 37 cents , should be sent as 10.37 |
36
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
37
+ # |
38
+ # | success_redirect | URL to send the user if the transactions is
39
+ # successful |
40
+ # | pending_redirect | URL to send the user if the transactions is in
41
+ # progress |
42
+ # | failure_redirect | URL to send the user if the transactions is
43
+ # UNSUCCESSFUL |
44
+ # ## Optional Parameters
45
+ # ### expireInMin
46
+ # The `purchase.expireInMin`, when passed in the PayIn request, sets the
47
+ # time window within which a customer should make the Interac payment
48
+ # through their bank's app. If a customer doesn't complete the payment
49
+ # within the configured time window, the status of the payment will be
50
+ # marked as 'EXPIRED' in Paysecure.
51
+ # However, in certain cases, a payment made outside of this window could
52
+ # still be successful i.e. customer's account may be debited which would
53
+ # result in inconsistencies among Paysecure's, merchant's and customer's
54
+ # status of the transaction. To avoid such cases it is advised to set the
55
+ # expiry time limit appropriately and advise the customers to make payment
56
+ # within this window. However, if there is an inconsistency between the
57
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
58
+ # will reconcile the amounts during the settlement.
59
+ # ### merchantRef
60
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
61
+ # for merchants to specify. Its inclusion offers two significant advantages
62
+ # for the merchant:
63
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
64
+ # it acts as a unique identifier. This means that if a second purchase
65
+ # request is made using the same `merchantRef` (reference number), the
66
+ # system will recognize it and prevent duplicate transactions from
67
+ # occurring. This prevents unintended or duplicate purchases.
68
+ #
69
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
70
+ # response from the initial purchase request times out or the 'purchaseId'
71
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
72
+ # detailed transaction information. This ensures they can track and access
73
+ # the specific purchase details related to that reference, even if the
74
+ # immediate response was not received.
75
+ #
76
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
77
+ # platform will automatically assign and use an internal 'purchaseId' as a
78
+ # reference for that transaction.
79
+ # ### paymentMethod
80
+ # The `paymentMethod` parameter identifies which payment solution merchant
81
+ # wants to use to perform a transaction. If parameter is provided, than
82
+ # Paysecure will perform direct payment with the selected payment method
83
+ # instead of loading Paysecure URL.
84
+ # ### Possible Error Messages
85
+ # | **Error Messages** | **Description** |
86
+ # | --- | --- |
87
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
88
+ # | Enter Valid Email | |
89
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
90
+ # parameter | |
91
+ # | Please pass Valid State Code | |
92
+ # | Please pass valid street address in \\"street_address\\" parameter | |
93
+ # | Please pass valid city name in \\"city\\" parameter | |
94
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
95
+ # | You are not Allowed for Live Transaction | |
96
+ # | Minimum amount is not set for this merchant | |
97
+ # | success_redirect/failure_redirect/brand_id is missing | |
98
+ # | brand_id cannot be null | |
99
+ # | success_redirect cannot be null | |
100
+ # | failure_redirect cannot be null | |
101
+ # | Invalid failure_redirect: minimum 10 characters | |
102
+ # | purchase.products.price cannot be null | |
103
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
104
+ # |
105
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
106
+ # | Currency "{curr_name}" is Not Allowed | |
107
+ # | Transaction amount must be equal or greater to minimum trans amount | |
108
+ # | Allowed Limit for this card for particular time period has been consumed
109
+ # | |
110
+ # **Note:** For certain use cases, in addition to long format purchase Id,
111
+ # Paysecure also provides a 7 digit unique code for each purchase starting
112
+ # with digit 4, eg 4000001
113
+ # _“purchaseIdShortCode”: “4000013"_
114
+ # @param [PurchasesRequest] body Required parameter: TODO: type description
115
+ # here
116
+ # @return [ApiResponse] Complete http response with raw body and status code.
117
+ def purchases(body)
118
+ @api_call
119
+ .request(new_request_builder(HttpMethodEnum::POST,
120
+ '/api/v1/purchases',
121
+ Server::SERVER_3)
122
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
123
+ .body_param(new_parameter(body)
124
+ .is_required(true))
125
+ .header_param(new_parameter('application/json', key: 'accept'))
126
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
127
+ .response(new_response_handler
128
+ .deserializer(APIHelper.method(:custom_type_deserializer))
129
+ .deserialize_into(PurchaseSuccess.method(:from_hash))
130
+ .is_api_response(true))
131
+ .execute
132
+ end
133
+
134
+ # This API tells you about all the details of a purchase (PayIn), including
135
+ # its history
136
+ # **Note:** With respect to bank transfers, the purchase request is
137
+ # synonymous with the PayIn request.
138
+ # ### Mandatory
139
+ # you need to pass the `PurchaseID` in the API URL
140
+ # ### Possible Value of Status
141
+ # | **Status** | **Notes** |
142
+ # | --- | --- |
143
+ # | paid | Transaction Successful |
144
+ # | payment_in_process | Payment is under Processing |
145
+ # | expired | Purchase has Expired. |
146
+ # | error | Transaction has Failed. |
147
+ # ### Response Examples
148
+ # In the response examples you can see instances of both `Paid` and `Error`
149
+ # Status purchases.
150
+ # ### Error Details
151
+ # If there are any issues on the Purchase you can get more details from the
152
+ # `transaction_data.attempts.error` attribute of the response object
153
+ # ### Errors
154
+ # If there are any errors then it'll be in the format of :
155
+ # ``` json
156
+ # {
157
+ # "message": "descriptive error message",
158
+ # "code": "error_code"
159
+ # }
160
+ # ```
161
+ # Please see the Status Code section for further details.
162
+ # @param [String] purchase_id Required parameter: TODO: type description
163
+ # here
164
+ # @return [ApiResponse] Complete http response with raw body and status code.
165
+ def get_status(purchase_id)
166
+ @api_call
167
+ .request(new_request_builder(HttpMethodEnum::GET,
168
+ '/api/v1/purchases/{purchaseId}',
169
+ Server::SERVER_3)
170
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
171
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
172
+ .is_required(true)
173
+ .should_encode(true))
174
+ .header_param(new_parameter('application/json', key: 'accept')))
175
+ .response(new_response_handler
176
+ .deserializer(APIHelper.method(:custom_type_deserializer))
177
+ .deserialize_into(PurchasesSuccess1.method(:from_hash))
178
+ .is_api_response(true))
179
+ .execute
180
+ end
181
+
182
+ # To Initiate a payment, the very first call to make is `/purchases` with
183
+ # the required data in the request body.
184
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
185
+ # request body) and `API key` (in the header) Both can be located in the
186
+ # Dashboard section of your merchant account login.
187
+ # The request body structure is shown on the request body of the example
188
+ # request shown here.
189
+ # The following (see table below) are the mandatory parameters that are
190
+ # required to create a purchase request.
191
+ # ### **Mandatory parameters in the request body:**
192
+ # | **Parameter** | **Notes** |
193
+ # | --- | --- |
194
+ # | client.email | An Identifier for a user |
195
+ # | client.city | |
196
+ # | client.country | ISO-3166 Country Code. It must be upper case. <br>This
197
+ # should be "CA" for Interac |
198
+ # | client.stateCode | Example “AL”, “XZ”.. Must be in upper case. |
199
+ # | client.street_address | |
200
+ # | client.zip_code | |
201
+ # | client.phone | |
202
+ # | client.full_name | |
203
+ # | purchase.currency | ISO 4217 code for currency you want to send the
204
+ # transaction in. <br>This should be 'CAD' for Interac |
205
+ # | purchase.products.name | |
206
+ # | purchase.products.price | Price in decimal format. <br>example 1:
207
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
208
+ # 37 cents , should be sent as 10.37 |
209
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
210
+ # |
211
+ # | success_redirect | URL to send the user if the transactions is
212
+ # successful |
213
+ # | failure_redirect | URL to send the user if the transactions is
214
+ # UNSUCCESSFUL |
215
+ # ## Optional Parameters
216
+ # ### expireInMin
217
+ # This parameter, when passed in the PayIn request, sets the time window
218
+ # within which a customer should make the Interac payment through their
219
+ # bank's app. If a customer doesn't complete the payment within the
220
+ # configured time window, the status of the payment will be marked as
221
+ # 'EXPIRED' in Paysecure.
222
+ # However, in certain cases, a payment made outside of this window could
223
+ # still be successful i.e. customer's account may be debited which would
224
+ # result in inconsistencies among Paysecure's, merchant's and customer's
225
+ # status of the transaction. To avoid such cases it is advised to set the
226
+ # expiry time limit appropriately and advise the customers to make payment
227
+ # within this window. However, if there is an inconsistency between the
228
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
229
+ # will reconcile the amounts during the settlement.
230
+ # ### merchantRef
231
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
232
+ # for merchants to specify. Its inclusion offers two significant advantages
233
+ # for the merchant:
234
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
235
+ # it acts as a unique identifier. This means that if a second purchase
236
+ # request is made using the same `merchantRef` (reference number), the
237
+ # system will recognize it and prevent duplicate transactions from
238
+ # occurring. This prevents unintended or duplicate purchases.
239
+ #
240
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
241
+ # response from the initial purchase request times out or the 'purchaseId'
242
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
243
+ # detailed transaction information. This ensures they can track and access
244
+ # the specific purchase details related to that reference, even if the
245
+ # immediate response was not received.
246
+ #
247
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
248
+ # platform will automatically assign and use an internal 'purchaseId' as a
249
+ # reference for that transaction.
250
+ # ### paymentMethod
251
+ # The `paymentMethod` parameter identifies which payment solution merchant
252
+ # wants to use to perform a transaction. If parameter is provided, than
253
+ # Paysecure will perform direct payment with the selected payment method
254
+ # instead of loading Paysecure URL.
255
+ # ### Possible Error Messages
256
+ # | **Error Messages** | **Description** |
257
+ # | --- | --- |
258
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
259
+ # | Enter Valid Email | |
260
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
261
+ # parameter | |
262
+ # | Please pass Valid State Code | |
263
+ # | Please pass valid street address in \\"street_address\\" parameter | |
264
+ # | Please pass valid city name in \\"city\\" parameter | |
265
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
266
+ # | You are not Allowed for Live Transaction | |
267
+ # | Minimum amount is not set for this merchant | |
268
+ # | success_redirect/failure_redirect/brand_id is missing | |
269
+ # | brand_id cannot be null | |
270
+ # | success_redirect cannot be null | |
271
+ # | failure_redirect cannot be null | |
272
+ # | Invalid failure_redirect: minimum 10 characters | |
273
+ # | purchase.products.price cannot be null | |
274
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
275
+ # |
276
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
277
+ # | Currency "{curr_name}" is Not Allowed | |
278
+ # | Transaction amount must be equal or greater to minimum trans amount | |
279
+ # | Allowed Limit for this card for particular time period has been consumed
280
+ # | |
281
+ # **Note:** For certain use cases, in addition to long format purchase Id,
282
+ # Paysecure also provides a 7 digit unique code for each purchase starting
283
+ # with digit 4, eg 4000001
284
+ # _“purchaseIdShortCode”: “4000013"_
285
+ # @param [CreatePurchaseRequest] body Required parameter: TODO: type
286
+ # description here
287
+ # @return [ApiResponse] Complete http response with raw body and status code.
288
+ def create_purchase(body)
289
+ @api_call
290
+ .request(new_request_builder(HttpMethodEnum::POST,
291
+ '/api/v1/purchases',
292
+ Server::SERVER_3)
293
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
294
+ .body_param(new_parameter(body)
295
+ .is_required(true))
296
+ .header_param(new_parameter('application/json', key: 'accept'))
297
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
298
+ .response(new_response_handler
299
+ .deserializer(APIHelper.method(:custom_type_deserializer))
300
+ .deserialize_into(Success3.method(:from_hash))
301
+ .is_api_response(true))
302
+ .execute
303
+ end
304
+
305
+ # This API tells you about all the details of a purchase (PayIn), including
306
+ # its history
307
+ # **Note:** With respect to bank transfers, the purchase request is
308
+ # synonymous with the PayIn request.
309
+ # ### Mandatory
310
+ # you need to pass the `PurchaseID` in the API URL
311
+ # ### Possible Value of Status
312
+ # | **Status** | **Notes** |
313
+ # | --- | --- |
314
+ # | paid | Transaction Successful |
315
+ # | payment_in_process | Payment is under Processing |
316
+ # | expired | Purchase has Expired. |
317
+ # | error | Transaction has Failed. |
318
+ # ### Response Examples
319
+ # In the response examples you can see instances of both `Paid` and `Error`
320
+ # Status purchases.
321
+ # ### Error Details
322
+ # If there are any issues on the Purchase you can get more details from the
323
+ # `transaction_data.attempts.error` attribute of the response object
324
+ # ### Errors
325
+ # If there are any errors then it'll be in the format of :
326
+ # ``` json
327
+ # {
328
+ # "message": "descriptive error message",
329
+ # "code": "error_code"
330
+ # }
331
+ # ```
332
+ # Please see the Status Code section for further details.
333
+ # @param [String] purchase_id Required parameter: TODO: type description
334
+ # here
335
+ # @return [ApiResponse] Complete http response with raw body and status code.
336
+ def get_status1(purchase_id)
337
+ @api_call
338
+ .request(new_request_builder(HttpMethodEnum::GET,
339
+ '/api/v1/purchases/{purchaseId}',
340
+ Server::SERVER_3)
341
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
342
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
343
+ .is_required(true)
344
+ .should_encode(true))
345
+ .header_param(new_parameter('application/json', key: 'accept')))
346
+ .response(new_response_handler
347
+ .deserializer(APIHelper.method(:custom_type_deserializer))
348
+ .deserialize_into(Success3.method(:from_hash))
349
+ .is_api_response(true))
350
+ .execute
351
+ end
352
+
353
+ # To Initiate a payment, the very first call to make is `/purchases` with
354
+ # the required data in the request body.
355
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
356
+ # request body) and `API key` (in the header) Both can be located in the
357
+ # Dashboard section of your merchant account login.
358
+ # The request body structure is shown on the request body of the example
359
+ # request shown here.
360
+ # The following (see table below) are the mandatory parameters that are
361
+ # required to create a purchase request.
362
+ # ### **Mandatory parameters in the request body:**
363
+ # | **Parameter** | **Notes** |
364
+ # | --- | --- |
365
+ # | client.email | An Identifier for a user |
366
+ # | client.city | An Identifier for a user |
367
+ # | client.country | ISO-3166 Country Code. It must be upper case. <br>This
368
+ # should be "CA" for Interac |
369
+ # | client.stateCode | Example “AL”, “XZ”.. Must be in upper case. |
370
+ # | client.street_address | |
371
+ # | client.zip_code | |
372
+ # | client.phone | |
373
+ # | client.full_name | |
374
+ # | purchase.currency | ISO 4217 code for currency you want to send the
375
+ # transaction in. <br>This should be 'CAD' for Interac |
376
+ # | purchase.products.name | name of the product or service |
377
+ # | purchase.products.price | Price in decimal format. <br>example 1:
378
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
379
+ # 37 cents , should be sent as 10.37 |
380
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
381
+ # |
382
+ # | success_redirect | URL to send the user if the transactions is
383
+ # successful |
384
+ # | pending_redirect | URL to send the user if the transactions is in
385
+ # progress |
386
+ # | failure_redirect | URL to send the user if the transactions is
387
+ # UNSUCCESSFUL |
388
+ # ## Optional Parameters
389
+ # ### expireInMin
390
+ # The `purchase.expireInMin`, when passed in the PayIn request, sets the
391
+ # time window within which a customer should make the Interac payment
392
+ # through their bank's app. If a customer doesn't complete the payment
393
+ # within the configured time window, the status of the payment will be
394
+ # marked as 'EXPIRED' in Paysecure.
395
+ # However, in certain cases, a payment made outside of this window could
396
+ # still be successful i.e. customer's account may be debited which would
397
+ # result in inconsistencies among Paysecure's, merchant's and customer's
398
+ # status of the transaction. To avoid such cases it is advised to set the
399
+ # expiry time limit appropriately and advise the customers to make payment
400
+ # within this window. However, if there is an inconsistency between the
401
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
402
+ # will reconcile the amounts during the settlement.
403
+ # ### merchantRef
404
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
405
+ # for merchants to specify. Its inclusion offers two significant advantages
406
+ # for the merchant:
407
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
408
+ # it acts as a unique identifier. This means that if a second purchase
409
+ # request is made using the same `merchantRef` (reference number), the
410
+ # system will recognize it and prevent duplicate transactions from
411
+ # occurring. This prevents unintended or duplicate purchases.
412
+ #
413
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
414
+ # response from the initial purchase request times out or the 'purchaseId'
415
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
416
+ # detailed transaction information. This ensures they can track and access
417
+ # the specific purchase details related to that reference, even if the
418
+ # immediate response was not received.
419
+ #
420
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
421
+ # platform will automatically assign and use an internal 'purchaseId' as a
422
+ # reference for that transaction.
423
+ # ### paymentMethod
424
+ # The `paymentMethod` parameter identifies which payment solution merchant
425
+ # wants to use to perform a transaction. If parameter is provided, than
426
+ # Paysecure will perform direct payment with the selected payment method
427
+ # instead of loading Paysecure URL.
428
+ # ### Possible Error Messages
429
+ # | **Error Messages** | **Description** |
430
+ # | --- | --- |
431
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
432
+ # | Enter Valid Email | |
433
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
434
+ # parameter | |
435
+ # | Please pass Valid State Code | |
436
+ # | Please pass valid street address in \\"street_address\\" parameter | |
437
+ # | Please pass valid city name in \\"city\\" parameter | |
438
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
439
+ # | You are not Allowed for Live Transaction | |
440
+ # | Minimum amount is not set for this merchant | |
441
+ # | success_redirect/failure_redirect/brand_id is missing | |
442
+ # | brand_id cannot be null | |
443
+ # | success_redirect cannot be null | |
444
+ # | failure_redirect cannot be null | |
445
+ # | Invalid failure_redirect: minimum 10 characters | |
446
+ # | purchase.products.price cannot be null | |
447
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
448
+ # |
449
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
450
+ # | Currency "{curr_name}" is Not Allowed | |
451
+ # | Transaction amount must be equal or greater to minimum trans amount | |
452
+ # | Allowed Limit for this card for particular time period has been consumed
453
+ # | |
454
+ # **Note:** For certain use cases, in addition to long format purchase Id,
455
+ # Paysecure also provides a 7 digit unique code for each purchase starting
456
+ # with digit 4, eg 4000001
457
+ # _“purchaseIdShortCode”: “4000013"_
458
+ # @param [PurchasesRequest] body Required parameter: TODO: type description
459
+ # here
460
+ # @return [ApiResponse] Complete http response with raw body and status code.
461
+ def purchases1(body)
462
+ @api_call
463
+ .request(new_request_builder(HttpMethodEnum::POST,
464
+ '/api/v1/purchases',
465
+ Server::SERVER_3)
466
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
467
+ .body_param(new_parameter(body)
468
+ .is_required(true))
469
+ .header_param(new_parameter('application/json', key: 'accept'))
470
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
471
+ .response(new_response_handler
472
+ .deserializer(APIHelper.method(:custom_type_deserializer))
473
+ .deserialize_into(PurchaseSuccess1.method(:from_hash))
474
+ .is_api_response(true))
475
+ .execute
476
+ end
477
+
478
+ # To Initiate a payment, the very first call to make is `/purchases` with
479
+ # the required data in the request body.
480
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
481
+ # request body) and `API key` (in the header) Both can be located in the
482
+ # Dashboard section of your merchant account login.
483
+ # The request body structure is shown on the request body of the example
484
+ # request shown here.
485
+ # The following (see table below) are the mandatory parameters that are
486
+ # required to create a purchase request.
487
+ # ### **Request Body Parameters:**
488
+ # | **Parameter** | **Notes** |
489
+ # | --- | --- |
490
+ # | client.full_name | Conditional. <br>But Recommended to pass the
491
+ # complete name of the client. Atleast 2 words recommended. |
492
+ # | client.email | Conditional. <br>But Recommended to pass a correct email
493
+ # id. |
494
+ # | client.tax_number | Mandatory. <br>Pass the CPF (Brazilian tax
495
+ # identification number of customer), must contain 11 digits. |
496
+ # | paymentMethod | Conditional. <br>Mandatory if you are not using
497
+ # Paysecure Cashier. Else Non Mandatory. <br>Value: PIX |
498
+ # | purchase.currency | Mandatory. <br>ISO 4217 code for currency you want
499
+ # to send the transaction in. This should be 'BRL' for PIX. |
500
+ # | purchase.products.name | Mandatory. |
501
+ # | purchase.products.price | Mandatory. <br>Price in decimal format upto 2
502
+ # decimals. <br>example 1: <br>EUR 5 , should be sent as 5.00 <br>example
503
+ # 2: <br>USD 10 and 37 cents , should be sent as 10.37 |
504
+ # | brand_id | Mandatory. <br>Obtain from Dashboard section of your
505
+ # merchant account login. |
506
+ # | success_redirect | Mandatory. <br>URL to send the user if the
507
+ # transactions is successful. |
508
+ # | pending_redirect | Mandatory. <br>URL to send the user if the
509
+ # transactions is in progress state. |
510
+ # | failure_redirect | Mandatory <br>URL to send the user if the
511
+ # transactions has failed. |
512
+ # **Note:** the object “pix_payload.payload” contains all the necessary
513
+ # fields to create a page containing a QR code and other information on the
514
+ # merchant portal. The field “pix_payload.qr_code” value is in Base64. This
515
+ # can be used to show the QR code image. The field
516
+ # "pix_payload.expiration_date" is in UTC time.
517
+ # ## Essential Optional Parameters
518
+ # ### merchantRef
519
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
520
+ # for merchants to specify. Its inclusion offers two significant advantages
521
+ # for the merchant:
522
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
523
+ # it acts as a unique identifier. This means that if a second purchase
524
+ # request is made using the same `merchantRef` (reference number), the
525
+ # system will recognize it and prevent duplicate transactions from
526
+ # occurring. This prevents unintended or duplicate purchases.
527
+ #
528
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
529
+ # response from the initial purchase request times out or the 'purchaseId'
530
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
531
+ # detailed transaction information. This ensures they can track and access
532
+ # the specific purchase details related to that reference, even if the
533
+ # immediate response was not received.
534
+ #
535
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
536
+ # platform will automatically assign and use an internal 'purchaseId' as a
537
+ # reference for that transaction.
538
+ # ### paymentMethod
539
+ # The `paymentMethod` parameter identifies which payment solution merchant
540
+ # wants to use to perform a transaction. If parameter is provided, than
541
+ # Paysecure will perform direct payment with the selected payment method
542
+ # instead of loading Paysecure URL.
543
+ # ### Possible Error Messages
544
+ # | **Error Messages** | **Description** |
545
+ # | --- | --- |
546
+ # | Allowed Limit for this card for particular time period has been consumed
547
+ # | |
548
+ # | some Mandatory Parameter are missing | |
549
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
550
+ # | Invalid Email Format | |
551
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
552
+ # parameter | |
553
+ # | Please pass Valid State Code | |
554
+ # | Please pass valid street address in \\"street_address\\" parameter | |
555
+ # | Please pass valid city name in \\"city\\" parameter | |
556
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
557
+ # | You are not Allowed for Live Transaction | |
558
+ # | Merchant Limit is not set | |
559
+ # | Minimum amount is not set for this merchant | |
560
+ # | Brand not found! | |
561
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
562
+ # | Only `“{curr_name}"` currency is allowed | |
563
+ # | Transaction amount must be equal or greater to minimum trans amount | |
564
+ # | Invalid_Parameter | You'd usually get it when one or more mandatory
565
+ # parameters are not present in the request. |
566
+ # @param [PurchasesRequest2] body Required parameter: TODO: type description
567
+ # here
568
+ # @return [ApiResponse] Complete http response with raw body and status code.
569
+ def purchases2(body)
570
+ @api_call
571
+ .request(new_request_builder(HttpMethodEnum::POST,
572
+ '/api/v1/purchases',
573
+ Server::SERVER_3)
574
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
575
+ .body_param(new_parameter(body)
576
+ .is_required(true))
577
+ .header_param(new_parameter('application/json', key: 'accept'))
578
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
579
+ .response(new_response_handler
580
+ .deserializer(APIHelper.method(:custom_type_deserializer))
581
+ .deserialize_into(PurchaseSuccess2.method(:from_hash))
582
+ .is_api_response(true))
583
+ .execute
584
+ end
585
+
586
+ # This API tells you about all the details of a purchase, including its
587
+ # history
588
+ # ### Mandatory
589
+ # you need to pass the `PurchaseID` in the API URL
590
+ # ### Possible Value of Status
591
+ # | **Status** | **Notes** |
592
+ # | --- | --- |
593
+ # | paid | Transaction Successful |
594
+ # | payment_in_process | Payment is under Processing |
595
+ # | expired | The purchase has Expired. |
596
+ # | error | Transaction has Failed. |
597
+ # ### Response Examples
598
+ # In the response examples you can see instances of both `Paid` and `Error`
599
+ # Status purchases.
600
+ # ### Error Details
601
+ # If there are any issues on the Purchase you can get more details from the
602
+ # `transaction_data.attempts.error` attribute of the response object
603
+ # ### Errors
604
+ # If there are any errors then it'll be in the format of :
605
+ # ``` json
606
+ # {
607
+ # "message": "descriptive error message",
608
+ # "code": "error_code"
609
+ # }
610
+ # ```
611
+ # Please see the Status Code section for further details.
612
+ # @param [String] purchase_id Required parameter: TODO: type description
613
+ # here
614
+ # @return [ApiResponse] Complete http response with raw body and status code.
615
+ def get_status2(purchase_id)
616
+ @api_call
617
+ .request(new_request_builder(HttpMethodEnum::GET,
618
+ '/api/v1/purchases/{purchaseId}',
619
+ Server::SERVER_3)
620
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
621
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
622
+ .is_required(true)
623
+ .should_encode(true))
624
+ .header_param(new_parameter('application/json', key: 'accept')))
625
+ .response(new_response_handler
626
+ .deserializer(APIHelper.method(:custom_type_deserializer))
627
+ .deserialize_into(Success7.method(:from_hash))
628
+ .is_api_response(true))
629
+ .execute
630
+ end
631
+
632
+ # To Initiate a payment, the very first call to make is `/purchases` with
633
+ # the required data in the request body.
634
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
635
+ # request body) and `API key` (in the header) Both can be located in the
636
+ # Dashboard section of your merchant account login.
637
+ # The request body structure is shown on the request body of the example
638
+ # request shown here.
639
+ # The following (see table below) are the mandatory parameters that are
640
+ # required to create a purchase request.
641
+ # ### **Mandatory parameters in the request body:**
642
+ # | **Parameter** | **Notes** |
643
+ # | --- | --- |
644
+ # | client.email | An Identifier for a user |
645
+ # | client.city | |
646
+ # | client.country | ISO-3166 Country Code. It must be upper case. Example
647
+ # “SG” (Alpha2) |
648
+ # | client.stateCode | Example “AL”, “XZ”.. Must be in upper case. |
649
+ # | client.street_address | |
650
+ # | client.zip_code | |
651
+ # | client.phone | |
652
+ # | client.full_name | |
653
+ # | purchase.currency | ISO 4217 code for currency you want to send the
654
+ # transaction in. <br>Please note, the currency has to be enbaled by the
655
+ # account manager for your account. |
656
+ # | purchase.products.name | |
657
+ # | purchase.products.price | Price in decimal format. <br>example 1:
658
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
659
+ # 37 cents , should be sent as 10.37 |
660
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
661
+ # |
662
+ # | success_redirect | URL to send the user if the transactions is
663
+ # successful |
664
+ # | failure_redirect | URL to send the user if the transactions is
665
+ # UNSUCCESSFUL |
666
+ # ## Optional Parameters
667
+ # ### merchantRef
668
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
669
+ # for merchants to specify. Its inclusion offers two significant advantages
670
+ # for the merchant:
671
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
672
+ # it acts as a unique identifier. This means that if a second purchase
673
+ # request is made using the same `merchantRef` (reference number), the
674
+ # system will recognize it and prevent duplicate transactions from
675
+ # occurring. This prevents unintended or duplicate purchases.
676
+ #
677
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
678
+ # response from the initial purchase request times out or the 'purchaseId'
679
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
680
+ # detailed transaction information. This ensures they can track and access
681
+ # the specific purchase details related to that reference, even if the
682
+ # immediate response was not received.
683
+ #
684
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
685
+ # platform will automatically assign and use an internal 'purchaseId' as a
686
+ # reference for that transaction.
687
+ # ### paymentMethod
688
+ # The `paymentMethod` parameter identifies which payment solution merchant
689
+ # wants to use to perform a transaction. If parameter is provided, than
690
+ # Paysecure will perform direct payment with the selected payment method
691
+ # instead of loading Paysecure URL.
692
+ # ### Possible Error Messages
693
+ # | **Error Messages** | **Description** |
694
+ # | --- | --- |
695
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
696
+ # | Enter Valid Email | |
697
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
698
+ # parameter | |
699
+ # | Please pass Valid State Code | |
700
+ # | Please pass valid street address in \\"street_address\\" parameter | |
701
+ # | Please pass valid city name in \\"city\\" parameter | |
702
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
703
+ # | You are not Allowed for Live Transaction | |
704
+ # | Minimum amount is not set for this merchant | |
705
+ # | success_redirect/failure_redirect/brand_id is missing | |
706
+ # | brand_id cannot be null | |
707
+ # | success_redirect cannot be null | |
708
+ # | failure_redirect cannot be null | |
709
+ # | Invalid failure_redirect: minimum 10 characters | |
710
+ # | purchase.products.price cannot be null | |
711
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
712
+ # |
713
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
714
+ # | Currency "{curr_name}" is Not Allowed | |
715
+ # | Transaction amount must be equal or greater to minimum trans amount | |
716
+ # | Allowed Limit for this card for particular time period has been consumed
717
+ # | |
718
+ # **Note:** For certain use cases, in addition to long format purchase Id,
719
+ # Paysecure also provides a 7 digit unique code for each purchase starting
720
+ # with digit 4, eg 4000001
721
+ # _“purchaseIdShortCode”: “4000013"_
722
+ # @param [PurchasesRequest3] body Required parameter: TODO: type description
723
+ # here
724
+ # @return [ApiResponse] Complete http response with raw body and status code.
725
+ def purchases3(body)
726
+ @api_call
727
+ .request(new_request_builder(HttpMethodEnum::POST,
728
+ '/api/v1/purchases',
729
+ Server::SERVER_3)
730
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
731
+ .body_param(new_parameter(body)
732
+ .is_required(true))
733
+ .header_param(new_parameter('application/json', key: 'accept'))
734
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
735
+ .response(new_response_handler
736
+ .deserializer(APIHelper.method(:custom_type_deserializer))
737
+ .deserialize_into(PurchaseSuccess3.method(:from_hash))
738
+ .is_api_response(true))
739
+ .execute
740
+ end
741
+
742
+ # This API tells you about all the details of a purchase (PayIn), including
743
+ # its history
744
+ # **Note:** With respect to bank transfers, the purchase request is
745
+ # synonymous with the PayIn request.
746
+ # ### Mandatory
747
+ # you need to pass the `PurchaseID` in the API URL
748
+ # ### Possible Value of Status
749
+ # | **Status** | **Notes** |
750
+ # | --- | --- |
751
+ # | paid | Transaction Successful |
752
+ # | payment_in_process | Payment is under Processing |
753
+ # | expired | Purchase has Expired. |
754
+ # | error | Transaction has Failed. |
755
+ # ### Response Examples
756
+ # In the response examples you can see instances of both `Paid` and `Error`
757
+ # Status purchases.
758
+ # ### Error Details
759
+ # If there are any issues on the Purchase you can get more details from the
760
+ # `transaction_data.attempts.error` attribute of the response object
761
+ # ### Errors
762
+ # If there are any errors then it'll be in the format of :
763
+ # ``` json
764
+ # {
765
+ # "message": "descriptive error message",
766
+ # "code": "error_code"
767
+ # }
768
+ # ```
769
+ # Please see the Status Code section for further details.
770
+ # @param [String] purchase_id Required parameter: TODO: type description
771
+ # here
772
+ # @return [ApiResponse] Complete http response with raw body and status code.
773
+ def get_status3(purchase_id)
774
+ @api_call
775
+ .request(new_request_builder(HttpMethodEnum::GET,
776
+ '/api/v1/purchases/{purchaseId}',
777
+ Server::SERVER_3)
778
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
779
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
780
+ .is_required(true)
781
+ .should_encode(true))
782
+ .header_param(new_parameter('application/json', key: 'accept')))
783
+ .response(new_response_handler
784
+ .deserializer(APIHelper.method(:custom_type_deserializer))
785
+ .deserialize_into(PurchasesSuccess2.method(:from_hash))
786
+ .is_api_response(true))
787
+ .execute
788
+ end
789
+
790
+ # To Initiate a payment, the very first call to make is `/purchases` with
791
+ # the required data in the request body.
792
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
793
+ # request body) and `API key` (in the header) Both can be located in the
794
+ # Dashboard section of your merchant account login.
795
+ # The request body structure is shown on the request body of the example
796
+ # request shown here.
797
+ # The following (see table below) are the mandatory parameters that are
798
+ # required to create a purchase request.
799
+ # ### **Mandatory parameters in the request body:**
800
+ # | **Parameter** | **Notes** |
801
+ # | --- | --- |
802
+ # | client.email | The customer's email. |
803
+ # | client.city | The customer's city. |
804
+ # | client.country | ISO-3166 Country Code. Must be upper case. Example “SG”
805
+ # (Alpha2) |
806
+ # | client.stateCode | Example “AL”, “XZ”. Must be in upper case. |
807
+ # | Client.street_address | The customer's address. |
808
+ # | client.zip_code | The customer's ZIP or postal code. If country=US, zip
809
+ # format must be NNNNN or NNNNN-NNNN. |
810
+ # | purchase.currency | ISO 4217 code for currency you want to send the
811
+ # transaction in. <br> <br>Please note, the currency has to be enabled by
812
+ # the account manager for your account. |
813
+ # | purchase.products | An object which contains the list of products which
814
+ # the customer is buying. |
815
+ # | purchase.products.name | The name of the product. |
816
+ # | purchase.products.price | Price in decimal format. <br>example 1:
817
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
818
+ # 37 cents , should be sent as 10.37 |
819
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
820
+ # |
821
+ # | success_redirect | URL to send the user if the transactions is
822
+ # successful. |
823
+ # | pending_redirect | URL to send the user if the transactions is in
824
+ # pending. |
825
+ # | failure_redirect | URL to send the user if the transactions is
826
+ # unsuccessful. |
827
+ # ## Optional Parameters
828
+ # ### expireInMin
829
+ # This parameter, when passed in the PayIn request, sets the time window
830
+ # within which a customer should make the Interac payment through their
831
+ # bank's app. If a customer doesn't complete the payment within the
832
+ # configured time window, the status of the payment will be marked as
833
+ # 'EXPIRED' in Paysecure.
834
+ # However, in certain cases, a payment made outside of this window could
835
+ # still be successful i.e. customer's account may be debited which would
836
+ # result in inconsistencies among Paysecure's, merchant's and customer's
837
+ # status of the transaction. To avoid such cases it is advised to set the
838
+ # expiry time limit appropriately and advise the customers to make payment
839
+ # within this window. However, if there is an inconsistency between the
840
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
841
+ # will reconcile the amounts during the settlement.
842
+ # ### merchantRef
843
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
844
+ # for merchants to specify. Its inclusion offers two significant advantages
845
+ # for the merchant:
846
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
847
+ # it acts as a unique identifier. This means that if a second purchase
848
+ # request is made using the same `merchantRef` (reference number), the
849
+ # system will recognize it and prevent duplicate transactions from
850
+ # occurring. This prevents unintended or duplicate purchases.
851
+ #
852
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
853
+ # response from the initial purchase request times out or the 'purchaseId'
854
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
855
+ # detailed transaction information. This ensures they can track and access
856
+ # the specific purchase details related to that reference, even if the
857
+ # immediate response was not received.
858
+ #
859
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
860
+ # platform will automatically assign and use an internal 'purchaseId' as a
861
+ # reference for that transaction.
862
+ # ### paymentMethod
863
+ # The `paymentMethod` parameter identifies which payment solution merchant
864
+ # wants to use to perform a transaction. If parameter is provided, than
865
+ # Paysecure will perform direct payment with the selected payment method
866
+ # instead of loading Paysecure URL.
867
+ # Possible Payment Methods allowed: UPI-QR and UPI-INTENT
868
+ # ### Possible Error Messages
869
+ # | **Error Messages** |
870
+ # | --- |
871
+ # | Allowed Limit for this payment method for particular time period has
872
+ # been consumed |
873
+ # | some Mandatory Parameter are missing |
874
+ # | Invalid format of Date_of_Birth \[allowed format: yyyy-mm-dd\] |
875
+ # | Invalid Email Format |
876
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
877
+ # parameter |
878
+ # | Please pass Valid State Code |
879
+ # | Please pass valid street address in \\"street_address\\" parameter |
880
+ # | Please pass valid city name in \\"city\\" parameter |
881
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter |
882
+ # | You are not Allowed for Live Transaction |
883
+ # | Merchant Limit is not set |
884
+ # | Minimum amount is not set for this merchant |
885
+ # | Brand not found ! |
886
+ # | Your charges setting is incomplete .Plese Contact to Administrator. |
887
+ # | Only {{currencyCode}} currency is allowed. |
888
+ # | Transaction amount must be equal or greater to minimum trans amount |
889
+ # | Invalid_Parameter <br>You'd usually get it when one or more mandatory
890
+ # parameters are not present in the request. |
891
+ # @param [PurchasesRequest4] body Required parameter: TODO: type description
892
+ # here
893
+ # @return [ApiResponse] Complete http response with raw body and status code.
894
+ def purchases4(body)
895
+ @api_call
896
+ .request(new_request_builder(HttpMethodEnum::POST,
897
+ '/api/v1/purchases',
898
+ Server::SERVER_3)
899
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
900
+ .body_param(new_parameter(body)
901
+ .is_required(true))
902
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
903
+ .response(new_response_handler
904
+ .deserializer(APIHelper.method(:deserialize_primitive_types))
905
+ .deserialize_into(proc do |response| response&.to_s end)
906
+ .is_api_response(true)
907
+ .is_primitive_response(true))
908
+ .execute
909
+ end
910
+
911
+ # This API tells you about all the details of a purchase (PayIn), including
912
+ # its history
913
+ # **Note:** With respect to bank transfers, the purchase request is
914
+ # synonymous with the PayIn request.
915
+ # ### Mandatory
916
+ # you need to pass the `PurchaseID` in the API URL
917
+ # ### Possible Value of Status
918
+ # | **Status** | **Notes** |
919
+ # | --- | --- |
920
+ # | paid | Transaction Successful |
921
+ # | payment_in_process | Payment is under Processing |
922
+ # | expired | Purchase has Expired. |
923
+ # | error | Transaction has Failed. |
924
+ # ### Response Examples
925
+ # In the response examples you can see instances of both `Paid` and `Error`
926
+ # Status purchases.
927
+ # ### Error Details
928
+ # If there are any issues on the Purchase you can get more details from the
929
+ # `transaction_data.attempts.error` attribute of the response object
930
+ # ### Errors
931
+ # If there are any errors then it'll be in the format of :
932
+ # ``` json
933
+ # {
934
+ # "message": "descriptive error message",
935
+ # "code": "error_code"
936
+ # }
937
+ # ```
938
+ # Please see the Status Code section for further details.
939
+ # @param [String] purchase_id Required parameter: TODO: type description
940
+ # here
941
+ # @return [ApiResponse] Complete http response with raw body and status code.
942
+ def get_status4(purchase_id)
943
+ @api_call
944
+ .request(new_request_builder(HttpMethodEnum::GET,
945
+ '/api/v1/purchases/{purchaseId}',
946
+ Server::SERVER_3)
947
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
948
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
949
+ .is_required(true)
950
+ .should_encode(true))
951
+ .header_param(new_parameter('application/json', key: 'accept')))
952
+ .response(new_response_handler
953
+ .deserializer(APIHelper.method(:custom_type_deserializer))
954
+ .deserialize_into(Success10.method(:from_hash))
955
+ .is_api_response(true))
956
+ .execute
957
+ end
958
+
959
+ # ### 1\. Request Payload Structure
960
+ # Supply a JSON payload with these top‐level objects:
961
+ # - `client` (customer details)
962
+ #
963
+ # - `purchase` (order details)
964
+ #
965
+ # - `paymentMethod` (string, must be `"SPEI"`)
966
+ #
967
+ # - `extraParam` (optional, leave `{}` if unused)
968
+ #
969
+ # - `status` (set to `"created"`)
970
+ #
971
+ # - `brand_id` (your merchant/brand UUID)
972
+ #
973
+ # - Redirect & callback URLs
974
+ #
975
+ # ---
976
+ # ### 2\. Displaying SPEI Instructions to End User
977
+ # Once you parse `payInDetails` from the response:
978
+ # 1. **Show CLABE, Beneficiary & Amount**
979
+ #
980
+ # 2. **Display Expiration**
981
+ #
982
+ # 3. **Show Redirect Path (Optional)**
983
+ #
984
+ # - If you’re using the hosted `checkout_url`, simply redirect customers
985
+ # to it and let Paysecure handle the UI.
986
+ #
987
+ # ---
988
+ # ### 3\. Webhook Handling & Status Transitions
989
+ # 1. **Configure Webhooks**
990
+ #
991
+ # - In Paysecure’s Dashboard, set your `success_callback` and
992
+ # `failure_callback` URLs (one for each event type).
993
+ #
994
+ # 2. **Listen for These Events**:
995
+ #
996
+ # - `payment.paid` – Banco de México has settled the transfer.
997
+ #
998
+ # - `payment.error` – CLABE/amount mismatch or network error.
999
+ #
1000
+ # - `payment.expired` – Customer did not pay before `expireInMin`.
1001
+ #
1002
+ # 3. **Update Order Status**:
1003
+ #
1004
+ # - On `payment.paid`: mark as paid, trigger fulfillment, send
1005
+ # confirmation.
1006
+ #
1007
+ # - On `payment.error`: alert customer, allow retry or alternative
1008
+ # payment.
1009
+ #
1010
+ # - On `payment.expired`: cancel order.
1011
+ # @param [PayinApiRequest] body Required parameter: TODO: type description
1012
+ # here
1013
+ # @return [ApiResponse] Complete http response with raw body and status code.
1014
+ def payin_api(body)
1015
+ @api_call
1016
+ .request(new_request_builder(HttpMethodEnum::POST,
1017
+ '/api/v1/purchases',
1018
+ Server::SERVER_3)
1019
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1020
+ .body_param(new_parameter(body)
1021
+ .is_required(true))
1022
+ .header_param(new_parameter('application/json', key: 'accept'))
1023
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1024
+ .response(new_response_handler
1025
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1026
+ .deserialize_into(Success11.method(:from_hash))
1027
+ .is_api_response(true))
1028
+ .execute
1029
+ end
1030
+
1031
+ # To Initiate a payment, the very first call to make is `/purchases` with
1032
+ # the required data in the request body.
1033
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
1034
+ # request body) and `API key` (in the header) Both can be located in the
1035
+ # Dashboard section of your merchant account login.
1036
+ # The request body structure is shown on the request body of the example
1037
+ # request shown here.
1038
+ # The following (see table below) are the mandatory parameters that are
1039
+ # required to create a purchase request.
1040
+ # ### **Mandatory parameters in the request body:**
1041
+ # | **Parameter** | **Notes** |
1042
+ # | --- | --- |
1043
+ # | client.email | An Identifier for a user, should be a valid email. |
1044
+ # | client.city | City of the user. |
1045
+ # | client.country | ISO-3166 Country Code. It must be upper case. |
1046
+ # | client.stateCode | ISO-3166-2 State Code. Must be in upper case. |
1047
+ # | client.street_address | street address of the user. |
1048
+ # | client.zip_code | zip code of the user. |
1049
+ # | client.phone | Phone number of the user. Country code is mandatory.
1050
+ # <br>Example: +234999999999 |
1051
+ # | client.full_name | Full name of the user. Minimum 2 words with atleast 1
1052
+ # character in each word. |
1053
+ # | purchase.currency | ISO 4217 code for currency you want to send the
1054
+ # transaction in. <br>eg. This should be 'TZS' for Tanzania <br>CDF for
1055
+ # Congo. |
1056
+ # | purchase.products.name | |
1057
+ # | purchase.products.price | Amount in decimal upto 2 places. |
1058
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
1059
+ # |
1060
+ # | success_redirect | URL to send the user if the transactions is
1061
+ # successful |
1062
+ # | pending_redirect | URL to send the user if the transactions is in
1063
+ # progress |
1064
+ # | failure_redirect | URL to send the user if the transactions is
1065
+ # UNSUCCESSFUL |
1066
+ # ## Optional Parameters
1067
+ # ### expireInMin
1068
+ # This parameter, when passed in the PayIn request, sets the time window
1069
+ # within which a customer should make the Interac payment through their
1070
+ # bank's app. If a customer doesn't complete the payment within the
1071
+ # configured time window, the status of the payment will be marked as
1072
+ # 'EXPIRED' in Paysecure.
1073
+ # However, in certain cases, a payment made outside of this window could
1074
+ # still be successful i.e. customer's account may be debited which would
1075
+ # result in inconsistencies among Paysecure's, merchant's and customer's
1076
+ # status of the transaction. To avoid such cases it is advised to set the
1077
+ # expiry time limit appropriately and advise the customers to make payment
1078
+ # within this window. However, if there is an inconsistency between the
1079
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
1080
+ # will reconcile the amounts during the settlement.
1081
+ # ### merchantRef
1082
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
1083
+ # for merchants to specify. Its inclusion offers two significant advantages
1084
+ # for the merchant:
1085
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
1086
+ # it acts as a unique identifier. This means that if a second purchase
1087
+ # request is made using the same `merchantRef` (reference number), the
1088
+ # system will recognize it and prevent duplicate transactions from
1089
+ # occurring. This prevents unintended or duplicate purchases.
1090
+ #
1091
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
1092
+ # response from the initial purchase request times out or the 'purchaseId'
1093
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
1094
+ # detailed transaction information. This ensures they can track and access
1095
+ # the specific purchase details related to that reference, even if the
1096
+ # immediate response was not received.
1097
+ #
1098
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
1099
+ # platform will automatically assign and use an internal 'purchaseId' as a
1100
+ # reference for that transaction.
1101
+ # ### paymentMethod
1102
+ # The `paymentMethod` parameter identifies which payment solution merchant
1103
+ # wants to use to perform a transaction. If parameter is provided, than
1104
+ # Paysecure will perform direct payment with the selected payment method
1105
+ # instead of loading Paysecure URL.
1106
+ # ### Possible Error Messages
1107
+ # | **Error Messages** | **Description** |
1108
+ # | --- | --- |
1109
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
1110
+ # | Enter Valid Email | |
1111
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
1112
+ # parameter | |
1113
+ # | Please pass Valid State Code | |
1114
+ # | Please pass valid street address in \\"street_address\\" parameter | |
1115
+ # | Please pass valid city name in \\"city\\" parameter | |
1116
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
1117
+ # | You are not Allowed for Live Transaction | |
1118
+ # | Minimum amount is not set for this merchant | |
1119
+ # | success_redirect/failure_redirect/brand_id is missing | |
1120
+ # | brand_id cannot be null | |
1121
+ # | success_redirect cannot be null | |
1122
+ # | failure_redirect cannot be null | |
1123
+ # | Invalid failure_redirect: minimum 10 characters | |
1124
+ # | purchase.products.price cannot be null | |
1125
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
1126
+ # |
1127
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
1128
+ # | Currency "{curr_name}" is Not Allowed | |
1129
+ # | Transaction amount must be equal or greater to minimum trans amount | |
1130
+ # | Allowed Limit for this card for particular time period has been consumed
1131
+ # | |
1132
+ # **Note:** For certain use cases, in addition to long format purchase Id,
1133
+ # Paysecure also provides a 7 digit unique code for each purchase starting
1134
+ # with digit 4, eg 4000001
1135
+ # _“purchaseIdShortCode”: “4000013"_
1136
+ # @param [PurchasesRequest5] body Required parameter: TODO: type description
1137
+ # here
1138
+ # @return [ApiResponse] Complete http response with raw body and status code.
1139
+ def purchases5(body)
1140
+ @api_call
1141
+ .request(new_request_builder(HttpMethodEnum::POST,
1142
+ '/api/v1/purchases',
1143
+ Server::SERVER_3)
1144
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1145
+ .body_param(new_parameter(body)
1146
+ .is_required(true))
1147
+ .header_param(new_parameter('application/json', key: 'accept'))
1148
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1149
+ .response(new_response_handler
1150
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1151
+ .deserialize_into(Success13.method(:from_hash))
1152
+ .is_api_response(true))
1153
+ .execute
1154
+ end
1155
+
1156
+ # To Initiate a payment, the very first call to make is `/purchases` with
1157
+ # the required data in the request body.
1158
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
1159
+ # request body) and `API key` (in the header) Both can be located in the
1160
+ # Dashboard section of your merchant account login.
1161
+ # The request body structure is shown on the request body of the example
1162
+ # request shown here.
1163
+ # The following (see table below) are the mandatory parameters that are
1164
+ # required to create a purchase request.
1165
+ # ### **Mandatory parameters in the request body:**
1166
+ # | **Parameter** | **Notes** |
1167
+ # | --- | --- |
1168
+ # | client.email | An Identifier for a user |
1169
+ # | client.city | An Identifier for a user |
1170
+ # | client.country | ISO-3166 Country Code. It must be upper case. <br>This
1171
+ # should be "CA" for Interac |
1172
+ # | client.stateCode | Example “AL”, “XZ”.. Must be in upper case. |
1173
+ # | client.street_address | |
1174
+ # | client.zip_code | |
1175
+ # | client.phone | |
1176
+ # | client.full_name | |
1177
+ # | purchase.currency | ISO 4217 code for currency you want to send the
1178
+ # transaction in. <br>This should be 'CAD' for Interac |
1179
+ # | purchase.products.name | name of the product or service |
1180
+ # | purchase.products.price | Price in decimal format. <br>example 1:
1181
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
1182
+ # 37 cents , should be sent as 10.37 |
1183
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
1184
+ # |
1185
+ # | extraParam.IsCryptoPurchase | for paymint, send "Yes" |
1186
+ # | success_redirect | URL to send the user if the transactions is
1187
+ # successful |
1188
+ # | pending_redirect | URL to send the user if the transactions is in
1189
+ # progress |
1190
+ # | failure_redirect | URL to send the user if the transactions is
1191
+ # UNSUCCESSFUL |
1192
+ # ## Optional Parameters
1193
+ # ### expireInMin
1194
+ # The `purchase.expireInMin`, when passed in the PayIn request, sets the
1195
+ # time window within which a customer should make the Interac payment
1196
+ # through their bank's app. If a customer doesn't complete the payment
1197
+ # within the configured time window, the status of the payment will be
1198
+ # marked as 'EXPIRED' in Paysecure.
1199
+ # However, in certain cases, a payment made outside of this window could
1200
+ # still be successful i.e. customer's account may be debited which would
1201
+ # result in inconsistencies among Paysecure's, merchant's and customer's
1202
+ # status of the transaction. To avoid such cases it is advised to set the
1203
+ # expiry time limit appropriately and advise the customers to make payment
1204
+ # within this window. However, if there is an inconsistency between the
1205
+ # status at Paysecure and at customer's Bank, the merchant and Paysecure
1206
+ # will reconcile the amounts during the settlement.
1207
+ # ### merchantRef
1208
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
1209
+ # for merchants to specify. Its inclusion offers two significant advantages
1210
+ # for the merchant:
1211
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
1212
+ # it acts as a unique identifier. This means that if a second purchase
1213
+ # request is made using the same `merchantRef` (reference number), the
1214
+ # system will recognize it and prevent duplicate transactions from
1215
+ # occurring. This prevents unintended or duplicate purchases.
1216
+ #
1217
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
1218
+ # response from the initial purchase request times out or the 'purchaseId'
1219
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
1220
+ # detailed transaction information. This ensures they can track and access
1221
+ # the specific purchase details related to that reference, even if the
1222
+ # immediate response was not received.
1223
+ #
1224
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
1225
+ # platform will automatically assign and use an internal 'purchaseId' as a
1226
+ # reference for that transaction.
1227
+ # ### paymentMethod
1228
+ # The `paymentMethod` parameter identifies which payment solution merchant
1229
+ # wants to use to perform a transaction. If parameter is provided, than
1230
+ # Paysecure will perform direct payment with the selected payment method
1231
+ # instead of loading Paysecure URL.
1232
+ # ### Possible Error Messages
1233
+ # | **Error Messages** | **Description** |
1234
+ # | --- | --- |
1235
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
1236
+ # | Enter Valid Email | |
1237
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
1238
+ # parameter | |
1239
+ # | Please pass Valid State Code | |
1240
+ # | Please pass valid street address in \\"street_address\\" parameter | |
1241
+ # | Please pass valid city name in \\"city\\" parameter | |
1242
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
1243
+ # | You are not Allowed for Live Transaction | |
1244
+ # | Minimum amount is not set for this merchant | |
1245
+ # | success_redirect/failure_redirect/brand_id is missing | |
1246
+ # | brand_id cannot be null | |
1247
+ # | success_redirect cannot be null | |
1248
+ # | failure_redirect cannot be null | |
1249
+ # | Invalid failure_redirect: minimum 10 characters | |
1250
+ # | purchase.products.price cannot be null | |
1251
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
1252
+ # |
1253
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
1254
+ # | Currency "{curr_name}" is Not Allowed | |
1255
+ # | Transaction amount must be equal or greater to minimum trans amount | |
1256
+ # | Allowed Limit for this card for particular time period has been consumed
1257
+ # | |
1258
+ # **Note:** For certain use cases, in addition to long format purchase Id,
1259
+ # Paysecure also provides a 7 digit unique code for each purchase starting
1260
+ # with digit 4, eg 4000001
1261
+ # _“purchaseIdShortCode”: “4000013"_
1262
+ # @param [PurchasesRequest8] body Required parameter: TODO: type description
1263
+ # here
1264
+ # @return [ApiResponse] Complete http response with raw body and status code.
1265
+ def purchases6(body)
1266
+ @api_call
1267
+ .request(new_request_builder(HttpMethodEnum::POST,
1268
+ '/api/v1/purchases',
1269
+ Server::SERVER_3)
1270
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1271
+ .body_param(new_parameter(body)
1272
+ .is_required(true))
1273
+ .header_param(new_parameter('application/json', key: 'accept'))
1274
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1275
+ .response(new_response_handler
1276
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1277
+ .deserialize_into(PurchaseSuccess.method(:from_hash))
1278
+ .is_api_response(true))
1279
+ .execute
1280
+ end
1281
+
1282
+ # This API tells you about all the details of a purchase (PayIn), including
1283
+ # its history
1284
+ # **Note:** With respect to bank transfers, the purchase request is
1285
+ # synonymous with the PayIn request.
1286
+ # ### Mandatory
1287
+ # you need to pass the `PurchaseID` in the API URL
1288
+ # ### Possible Value of Status
1289
+ # | **Status** | **Notes** |
1290
+ # | --- | --- |
1291
+ # | paid | Transaction Successful |
1292
+ # | payment_in_process | Payment is under Processing |
1293
+ # | expired | Purchase has Expired. |
1294
+ # | error | Transaction has Failed. |
1295
+ # ### Response Examples
1296
+ # In the response examples you can see instances of both `Paid` and `Error`
1297
+ # Status purchases.
1298
+ # ### Error Details
1299
+ # If there are any issues on the Purchase you can get more details from the
1300
+ # `transaction_data.attempts.error` attribute of the response object
1301
+ # ### Errors
1302
+ # If there are any errors then it'll be in the format of :
1303
+ # ``` json
1304
+ # {
1305
+ # "message": "descriptive error message",
1306
+ # "code": "error_code"
1307
+ # }
1308
+ # ```
1309
+ # Please see the Status Code section for further details.
1310
+ # @param [String] purchase_id Required parameter: TODO: type description
1311
+ # here
1312
+ # @return [ApiResponse] Complete http response with raw body and status code.
1313
+ def get_status5(purchase_id)
1314
+ @api_call
1315
+ .request(new_request_builder(HttpMethodEnum::GET,
1316
+ '/api/v1/purchases/{purchaseId}',
1317
+ Server::SERVER_3)
1318
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1319
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
1320
+ .is_required(true)
1321
+ .should_encode(true))
1322
+ .header_param(new_parameter('application/json', key: 'accept')))
1323
+ .response(new_response_handler
1324
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1325
+ .deserialize_into(PurchasesSuccess1.method(:from_hash))
1326
+ .is_api_response(true))
1327
+ .execute
1328
+ end
1329
+
1330
+ # The API endpoint
1331
+ # [/v1/purchases](https://api.paysecure.net/api/v1/purchases) is a POST
1332
+ # request used to create a new purchase. The request body should contain the
1333
+ # client information including email, address, and phone, the purchase
1334
+ # details such as currency and products, the payment method, and various
1335
+ # callback and redirect URLs.
1336
+ # **Final Steps for Payin API Integration**
1337
+ # 1. **Set Up Authentication & Headers**
1338
+ #
1339
+ # - **Endpoint:** POST >
1340
+ #
1341
+ # - **Headers (mandatory):**
1342
+ #
1343
+ # - Authorization: Bearer {LIVE_API_KEY}
1344
+ #
1345
+ # - Content-Type: application/json
1346
+ #
1347
+ # 2. **Construct the Request Payload**
1348
+ #
1349
+ # - Build a JSON body with:
1350
+ #
1351
+ # - client object (KYC/AML fields):
1352
+ #
1353
+ # - email
1354
+ #
1355
+ # - country (ISO-2 code)
1356
+ #
1357
+ # - city
1358
+ #
1359
+ # - stateCode
1360
+ #
1361
+ # - street_address
1362
+ #
1363
+ # - zip_code
1364
+ #
1365
+ # - phone
1366
+ #
1367
+ # - purchase object:
1368
+ #
1369
+ # - currency
1370
+ #
1371
+ # - products array (≥1 item with name and price)
1372
+ #
1373
+ # - **Top-level fields:**
1374
+ #
1375
+ # - paymentMethod (e.g., "NEOSURF")
1376
+ #
1377
+ # - brand_id (your Brand UUID)
1378
+ #
1379
+ # - success_redirect (HTTPS URL after success)
1380
+ #
1381
+ # - failure_redirect (HTTPS URL after failure)
1382
+ #
1383
+ # 3. **Invoke the Payin API**
1384
+ #
1385
+ # - Send the JSON payload to
1386
+ # [https://api.paysecure.net/v1/purchases](https://api.paysecure.net/v1/purc
1387
+ # hases)
1388
+ #
1389
+ # - Expect 200 OK with a response containing:
1390
+ #
1391
+ # - purchaseId
1392
+ #
1393
+ # - status = PENDING
1394
+ #
1395
+ # - checkout_url
1396
+ #
1397
+ # 4. **Extract Key References**
1398
+ #
1399
+ # - purchaseId (e.g., 68394314d3c4ef68d6cbb58c): for
1400
+ # tracking/reconciliation.
1401
+ #
1402
+ # - checkout_url (e.g.,
1403
+ # [https://api.paysecure.net/payments/68394314d3c4ef68d6cbb58c/](https://api
1404
+ # .paysecure.net/payments/68394314d3c4ef68d6cbb58c/)): redirect here so the
1405
+ # customer can complete voucher entry.
1406
+ #
1407
+ # - Redirect Customer `window.location.href = response.checkout_url;`
1408
+ # Customer enters their 10-digit Neosurf voucher on redirected page.
1409
+ #
1410
+ # 5. **Listen for Webhook Notifications**
1411
+ #
1412
+ # - Ensure your endpoint handles:
1413
+ #
1414
+ # - purchase.paid
1415
+ #
1416
+ # - purchase.error
1417
+ #
1418
+ # - purchase.cancelled
1419
+ #
1420
+ # - Each payload will include purchaseId, status, amount, currency, etc.
1421
+ #
1422
+ # ### Mandatory Parameters
1423
+ # | Field | Type | Description |
1424
+ # | --- | --- | --- |
1425
+ # | **Authorization** | string | `Bearer {API_KEY}` (replace with your live
1426
+ # or staging API key). |
1427
+ # | **Content-Type** | string | Must be `application/json`. |
1428
+ # | **client.email** | string | Customer’s email (e.g.,
1429
+ # `example22@paysecure.net`). |
1430
+ # | **client.country** | string | ISO‐3166 Alpha-2 code (e.g., `IN`). |
1431
+ # | **client.city** | string | City name or code (e.g., `123`). |
1432
+ # | **client.stateCode** | string | State or province code (two letters
1433
+ # where possible, e.g., `ca`). |
1434
+ # | **client.street_address** | string | Street address line (e.g., `test
1435
+ # test`). |
1436
+ # | **client.zip_code** | string | Postal/ZIP code (e.g., `234567`). |
1437
+ # | **client.phone** | string | Customer’s phone number (E.164 recommended,
1438
+ # e.g., `9999999999`). |
1439
+ # | **purchase.currency** | string | Currency code (e.g., `AUD`). |
1440
+ # | **purchase.products** | array | Must contain at least one object with
1441
+ # `name` and `price`. |
1442
+ # | └─ **products.name** | string | Product name or SKU (e.g., `dk`). |
1443
+ # | └─ **products.price** | string | Unit price in major currency units
1444
+ # (e.g., `"1"` = 1.00 AUD). |
1445
+ # | **paymentMethod** | string | Payment rail code (e.g., `NEOSURF`). |
1446
+ # | **brand_id** | string | Live or staging Brand UUID (e.g.,
1447
+ # `c4003b2c-22d4-4dc1-ad0c-c6b54f8c9636`). |
1448
+ # | **success_redirect** | string | HTTPS URL to redirect after successful
1449
+ # payment (e.g., `https://your.success.redirect.com`). |
1450
+ # | **failure_redirect** | string | HTTPS URL to redirect after failed
1451
+ # payment (e.g., `https://your.failure.redirect.com`). |
1452
+ # @param [PurchasesRequest9] body Required parameter: TODO: type description
1453
+ # here
1454
+ # @return [ApiResponse] Complete http response with raw body and status code.
1455
+ def purchases7(body)
1456
+ @api_call
1457
+ .request(new_request_builder(HttpMethodEnum::POST,
1458
+ '/api/v1/purchases',
1459
+ Server::SERVER_3)
1460
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1461
+ .body_param(new_parameter(body)
1462
+ .is_required(true))
1463
+ .header_param(new_parameter('application/json', key: 'accept'))
1464
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1465
+ .response(new_response_handler
1466
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1467
+ .deserialize_into(Success16.method(:from_hash))
1468
+ .is_api_response(true))
1469
+ .execute
1470
+ end
1471
+
1472
+ # ### Purchase API Endpoint
1473
+ # This endpoint allows you to create a new purchase transaction. It
1474
+ # processes the purchase details, including client information, product
1475
+ # details, and payment method, and returns the result of the transaction.
1476
+ # #### Request Format
1477
+ # - **Method**: POST
1478
+ #
1479
+ # - **URL**: `https://api.paysecure.net/api/v1/purchases`
1480
+ #
1481
+ # - **Request Body**: The request should be in JSON format and must include
1482
+ # the following structure:
1483
+ #
1484
+ # #### Response Structure
1485
+ # The response will contain the result of the purchase transaction. The
1486
+ # structure of the response may include:
1487
+ # - **status**: Indicates the success or failure of the transaction.
1488
+ #
1489
+ # - **message**: A descriptive message regarding the transaction status.
1490
+ #
1491
+ # - **transaction_id**: Unique identifier for the transaction (if
1492
+ # successful).
1493
+ #
1494
+ # - **redirect_url**: URL to redirect the user based on the transaction
1495
+ # result.
1496
+ #
1497
+ # Make sure to handle the response appropriately based on the status
1498
+ # returned.
1499
+ # @param [PurchasesRequest3] body Required parameter: TODO: type description
1500
+ # here
1501
+ # @return [ApiResponse] Complete http response with raw body and status code.
1502
+ def purchases9(body)
1503
+ @api_call
1504
+ .request(new_request_builder(HttpMethodEnum::POST,
1505
+ '/api/v1/purchases',
1506
+ Server::SERVER_3)
1507
+ .body_param(new_parameter(body)
1508
+ .is_required(true))
1509
+ .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
1510
+ .header_param(new_parameter('application/json', key: 'accept'))
1511
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1512
+ .response(new_response_handler
1513
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1514
+ .deserialize_into(Success17.method(:from_hash))
1515
+ .is_api_response(true))
1516
+ .execute
1517
+ end
1518
+
1519
+ # To Initiate a payment, the very first call to make is `/purchases` with
1520
+ # the required data in the request body.
1521
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
1522
+ # request body) and `API key` (in the header) Both can be located in the
1523
+ # Dashboard section of your merchant account login.
1524
+ # The request body structure is shown on the request body of the example
1525
+ # request shown here.
1526
+ # ### 💡 Key Fields Explained
1527
+ # | Field | Description |
1528
+ # | --- | --- |
1529
+ # | `paymentMethod` | Always use `"CRYPTO-BRIDGE"` to trigger this payment
1530
+ # method |
1531
+ # | `currency` | The fiat currency for the order (e.g., USD, EUR). You will
1532
+ # be paid in crypto but this defines how much the customer will pay |
1533
+ # | `products` | One or more items being sold, with name and price |
1534
+ # | `extraParam.clientFee` | Optional: A custom fee you (the merchant) want
1535
+ # to charge — shown to the user at checkout |
1536
+ # | `extraParam.toAddress` | Optional. <br>Merchant can provide the list of
1537
+ # wallet addresses, where they want to collect the deposit from the user.
1538
+ # Can pass multiple addresses. |
1539
+ # | `extraParam.toAddress.symbol` | The symbol of the digital asset.
1540
+ # <br>Example: ETH, USDC etc. <br> <br>Possible Values: <br>AAVE, ADA,
1541
+ # APE, APT, ARB, AVAX, BLAST, BLUR, BNB, BTC, BUSD, CAKE, CASH, CRO, DAI,
1542
+ # DEXE, DEVNETSOL, DOGE, ENA, ETH, EURC, FARTCOIN, FDUSD, FORM, FTM, GRT,
1543
+ # HYPE, IMX, INJ, LDO, LEO, LINK, LTC, MANA, MATIC, MKR, MNT, MON, OP, PAXG,
1544
+ # PENGU, POL, PYUSD, QNT, RLUSD, RNDR, S, SAND, SEPOLIAETH, SHIB, SNX, SOL,
1545
+ # SUI, TON, TRUMP, TRX, TUSD, UNI, USD1, USD₮0, USDC, USDD, USDG, USDH,
1546
+ # USDP, USDT, VIRTUAL, WAVAX, WBNB, WBTC, WETH, WHYPE, WIF, WMATIC, WMON,
1547
+ # XLM, XRP |
1548
+ # | `extraParam.toAddress.networkName` | The network of the token.
1549
+ # <br>Example: ETHEREUM, POLYGON etc. <br> <br>Possible values:
1550
+ # <br>ETHEREUM, POLYGON, BSC, ARBITRUM, OPTIMISM, BASE, AVALANCHEC, BLAST,
1551
+ # HYPEREVM, SOLANA, BITCOIN, TRON, LITECOIN, DOGECOIN, RIPPLE, APTOS,
1552
+ # CARDANO, STELLAR, SUI, TON, SONIC, INJECTIVE, AVALANCHEX |
1553
+ # | `extraParam.toAddress.address` | The address to send the asset to. |
1554
+ # | `success_redirect` / `success_redirect` / `failure_redirect` | Where the
1555
+ # user should land after completing or canceling the payment or if the
1556
+ # transaction is in pending state. |
1557
+ # | `success_callback` / `failure_callback` | Your backend URL to receive
1558
+ # transaction status via webhook. |
1559
+ # | `client` | Customer billing info |
1560
+ # @param [PurchasesRequest11] body Required parameter: TODO: type
1561
+ # description here
1562
+ # @return [ApiResponse] Complete http response with raw body and status code.
1563
+ def purchases8(body)
1564
+ @api_call
1565
+ .request(new_request_builder(HttpMethodEnum::POST,
1566
+ '/api/v1/purchases',
1567
+ Server::SERVER_3)
1568
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1569
+ .body_param(new_parameter(body)
1570
+ .is_required(true))
1571
+ .header_param(new_parameter('application/json', key: 'accept'))
1572
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1573
+ .response(new_response_handler
1574
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1575
+ .deserialize_into(Purchases1.method(:from_hash))
1576
+ .is_api_response(true))
1577
+ .execute
1578
+ end
1579
+
1580
+ # To Initiate a payment, the very first call to make is `/purchases` with
1581
+ # the required data in the request body.
1582
+ # To generate a Purchase, you are required to provide the `Brand ID` (in the
1583
+ # request body) and `API key` (in the header) Both can be located in the
1584
+ # Dashboard section of your merchant account login.
1585
+ # The request body structure is shown on the request body of the example
1586
+ # request shown here.
1587
+ # The following (see table below) are the mandatory parameters that are
1588
+ # required to create a purchase request.
1589
+ # ### **Mandatory parameters in the request body:**
1590
+ # | Fields | **Notes** |
1591
+ # | --- | --- |
1592
+ # | client.email | The customer's email. |
1593
+ # | client.city | The customer's city. |
1594
+ # | client.country | ISO-3166 Country Code. Must be upper case. Example “SG”
1595
+ # (Alpha2) |
1596
+ # | client.stateCode | Example “AL”, “XZ”. Must be in upper case. |
1597
+ # | Client.street_address | The customer's address. |
1598
+ # | client.zip_code | The customer's ZIP or postal code. If country=US, zip
1599
+ # format must be NNNNN or NNNNN-NNNN. |
1600
+ # | purchase.currency | ISO 4217 code for currency you want to send the
1601
+ # transaction in. <br> <br>Please note, the currency has to be enabled by
1602
+ # the account manager for your account. |
1603
+ # | purchase.products | An object which contains the list of products which
1604
+ # the customer is buying. |
1605
+ # | purchase.products.name | The name of the product. |
1606
+ # | purchase.products.price | Price in decimal format. <br>example 1:
1607
+ # <br>EUR 5 , should be sent as 5.00 <br> <br>example 2: <br>USD 10 and
1608
+ # 37 cents , should be sent as 10.37 |
1609
+ # | brand_id | Obtain from Dashboard section of your merchant account login.
1610
+ # |
1611
+ # | success_redirect | URL to send the user if the transactions is
1612
+ # successful. |
1613
+ # | pending_redirect | URL to send the user if the transactions is in
1614
+ # pending. |
1615
+ # | failure_redirect | URL to send the user if the transactions is
1616
+ # unsuccessful. |
1617
+ # ## Optional Parameters
1618
+ # ### merchantRef
1619
+ # The `merchantRef` parameter, although not mandatory, is strongly advised
1620
+ # for merchants to specify. Its inclusion offers two significant advantages
1621
+ # for the merchant:
1622
+ # 1. **Prevention of Duplicate Requests:** When a `merchantRef` is utilized,
1623
+ # it acts as a unique identifier. This means that if a second purchase
1624
+ # request is made using the same `merchantRef` (reference number), the
1625
+ # system will recognize it and prevent duplicate transactions from
1626
+ # occurring. This prevents unintended or duplicate purchases.
1627
+ #
1628
+ # 2. **Facilitation of Transaction Retrieval:** In situations where the
1629
+ # response from the initial purchase request times out or the 'purchaseId'
1630
+ # isn't received, having the `merchantRef` allows the merchant to retrieve
1631
+ # detailed transaction information. This ensures they can track and access
1632
+ # the specific purchase details related to that reference, even if the
1633
+ # immediate response was not received.
1634
+ #
1635
+ # However, if the merchant does not specify the 'merchantRef' parameter, the
1636
+ # platform will automatically assign and use an internal 'purchaseId' as a
1637
+ # reference for that transaction.
1638
+ # ### Digital Signature (Optional Parameter) :
1639
+ # To ensure authenticity and non-repudiation of the the pay in request,
1640
+ # there is an option to digitally sign the pay in request by using the
1641
+ # merchant's public key.
1642
+ # **Public key generation :-**
1643
+ # <img
1644
+ # src="https://content.pstmn.io/1e198415-45ef-49d9-9dbf-8270bb853dab/aW1hZ2U
1645
+ # ucG5n" width="1570" height="743">
1646
+ # **Signature generation :-**
1647
+ # This digitial signature is generated by encrypting the following elements
1648
+ # of the pay in request:
1649
+ # Plaintext= Client.email+purchase.currency+
1650
+ # purchase.products.price+brand_id
1651
+ # **Example of encrypt plaintext with public key in java:-**
1652
+ # ``` java
1653
+ # private String encryptData(String plaintext, PublicKey publicKey) throws
1654
+ # Exception {
1655
+ # Cipher cipher = Cipher.getInstance("RSA");
1656
+ # cipher.init(Cipher.ENCRYPT_MODE, publicKey);
1657
+ # byte[] encryptedbytes = cipher.doFinal(message.getBytes());
1658
+ # return new String(Base64.getEncoder * ().encode(encryptedbytes));
1659
+ # }
1660
+ # ```
1661
+ # ### paymentMethod
1662
+ # The `paymentMethod` parameter identifies which payment solution merchant
1663
+ # wants to use to perform a transaction. If parameter is provided, than
1664
+ # Paysecure will perform direct payment with the selected payment method
1665
+ # instead of loading Paysecure URL.
1666
+ # ### Possible Error Messages
1667
+ # | **Error Messages** | **Description** |
1668
+ # | --- | --- |
1669
+ # | Invalid format of Date_of_Birth\[allowed format: yyyy-mm-dd\] | |
1670
+ # | Enter Valid Email | |
1671
+ # | Please submit Valid Alpha2 Country Code Ex:(AF,IN) in \\"country\\"
1672
+ # parameter | |
1673
+ # | Please pass Valid State Code | |
1674
+ # | Please pass valid street address in \\"street_address\\" parameter | |
1675
+ # | Please pass valid city name in \\"city\\" parameter | |
1676
+ # | Please pass valid postal Code name in \\"zip_code\\" parameter | |
1677
+ # | You are not Allowed for Live Transaction | |
1678
+ # | Minimum amount is not set for this merchant | |
1679
+ # | success_redirect/failure_redirect/brand_id is missing | |
1680
+ # | brand_id cannot be null | |
1681
+ # | success_redirect cannot be null | |
1682
+ # | failure_redirect cannot be null | |
1683
+ # | Invalid failure_redirect: minimum 10 characters | |
1684
+ # | purchase.products.price cannot be null | |
1685
+ # | purchase.products\[0\].name/purchase.products\[0\].price are missing |
1686
+ # |
1687
+ # | Your charges setting is incomplete .Plese Contact to Administrator. | |
1688
+ # | Currency "{curr_name}" is Not Allowed | |
1689
+ # | Transaction amount must be equal or greater to minimum trans amount | |
1690
+ # | Allowed Limit for this card for particular time period has been consumed
1691
+ # | |
1692
+ # **Note:** For certain use cases, in addition to long format purchase Id,
1693
+ # Paysecure also provides a 7 digit unique code for each purchase starting
1694
+ # with digit 4, eg 4000001
1695
+ # _“purchaseIdShortCode”: “4000013"_
1696
+ # @param [CreatePurchaseRequest2] body Required parameter: TODO: type
1697
+ # description here
1698
+ # @return [ApiResponse] Complete http response with raw body and status code.
1699
+ def create_purchase1(body)
1700
+ @api_call
1701
+ .request(new_request_builder(HttpMethodEnum::POST,
1702
+ '/api/v1/purchases',
1703
+ Server::SERVER_3)
1704
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1705
+ .body_param(new_parameter(body)
1706
+ .is_required(true))
1707
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
1708
+ .response(new_response_handler
1709
+ .deserializer(APIHelper.method(:deserialize_primitive_types))
1710
+ .deserialize_into(proc do |response| response&.to_s end)
1711
+ .is_api_response(true)
1712
+ .is_primitive_response(true))
1713
+ .execute
1714
+ end
1715
+
1716
+ # This API tells you about all the details of a purchase (PayIn), including
1717
+ # its history
1718
+ # **Note:** With respect to bank transfers, the purchase request is
1719
+ # synonymous with the PayIn request.
1720
+ # ### Mandatory
1721
+ # you need to pass the `PurchaseID` in the API URL
1722
+ # ### Possible Value of Status
1723
+ # | **Status** | **Notes** |
1724
+ # | --- | --- |
1725
+ # | paid | Transaction Successful |
1726
+ # | payment_in_process | Payment is under Processing |
1727
+ # | expired | Purchase has Expired. |
1728
+ # | error | Transaction has Failed. |
1729
+ # ### Response Examples
1730
+ # In the response examples you can see instances of both `Paid` and `Error`
1731
+ # Status purchases.
1732
+ # ### Error Details
1733
+ # If there are any issues on the Purchase you can get more details from the
1734
+ # `transaction_data.attempts.error` attribute of the response object
1735
+ # ### Errors
1736
+ # If there are any errors then it'll be in the format of :
1737
+ # ``` json
1738
+ # {
1739
+ # "message": "descriptive error message",
1740
+ # "code": "error_code"
1741
+ # }
1742
+ # ```
1743
+ # Please see the Status Code section for further details.
1744
+ # @param [String] purchase_id Required parameter: TODO: type description
1745
+ # here
1746
+ # @return [ApiResponse] Complete http response with raw body and status code.
1747
+ def get_status6(purchase_id)
1748
+ @api_call
1749
+ .request(new_request_builder(HttpMethodEnum::GET,
1750
+ '/api/v1/purchases/{purchaseId}',
1751
+ Server::SERVER_3)
1752
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1753
+ .template_param(new_parameter(purchase_id, key: 'purchaseId')
1754
+ .is_required(true)
1755
+ .should_encode(true))
1756
+ .header_param(new_parameter('application/json', key: 'accept')))
1757
+ .response(new_response_handler
1758
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1759
+ .deserialize_into(Success22.method(:from_hash))
1760
+ .is_api_response(true))
1761
+ .execute
1762
+ end
1763
+ end
1764
+ end