yapstone-payments 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +203 -0
  5. data/Rakefile +10 -0
  6. data/docs/APM.md +29 -0
  7. data/docs/APMSpecInParameters.md +19 -0
  8. data/docs/Action.md +16 -0
  9. data/docs/Address.md +29 -0
  10. data/docs/Amount.md +21 -0
  11. data/docs/AuthResponse.md +19 -0
  12. data/docs/AuthTokenRequest.md +19 -0
  13. data/docs/AuthTokenResponse.md +17 -0
  14. data/docs/AuthenticationApi.md +58 -0
  15. data/docs/BankAccount.md +37 -0
  16. data/docs/BillingAddress.md +29 -0
  17. data/docs/BookingInfo.md +31 -0
  18. data/docs/CapturePaymentRequest.md +21 -0
  19. data/docs/Card.md +27 -0
  20. data/docs/CardResponse.md +21 -0
  21. data/docs/Consent.md +21 -0
  22. data/docs/CreditCardAuthResponse.md +25 -0
  23. data/docs/Customer.md +29 -0
  24. data/docs/CustomerData.md +19 -0
  25. data/docs/CustomerDetails.md +23 -0
  26. data/docs/Deposit.md +23 -0
  27. data/docs/DepositDetails.md +17 -0
  28. data/docs/DisburseLineItemsReq.md +19 -0
  29. data/docs/DisburseTransaction.md +19 -0
  30. data/docs/DisburseTransactionReq.md +17 -0
  31. data/docs/Disbursement.md +17 -0
  32. data/docs/DisbursementAllOf.md +17 -0
  33. data/docs/DisbursementDetails.md +17 -0
  34. data/docs/DisbursementRequest.md +16 -0
  35. data/docs/DisbursementRequests.md +17 -0
  36. data/docs/DisbursementResponse.md +17 -0
  37. data/docs/DisbursementsApi.md +138 -0
  38. data/docs/Error.md +25 -0
  39. data/docs/ErrorResponse.md +19 -0
  40. data/docs/Fields.md +17 -0
  41. data/docs/GovIdentification.md +29 -0
  42. data/docs/Guest.md +29 -0
  43. data/docs/GuestInfoResponse.md +19 -0
  44. data/docs/Href.md +17 -0
  45. data/docs/InlineResponse200.md +25 -0
  46. data/docs/InstallmentPlan.md +19 -0
  47. data/docs/Instrument.md +21 -0
  48. data/docs/InstrumentVerificationResponse.md +31 -0
  49. data/docs/KYC.md +21 -0
  50. data/docs/LeaseInfo.md +21 -0
  51. data/docs/LineItemDetails.md +25 -0
  52. data/docs/MarketplaceData.md +23 -0
  53. data/docs/Merketplace.md +17 -0
  54. data/docs/Money.md +19 -0
  55. data/docs/Name.md +27 -0
  56. data/docs/OfferingDetails.md +21 -0
  57. data/docs/OrderTransactions.md +25 -0
  58. data/docs/Payment.md +21 -0
  59. data/docs/PaymentCancelResponse.md +23 -0
  60. data/docs/PaymentCancelTransactionResponse.md +21 -0
  61. data/docs/PaymentDetails.md +29 -0
  62. data/docs/PaymentInstrument.md +27 -0
  63. data/docs/PaymentInstrumentCard.md +19 -0
  64. data/docs/PaymentInstrumentResponse.md +19 -0
  65. data/docs/PaymentPayment.md +27 -0
  66. data/docs/PaymentPaymentAllOf.md +27 -0
  67. data/docs/PaymentResponse.md +33 -0
  68. data/docs/PaymentsApi.md +447 -0
  69. data/docs/Phone.md +21 -0
  70. data/docs/ProcessPayment.md +29 -0
  71. data/docs/PropertyInfo.md +21 -0
  72. data/docs/PropertyInfoResponse.md +19 -0
  73. data/docs/RefundAction.md +16 -0
  74. data/docs/RefundCancelResponse.md +21 -0
  75. data/docs/RefundCancelTransactionResponse.md +19 -0
  76. data/docs/RefundRequest.md +25 -0
  77. data/docs/RefundResponse.md +29 -0
  78. data/docs/RefundStatus.md +16 -0
  79. data/docs/RefundTransactions.md +27 -0
  80. data/docs/RefundsApi.md +378 -0
  81. data/docs/RentalInfo.md +21 -0
  82. data/docs/Renter.md +29 -0
  83. data/docs/Resolution.md +17 -0
  84. data/docs/Result.md +21 -0
  85. data/docs/RiskStatus.md +17 -0
  86. data/docs/SanctionedEntities.md +19 -0
  87. data/docs/SearchApi.md +132 -0
  88. data/docs/SearchPaymentResponse.md +17 -0
  89. data/docs/StackTraceElement.md +25 -0
  90. data/docs/Status.md +16 -0
  91. data/docs/Throwable.md +21 -0
  92. data/docs/ToEntityRef.md +19 -0
  93. data/docs/Token.md +19 -0
  94. data/docs/TokenApi.md +134 -0
  95. data/docs/TokenReq.md +19 -0
  96. data/docs/TokenRequest.md +17 -0
  97. data/docs/TokenResponse.md +17 -0
  98. data/docs/Transaction.md +21 -0
  99. data/docs/TransactionResponse.md +27 -0
  100. data/docs/Triggers.md +21 -0
  101. data/docs/VacationRentalInfo.md +19 -0
  102. data/docs/VacationRentalInfoRequest.md +21 -0
  103. data/docs/VerifyInstrumentRequest.md +21 -0
  104. data/git_push.sh +55 -0
  105. data/lib/yapstone-payments.rb +137 -0
  106. data/lib/yapstone-payments/api/authentication_api.rb +92 -0
  107. data/lib/yapstone-payments/api/disbursements_api.rb +202 -0
  108. data/lib/yapstone-payments/api/payments_api.rb +598 -0
  109. data/lib/yapstone-payments/api/refunds_api.rb +507 -0
  110. data/lib/yapstone-payments/api/search_api.rb +187 -0
  111. data/lib/yapstone-payments/api/token_api.rb +182 -0
  112. data/lib/yapstone-payments/api_client.rb +386 -0
  113. data/lib/yapstone-payments/api_error.rb +57 -0
  114. data/lib/yapstone-payments/configuration.rb +249 -0
  115. data/lib/yapstone-payments/models/action.rb +39 -0
  116. data/lib/yapstone-payments/models/address.rb +258 -0
  117. data/lib/yapstone-payments/models/amount.rb +218 -0
  118. data/lib/yapstone-payments/models/apm.rb +292 -0
  119. data/lib/yapstone-payments/models/apm_spec_in_parameters.rb +208 -0
  120. data/lib/yapstone-payments/models/auth_response.rb +217 -0
  121. data/lib/yapstone-payments/models/auth_token_request.rb +205 -0
  122. data/lib/yapstone-payments/models/auth_token_response.rb +196 -0
  123. data/lib/yapstone-payments/models/bank_account.rb +347 -0
  124. data/lib/yapstone-payments/models/billing_address.rb +258 -0
  125. data/lib/yapstone-payments/models/booking_info.rb +266 -0
  126. data/lib/yapstone-payments/models/capture_payment_request.rb +252 -0
  127. data/lib/yapstone-payments/models/card.rb +247 -0
  128. data/lib/yapstone-payments/models/card_response.rb +217 -0
  129. data/lib/yapstone-payments/models/consent.rb +248 -0
  130. data/lib/yapstone-payments/models/credit_card_auth_response.rb +267 -0
  131. data/lib/yapstone-payments/models/customer.rb +256 -0
  132. data/lib/yapstone-payments/models/customer_data.rb +208 -0
  133. data/lib/yapstone-payments/models/customer_details.rb +226 -0
  134. data/lib/yapstone-payments/models/deposit.rb +228 -0
  135. data/lib/yapstone-payments/models/deposit_details.rb +199 -0
  136. data/lib/yapstone-payments/models/disburse_line_items_req.rb +208 -0
  137. data/lib/yapstone-payments/models/disburse_transaction.rb +208 -0
  138. data/lib/yapstone-payments/models/disburse_transaction_req.rb +199 -0
  139. data/lib/yapstone-payments/models/disbursement.rb +203 -0
  140. data/lib/yapstone-payments/models/disbursement_all_of.rb +197 -0
  141. data/lib/yapstone-payments/models/disbursement_details.rb +200 -0
  142. data/lib/yapstone-payments/models/disbursement_request.rb +187 -0
  143. data/lib/yapstone-payments/models/disbursement_requests.rb +198 -0
  144. data/lib/yapstone-payments/models/disbursement_response.rb +198 -0
  145. data/lib/yapstone-payments/models/error.rb +241 -0
  146. data/lib/yapstone-payments/models/error_response.rb +218 -0
  147. data/lib/yapstone-payments/models/fields.rb +196 -0
  148. data/lib/yapstone-payments/models/gov_identification.rb +292 -0
  149. data/lib/yapstone-payments/models/guest.rb +257 -0
  150. data/lib/yapstone-payments/models/guest_info_response.rb +208 -0
  151. data/lib/yapstone-payments/models/href.rb +196 -0
  152. data/lib/yapstone-payments/models/inline_response200.rb +232 -0
  153. data/lib/yapstone-payments/models/installment_plan.rb +208 -0
  154. data/lib/yapstone-payments/models/instrument.rb +250 -0
  155. data/lib/yapstone-payments/models/instrument_verification_response.rb +260 -0
  156. data/lib/yapstone-payments/models/kyc.rb +215 -0
  157. data/lib/yapstone-payments/models/lease_info.rb +218 -0
  158. data/lib/yapstone-payments/models/line_item_details.rb +236 -0
  159. data/lib/yapstone-payments/models/marketplace_data.rb +260 -0
  160. data/lib/yapstone-payments/models/merketplace.rb +197 -0
  161. data/lib/yapstone-payments/models/money.rb +207 -0
  162. data/lib/yapstone-payments/models/name.rb +248 -0
  163. data/lib/yapstone-payments/models/offering_details.rb +216 -0
  164. data/lib/yapstone-payments/models/order_transactions.rb +235 -0
  165. data/lib/yapstone-payments/models/payment.rb +216 -0
  166. data/lib/yapstone-payments/models/payment_cancel_response.rb +227 -0
  167. data/lib/yapstone-payments/models/payment_cancel_transaction_response.rb +218 -0
  168. data/lib/yapstone-payments/models/payment_details.rb +319 -0
  169. data/lib/yapstone-payments/models/payment_instrument.rb +277 -0
  170. data/lib/yapstone-payments/models/payment_instrument_card.rb +241 -0
  171. data/lib/yapstone-payments/models/payment_instrument_response.rb +205 -0
  172. data/lib/yapstone-payments/models/payment_payment.rb +257 -0
  173. data/lib/yapstone-payments/models/payment_payment_all_of.rb +250 -0
  174. data/lib/yapstone-payments/models/payment_response.rb +275 -0
  175. data/lib/yapstone-payments/models/phone.rb +218 -0
  176. data/lib/yapstone-payments/models/process_payment.rb +304 -0
  177. data/lib/yapstone-payments/models/property_info.rb +216 -0
  178. data/lib/yapstone-payments/models/property_info_response.rb +207 -0
  179. data/lib/yapstone-payments/models/refund_action.rb +35 -0
  180. data/lib/yapstone-payments/models/refund_cancel_response.rb +217 -0
  181. data/lib/yapstone-payments/models/refund_cancel_transaction_response.rb +207 -0
  182. data/lib/yapstone-payments/models/refund_request.rb +285 -0
  183. data/lib/yapstone-payments/models/refund_response.rb +253 -0
  184. data/lib/yapstone-payments/models/refund_status.rb +90 -0
  185. data/lib/yapstone-payments/models/refund_transactions.rb +245 -0
  186. data/lib/yapstone-payments/models/rental_info.rb +215 -0
  187. data/lib/yapstone-payments/models/renter.rb +254 -0
  188. data/lib/yapstone-payments/models/resolution.rb +196 -0
  189. data/lib/yapstone-payments/models/result.rb +218 -0
  190. data/lib/yapstone-payments/models/risk_status.rb +196 -0
  191. data/lib/yapstone-payments/models/sanctioned_entities.rb +207 -0
  192. data/lib/yapstone-payments/models/search_payment_response.rb +196 -0
  193. data/lib/yapstone-payments/models/stack_trace_element.rb +238 -0
  194. data/lib/yapstone-payments/models/status.rb +91 -0
  195. data/lib/yapstone-payments/models/throwable.rb +220 -0
  196. data/lib/yapstone-payments/models/to_entity_ref.rb +207 -0
  197. data/lib/yapstone-payments/models/token.rb +207 -0
  198. data/lib/yapstone-payments/models/token_req.rb +206 -0
  199. data/lib/yapstone-payments/models/token_request.rb +196 -0
  200. data/lib/yapstone-payments/models/token_response.rb +196 -0
  201. data/lib/yapstone-payments/models/transaction.rb +218 -0
  202. data/lib/yapstone-payments/models/transaction_response.rb +248 -0
  203. data/lib/yapstone-payments/models/triggers.rb +216 -0
  204. data/lib/yapstone-payments/models/vacation_rental_info.rb +205 -0
  205. data/lib/yapstone-payments/models/vacation_rental_info_request.rb +215 -0
  206. data/lib/yapstone-payments/models/verify_instrument_request.rb +215 -0
  207. data/lib/yapstone-payments/version.rb +15 -0
  208. data/spec/api/authentication_api_spec.rb +48 -0
  209. data/spec/api/disbursements_api_spec.rb +69 -0
  210. data/spec/api/payments_api_spec.rb +146 -0
  211. data/spec/api/refunds_api_spec.rb +127 -0
  212. data/spec/api/search_api_spec.rb +66 -0
  213. data/spec/api/token_api_spec.rb +67 -0
  214. data/spec/api_client_spec.rb +226 -0
  215. data/spec/configuration_spec.rb +42 -0
  216. data/spec/models/action_spec.rb +35 -0
  217. data/spec/models/address_spec.rb +77 -0
  218. data/spec/models/amount_spec.rb +53 -0
  219. data/spec/models/apm_spec.rb +81 -0
  220. data/spec/models/apm_spec_in_parameters_spec.rb +47 -0
  221. data/spec/models/auth_response_spec.rb +47 -0
  222. data/spec/models/auth_token_request_spec.rb +47 -0
  223. data/spec/models/auth_token_response_spec.rb +41 -0
  224. data/spec/models/bank_account_spec.rb +105 -0
  225. data/spec/models/billing_address_spec.rb +77 -0
  226. data/spec/models/booking_info_spec.rb +83 -0
  227. data/spec/models/capture_payment_request_spec.rb +57 -0
  228. data/spec/models/card_response_spec.rb +53 -0
  229. data/spec/models/card_spec.rb +71 -0
  230. data/spec/models/consent_spec.rb +57 -0
  231. data/spec/models/credit_card_auth_response_spec.rb +69 -0
  232. data/spec/models/customer_data_spec.rb +47 -0
  233. data/spec/models/customer_details_spec.rb +59 -0
  234. data/spec/models/customer_spec.rb +77 -0
  235. data/spec/models/deposit_details_spec.rb +41 -0
  236. data/spec/models/deposit_spec.rb +59 -0
  237. data/spec/models/disburse_line_items_req_spec.rb +47 -0
  238. data/spec/models/disburse_transaction_req_spec.rb +41 -0
  239. data/spec/models/disburse_transaction_spec.rb +47 -0
  240. data/spec/models/disbursement_all_of_spec.rb +41 -0
  241. data/spec/models/disbursement_details_spec.rb +41 -0
  242. data/spec/models/disbursement_request_spec.rb +35 -0
  243. data/spec/models/disbursement_requests_spec.rb +41 -0
  244. data/spec/models/disbursement_response_spec.rb +41 -0
  245. data/spec/models/disbursement_spec.rb +41 -0
  246. data/spec/models/error_response_spec.rb +47 -0
  247. data/spec/models/error_spec.rb +65 -0
  248. data/spec/models/fields_spec.rb +41 -0
  249. data/spec/models/gov_identification_spec.rb +81 -0
  250. data/spec/models/guest_info_response_spec.rb +47 -0
  251. data/spec/models/guest_spec.rb +77 -0
  252. data/spec/models/href_spec.rb +41 -0
  253. data/spec/models/inline_response200_spec.rb +65 -0
  254. data/spec/models/installment_plan_spec.rb +47 -0
  255. data/spec/models/instrument_spec.rb +57 -0
  256. data/spec/models/instrument_verification_response_spec.rb +83 -0
  257. data/spec/models/kyc_spec.rb +53 -0
  258. data/spec/models/lease_info_spec.rb +53 -0
  259. data/spec/models/line_item_details_spec.rb +65 -0
  260. data/spec/models/marketplace_data_spec.rb +63 -0
  261. data/spec/models/merketplace_spec.rb +41 -0
  262. data/spec/models/money_spec.rb +47 -0
  263. data/spec/models/name_spec.rb +71 -0
  264. data/spec/models/offering_details_spec.rb +53 -0
  265. data/spec/models/order_transactions_spec.rb +65 -0
  266. data/spec/models/payment_cancel_response_spec.rb +59 -0
  267. data/spec/models/payment_cancel_transaction_response_spec.rb +53 -0
  268. data/spec/models/payment_details_spec.rb +81 -0
  269. data/spec/models/payment_instrument_card_spec.rb +51 -0
  270. data/spec/models/payment_instrument_response_spec.rb +47 -0
  271. data/spec/models/payment_instrument_spec.rb +75 -0
  272. data/spec/models/payment_payment_all_of_spec.rb +71 -0
  273. data/spec/models/payment_payment_spec.rb +71 -0
  274. data/spec/models/payment_response_spec.rb +89 -0
  275. data/spec/models/payment_spec.rb +53 -0
  276. data/spec/models/phone_spec.rb +53 -0
  277. data/spec/models/process_payment_spec.rb +77 -0
  278. data/spec/models/property_info_response_spec.rb +47 -0
  279. data/spec/models/property_info_spec.rb +53 -0
  280. data/spec/models/refund_action_spec.rb +35 -0
  281. data/spec/models/refund_cancel_response_spec.rb +53 -0
  282. data/spec/models/refund_cancel_transaction_response_spec.rb +47 -0
  283. data/spec/models/refund_request_spec.rb +65 -0
  284. data/spec/models/refund_response_spec.rb +77 -0
  285. data/spec/models/refund_status_spec.rb +35 -0
  286. data/spec/models/refund_transactions_spec.rb +71 -0
  287. data/spec/models/rental_info_spec.rb +53 -0
  288. data/spec/models/renter_spec.rb +77 -0
  289. data/spec/models/resolution_spec.rb +41 -0
  290. data/spec/models/result_spec.rb +53 -0
  291. data/spec/models/risk_status_spec.rb +41 -0
  292. data/spec/models/sanctioned_entities_spec.rb +47 -0
  293. data/spec/models/search_payment_response_spec.rb +41 -0
  294. data/spec/models/stack_trace_element_spec.rb +65 -0
  295. data/spec/models/status_spec.rb +35 -0
  296. data/spec/models/throwable_spec.rb +53 -0
  297. data/spec/models/to_entity_ref_spec.rb +47 -0
  298. data/spec/models/token_req_spec.rb +47 -0
  299. data/spec/models/token_request_spec.rb +41 -0
  300. data/spec/models/token_response_spec.rb +41 -0
  301. data/spec/models/token_spec.rb +47 -0
  302. data/spec/models/transaction_response_spec.rb +71 -0
  303. data/spec/models/transaction_spec.rb +53 -0
  304. data/spec/models/triggers_spec.rb +53 -0
  305. data/spec/models/vacation_rental_info_request_spec.rb +53 -0
  306. data/spec/models/vacation_rental_info_spec.rb +47 -0
  307. data/spec/models/verify_instrument_request_spec.rb +53 -0
  308. data/spec/spec_helper.rb +111 -0
  309. data/yapstone-payments.gemspec +45 -0
  310. metadata +633 -0
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #Payments Orchestrator
3
+
4
+ #\"REST API for Payments Orchestrator\"
5
+
6
+ The version of the OpenAPI document: 1.6.4-SNAPSHOT
7
+ Contact: test@yapstone.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Yapstone
16
+ class DisbursementsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Change payment from \"Hold payout\" state to be ready for disbursement
23
+ # Disburse payment
24
+ # @param authorization [String] Authorization
25
+ # @param x_yapstone_ip_address [String] IP Address of the client
26
+ # @param payment_id [String]
27
+ # @param disbursement_requests [DisbursementRequests]
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
30
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
31
+ # @return [PaymentResponse]
32
+ def disburse_payment_by_id(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts = {})
33
+ data, _status_code, _headers = disburse_payment_by_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts)
34
+ data
35
+ end
36
+
37
+ # Change payment from \"Hold payout\" state to be ready for disbursement
38
+ # Disburse payment
39
+ # @param authorization [String] Authorization
40
+ # @param x_yapstone_ip_address [String] IP Address of the client
41
+ # @param payment_id [String]
42
+ # @param disbursement_requests [DisbursementRequests]
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
45
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
46
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
47
+ def disburse_payment_by_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: DisbursementsApi.disburse_payment_by_id ...'
50
+ end
51
+ # verify the required parameter 'authorization' is set
52
+ if @api_client.config.client_side_validation && authorization.nil?
53
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling DisbursementsApi.disburse_payment_by_id"
54
+ end
55
+ # verify the required parameter 'x_yapstone_ip_address' is set
56
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
57
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling DisbursementsApi.disburse_payment_by_id"
58
+ end
59
+ # verify the required parameter 'payment_id' is set
60
+ if @api_client.config.client_side_validation && payment_id.nil?
61
+ fail ArgumentError, "Missing the required parameter 'payment_id' when calling DisbursementsApi.disburse_payment_by_id"
62
+ end
63
+ # verify the required parameter 'disbursement_requests' is set
64
+ if @api_client.config.client_side_validation && disbursement_requests.nil?
65
+ fail ArgumentError, "Missing the required parameter 'disbursement_requests' when calling DisbursementsApi.disburse_payment_by_id"
66
+ end
67
+ # resource path
68
+ local_var_path = '/v2/disbursements/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))
69
+
70
+ # query parameters
71
+ query_params = opts[:query_params] || {}
72
+
73
+ # header parameters
74
+ header_params = opts[:header_params] || {}
75
+ # HTTP header 'Accept' (if needed)
76
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
77
+ # HTTP header 'Content-Type'
78
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
79
+ header_params[:'Authorization'] = authorization
80
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
81
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
82
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
83
+
84
+ # form parameters
85
+ form_params = opts[:form_params] || {}
86
+
87
+ # http body (model)
88
+ post_body = opts[:body] || @api_client.object_to_http_body(disbursement_requests)
89
+
90
+ # return_type
91
+ return_type = opts[:return_type] || 'PaymentResponse'
92
+
93
+ # auth_names
94
+ auth_names = opts[:auth_names] || ['Bearer']
95
+
96
+ new_options = opts.merge(
97
+ :header_params => header_params,
98
+ :query_params => query_params,
99
+ :form_params => form_params,
100
+ :body => post_body,
101
+ :auth_names => auth_names,
102
+ :return_type => return_type
103
+ )
104
+
105
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug "API called: DisbursementsApi#disburse_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
108
+ end
109
+ return data, status_code, headers
110
+ end
111
+
112
+ # Change transaction from \"Hold payout\" state to be ready for disbursement (payout)
113
+ # Provide the transaction ID for the transaction where you want to shift state so that money can finally be paid out (disbursed).
114
+ # @param authorization [String] Authorization
115
+ # @param x_yapstone_ip_address [String] IP Address of the client
116
+ # @param transaction_id [String] The identification number for the transaction you want to disburse.
117
+ # @param disburse_transaction_req [DisburseTransactionReq]
118
+ # @param [Hash] opts the optional parameters
119
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
120
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
121
+ # @return [PaymentResponse]
122
+ def disburse_transaction_by_id(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts = {})
123
+ data, _status_code, _headers = disburse_transaction_by_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts)
124
+ data
125
+ end
126
+
127
+ # Change transaction from \&quot;Hold payout\&quot; state to be ready for disbursement (payout)
128
+ # Provide the transaction ID for the transaction where you want to shift state so that money can finally be paid out (disbursed).
129
+ # @param authorization [String] Authorization
130
+ # @param x_yapstone_ip_address [String] IP Address of the client
131
+ # @param transaction_id [String] The identification number for the transaction you want to disburse.
132
+ # @param disburse_transaction_req [DisburseTransactionReq]
133
+ # @param [Hash] opts the optional parameters
134
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
135
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
136
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
137
+ def disburse_transaction_by_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts = {})
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug 'Calling API: DisbursementsApi.disburse_transaction_by_id ...'
140
+ end
141
+ # verify the required parameter 'authorization' is set
142
+ if @api_client.config.client_side_validation && authorization.nil?
143
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling DisbursementsApi.disburse_transaction_by_id"
144
+ end
145
+ # verify the required parameter 'x_yapstone_ip_address' is set
146
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
147
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling DisbursementsApi.disburse_transaction_by_id"
148
+ end
149
+ # verify the required parameter 'transaction_id' is set
150
+ if @api_client.config.client_side_validation && transaction_id.nil?
151
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling DisbursementsApi.disburse_transaction_by_id"
152
+ end
153
+ # verify the required parameter 'disburse_transaction_req' is set
154
+ if @api_client.config.client_side_validation && disburse_transaction_req.nil?
155
+ fail ArgumentError, "Missing the required parameter 'disburse_transaction_req' when calling DisbursementsApi.disburse_transaction_by_id"
156
+ end
157
+ # resource path
158
+ local_var_path = '/v2/disbursements/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/'))
159
+
160
+ # query parameters
161
+ query_params = opts[:query_params] || {}
162
+
163
+ # header parameters
164
+ header_params = opts[:header_params] || {}
165
+ # HTTP header 'Accept' (if needed)
166
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
167
+ # HTTP header 'Content-Type'
168
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
169
+ header_params[:'Authorization'] = authorization
170
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
171
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
172
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
173
+
174
+ # form parameters
175
+ form_params = opts[:form_params] || {}
176
+
177
+ # http body (model)
178
+ post_body = opts[:body] || @api_client.object_to_http_body(disburse_transaction_req)
179
+
180
+ # return_type
181
+ return_type = opts[:return_type] || 'PaymentResponse'
182
+
183
+ # auth_names
184
+ auth_names = opts[:auth_names] || ['Bearer']
185
+
186
+ new_options = opts.merge(
187
+ :header_params => header_params,
188
+ :query_params => query_params,
189
+ :form_params => form_params,
190
+ :body => post_body,
191
+ :auth_names => auth_names,
192
+ :return_type => return_type
193
+ )
194
+
195
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug "API called: DisbursementsApi#disburse_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
198
+ end
199
+ return data, status_code, headers
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,598 @@
1
+ =begin
2
+ #Payments Orchestrator
3
+
4
+ #\"REST API for Payments Orchestrator\"
5
+
6
+ The version of the OpenAPI document: 1.6.4-SNAPSHOT
7
+ Contact: test@yapstone.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Yapstone
16
+ class PaymentsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cancel Payment by payment Id
23
+ # Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment.
24
+ # @param authorization [String] Authorization
25
+ # @param x_yapstone_ip_address [String] Ip Address of the client
26
+ # @param payment_id [String] paymentId
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
29
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
30
+ # @return [PaymentCancelResponse]
31
+ def cancel_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
32
+ data, _status_code, _headers = cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
33
+ data
34
+ end
35
+
36
+ # Cancel Payment by payment Id
37
+ # Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment.
38
+ # @param authorization [String] Authorization
39
+ # @param x_yapstone_ip_address [String] Ip Address of the client
40
+ # @param payment_id [String] paymentId
41
+ # @param [Hash] opts the optional parameters
42
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
43
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
44
+ # @return [Array<(PaymentCancelResponse, Integer, Hash)>] PaymentCancelResponse data, response status code and response headers
45
+ def cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_payment ...'
48
+ end
49
+ # verify the required parameter 'authorization' is set
50
+ if @api_client.config.client_side_validation && authorization.nil?
51
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.cancel_payment"
52
+ end
53
+ # verify the required parameter 'x_yapstone_ip_address' is set
54
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
55
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.cancel_payment"
56
+ end
57
+ # verify the required parameter 'payment_id' is set
58
+ if @api_client.config.client_side_validation && payment_id.nil?
59
+ fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentsApi.cancel_payment"
60
+ end
61
+ # resource path
62
+ local_var_path = '/v2/payments/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+
67
+ # header parameters
68
+ header_params = opts[:header_params] || {}
69
+ # HTTP header 'Accept' (if needed)
70
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
71
+ header_params[:'Authorization'] = authorization
72
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
73
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
74
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
75
+
76
+ # form parameters
77
+ form_params = opts[:form_params] || {}
78
+
79
+ # http body (model)
80
+ post_body = opts[:body]
81
+
82
+ # return_type
83
+ return_type = opts[:return_type] || 'PaymentCancelResponse'
84
+
85
+ # auth_names
86
+ auth_names = opts[:auth_names] || ['Bearer']
87
+
88
+ new_options = opts.merge(
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: PaymentsApi#cancel_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+
104
+ # Cancel Transaction by TransactionId
105
+ # Use a transaction identifier to cancel a transaction.
106
+ # @param authorization [String] Authorization
107
+ # @param x_yapstone_ip_address [String] Ip Address of the client
108
+ # @param transaction_id [String] The transaction ID for the transaction you would like to cancel.
109
+ # @param [Hash] opts the optional parameters
110
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
111
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
112
+ # @return [PaymentCancelTransactionResponse]
113
+ def cancel_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
114
+ data, _status_code, _headers = cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
115
+ data
116
+ end
117
+
118
+ # Cancel Transaction by TransactionId
119
+ # Use a transaction identifier to cancel a transaction.
120
+ # @param authorization [String] Authorization
121
+ # @param x_yapstone_ip_address [String] Ip Address of the client
122
+ # @param transaction_id [String] The transaction ID for the transaction you would like to cancel.
123
+ # @param [Hash] opts the optional parameters
124
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
125
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
126
+ # @return [Array<(PaymentCancelTransactionResponse, Integer, Hash)>] PaymentCancelTransactionResponse data, response status code and response headers
127
+ def cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_transaction ...'
130
+ end
131
+ # verify the required parameter 'authorization' is set
132
+ if @api_client.config.client_side_validation && authorization.nil?
133
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.cancel_transaction"
134
+ end
135
+ # verify the required parameter 'x_yapstone_ip_address' is set
136
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
137
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.cancel_transaction"
138
+ end
139
+ # verify the required parameter 'transaction_id' is set
140
+ if @api_client.config.client_side_validation && transaction_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentsApi.cancel_transaction"
142
+ end
143
+ # resource path
144
+ local_var_path = '/v2/payments/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/'))
145
+
146
+ # query parameters
147
+ query_params = opts[:query_params] || {}
148
+
149
+ # header parameters
150
+ header_params = opts[:header_params] || {}
151
+ # HTTP header 'Accept' (if needed)
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
153
+ header_params[:'Authorization'] = authorization
154
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
155
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
156
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
157
+
158
+ # form parameters
159
+ form_params = opts[:form_params] || {}
160
+
161
+ # http body (model)
162
+ post_body = opts[:body]
163
+
164
+ # return_type
165
+ return_type = opts[:return_type] || 'PaymentCancelTransactionResponse'
166
+
167
+ # auth_names
168
+ auth_names = opts[:auth_names] || ['Bearer']
169
+
170
+ new_options = opts.merge(
171
+ :header_params => header_params,
172
+ :query_params => query_params,
173
+ :form_params => form_params,
174
+ :body => post_body,
175
+ :auth_names => auth_names,
176
+ :return_type => return_type
177
+ )
178
+
179
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug "API called: PaymentsApi#cancel_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
182
+ end
183
+ return data, status_code, headers
184
+ end
185
+
186
+ # Capture a prior authorized payment
187
+ # Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer's account to the merchant's account.
188
+ # @param authorization [String] Authorization
189
+ # @param x_yapstone_ip_address [String] Ip Address of the client
190
+ # @param payment_id [String] The payment ID associated with the payment. You can use this to retrieve a payment or chance its status.
191
+ # @param [Hash] opts the optional parameters
192
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
193
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
194
+ # @option opts [CapturePaymentRequest] :capture_payment_request
195
+ # @return [PaymentResponse]
196
+ def capture_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
197
+ data, _status_code, _headers = capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
198
+ data
199
+ end
200
+
201
+ # Capture a prior authorized payment
202
+ # Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer&#39;s account to the merchant&#39;s account.
203
+ # @param authorization [String] Authorization
204
+ # @param x_yapstone_ip_address [String] Ip Address of the client
205
+ # @param payment_id [String] The payment ID associated with the payment. You can use this to retrieve a payment or chance its status.
206
+ # @param [Hash] opts the optional parameters
207
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
208
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
209
+ # @option opts [CapturePaymentRequest] :capture_payment_request
210
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
211
+ def capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.capture_payment ...'
214
+ end
215
+ # verify the required parameter 'authorization' is set
216
+ if @api_client.config.client_side_validation && authorization.nil?
217
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.capture_payment"
218
+ end
219
+ # verify the required parameter 'x_yapstone_ip_address' is set
220
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
221
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.capture_payment"
222
+ end
223
+ # verify the required parameter 'payment_id' is set
224
+ if @api_client.config.client_side_validation && payment_id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentsApi.capture_payment"
226
+ end
227
+ # resource path
228
+ local_var_path = '/v2/payments/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))
229
+
230
+ # query parameters
231
+ query_params = opts[:query_params] || {}
232
+
233
+ # header parameters
234
+ header_params = opts[:header_params] || {}
235
+ # HTTP header 'Accept' (if needed)
236
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
237
+ # HTTP header 'Content-Type'
238
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
239
+ header_params[:'Authorization'] = authorization
240
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
241
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
242
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'capture_payment_request'])
249
+
250
+ # return_type
251
+ return_type = opts[:return_type] || 'PaymentResponse'
252
+
253
+ # auth_names
254
+ auth_names = opts[:auth_names] || ['Bearer']
255
+
256
+ new_options = opts.merge(
257
+ :header_params => header_params,
258
+ :query_params => query_params,
259
+ :form_params => form_params,
260
+ :body => post_body,
261
+ :auth_names => auth_names,
262
+ :return_type => return_type
263
+ )
264
+
265
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
266
+ if @api_client.config.debugging
267
+ @api_client.config.logger.debug "API called: PaymentsApi#capture_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
268
+ end
269
+ return data, status_code, headers
270
+ end
271
+
272
+ # Process Payment
273
+ # The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from.
274
+ # @param authorization [String] Authorization
275
+ # @param x_yapstone_ip_address [String] This is the IP address of the client.
276
+ # @param process_payment [ProcessPayment] processPayment
277
+ # @param [Hash] opts the optional parameters
278
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
279
+ # @option opts [String] :x_yapstone_fpsid A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment.
280
+ # @return [PaymentResponse]
281
+ def create_payment(authorization, x_yapstone_ip_address, process_payment, opts = {})
282
+ data, _status_code, _headers = create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts)
283
+ data
284
+ end
285
+
286
+ # Process Payment
287
+ # The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from.
288
+ # @param authorization [String] Authorization
289
+ # @param x_yapstone_ip_address [String] This is the IP address of the client.
290
+ # @param process_payment [ProcessPayment] processPayment
291
+ # @param [Hash] opts the optional parameters
292
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
293
+ # @option opts [String] :x_yapstone_fpsid A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment.
294
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
295
+ def create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
298
+ end
299
+ # verify the required parameter 'authorization' is set
300
+ if @api_client.config.client_side_validation && authorization.nil?
301
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.create_payment"
302
+ end
303
+ # verify the required parameter 'x_yapstone_ip_address' is set
304
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
305
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.create_payment"
306
+ end
307
+ # verify the required parameter 'process_payment' is set
308
+ if @api_client.config.client_side_validation && process_payment.nil?
309
+ fail ArgumentError, "Missing the required parameter 'process_payment' when calling PaymentsApi.create_payment"
310
+ end
311
+ # resource path
312
+ local_var_path = '/v2/payments/payment'
313
+
314
+ # query parameters
315
+ query_params = opts[:query_params] || {}
316
+
317
+ # header parameters
318
+ header_params = opts[:header_params] || {}
319
+ # HTTP header 'Accept' (if needed)
320
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
321
+ # HTTP header 'Content-Type'
322
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
323
+ header_params[:'Authorization'] = authorization
324
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
325
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
326
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
327
+
328
+ # form parameters
329
+ form_params = opts[:form_params] || {}
330
+
331
+ # http body (model)
332
+ post_body = opts[:body] || @api_client.object_to_http_body(process_payment)
333
+
334
+ # return_type
335
+ return_type = opts[:return_type] || 'PaymentResponse'
336
+
337
+ # auth_names
338
+ auth_names = opts[:auth_names] || ['Bearer']
339
+
340
+ new_options = opts.merge(
341
+ :header_params => header_params,
342
+ :query_params => query_params,
343
+ :form_params => form_params,
344
+ :body => post_body,
345
+ :auth_names => auth_names,
346
+ :return_type => return_type
347
+ )
348
+
349
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
350
+ if @api_client.config.debugging
351
+ @api_client.config.logger.debug "API called: PaymentsApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
352
+ end
353
+ return data, status_code, headers
354
+ end
355
+
356
+ # Get with Payment Id
357
+ # This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response.
358
+ # @param authorization [String] Authorization
359
+ # @param x_yapstone_ip_address [String] IP Address of the client
360
+ # @param payment_id [String] paymentId
361
+ # @param [Hash] opts the optional parameters
362
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
363
+ # @return [PaymentResponse]
364
+ def get_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
365
+ data, _status_code, _headers = get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
366
+ data
367
+ end
368
+
369
+ # Get with Payment Id
370
+ # This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response.
371
+ # @param authorization [String] Authorization
372
+ # @param x_yapstone_ip_address [String] IP Address of the client
373
+ # @param payment_id [String] paymentId
374
+ # @param [Hash] opts the optional parameters
375
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
376
+ # @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers
377
+ def get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
378
+ if @api_client.config.debugging
379
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
380
+ end
381
+ # verify the required parameter 'authorization' is set
382
+ if @api_client.config.client_side_validation && authorization.nil?
383
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.get_payment"
384
+ end
385
+ # verify the required parameter 'x_yapstone_ip_address' is set
386
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
387
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.get_payment"
388
+ end
389
+ # verify the required parameter 'payment_id' is set
390
+ if @api_client.config.client_side_validation && payment_id.nil?
391
+ fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentsApi.get_payment"
392
+ end
393
+ # resource path
394
+ local_var_path = '/v2/payments/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))
395
+
396
+ # query parameters
397
+ query_params = opts[:query_params] || {}
398
+
399
+ # header parameters
400
+ header_params = opts[:header_params] || {}
401
+ # HTTP header 'Accept' (if needed)
402
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
403
+ header_params[:'Authorization'] = authorization
404
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
405
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
406
+
407
+ # form parameters
408
+ form_params = opts[:form_params] || {}
409
+
410
+ # http body (model)
411
+ post_body = opts[:body]
412
+
413
+ # return_type
414
+ return_type = opts[:return_type] || 'PaymentResponse'
415
+
416
+ # auth_names
417
+ auth_names = opts[:auth_names] || ['Bearer']
418
+
419
+ new_options = opts.merge(
420
+ :header_params => header_params,
421
+ :query_params => query_params,
422
+ :form_params => form_params,
423
+ :body => post_body,
424
+ :auth_names => auth_names,
425
+ :return_type => return_type
426
+ )
427
+
428
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
429
+ if @api_client.config.debugging
430
+ @api_client.config.logger.debug "API called: PaymentsApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
431
+ end
432
+ return data, status_code, headers
433
+ end
434
+
435
+ # Get Transaction by Transaction Id
436
+ # Retrieve information about a specific transaction.
437
+ # @param authorization [String] Authorization
438
+ # @param x_yapstone_ip_address [String] IP Address of the client
439
+ # @param transaction_id [String] The transaction identifier for the transaction you want to retrieve details about.
440
+ # @param [Hash] opts the optional parameters
441
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
442
+ # @return [OrderTransactions]
443
+ def get_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
444
+ data, _status_code, _headers = get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
445
+ data
446
+ end
447
+
448
+ # Get Transaction by Transaction Id
449
+ # Retrieve information about a specific transaction.
450
+ # @param authorization [String] Authorization
451
+ # @param x_yapstone_ip_address [String] IP Address of the client
452
+ # @param transaction_id [String] The transaction identifier for the transaction you want to retrieve details about.
453
+ # @param [Hash] opts the optional parameters
454
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
455
+ # @return [Array<(OrderTransactions, Integer, Hash)>] OrderTransactions data, response status code and response headers
456
+ def get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.get_transaction ...'
459
+ end
460
+ # verify the required parameter 'authorization' is set
461
+ if @api_client.config.client_side_validation && authorization.nil?
462
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.get_transaction"
463
+ end
464
+ # verify the required parameter 'x_yapstone_ip_address' is set
465
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
466
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.get_transaction"
467
+ end
468
+ # verify the required parameter 'transaction_id' is set
469
+ if @api_client.config.client_side_validation && transaction_id.nil?
470
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentsApi.get_transaction"
471
+ end
472
+ # resource path
473
+ local_var_path = '/v2/payments/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/'))
474
+
475
+ # query parameters
476
+ query_params = opts[:query_params] || {}
477
+
478
+ # header parameters
479
+ header_params = opts[:header_params] || {}
480
+ # HTTP header 'Accept' (if needed)
481
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
482
+ header_params[:'Authorization'] = authorization
483
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
484
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
485
+
486
+ # form parameters
487
+ form_params = opts[:form_params] || {}
488
+
489
+ # http body (model)
490
+ post_body = opts[:body]
491
+
492
+ # return_type
493
+ return_type = opts[:return_type] || 'OrderTransactions'
494
+
495
+ # auth_names
496
+ auth_names = opts[:auth_names] || ['Bearer']
497
+
498
+ new_options = opts.merge(
499
+ :header_params => header_params,
500
+ :query_params => query_params,
501
+ :form_params => form_params,
502
+ :body => post_body,
503
+ :auth_names => auth_names,
504
+ :return_type => return_type
505
+ )
506
+
507
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
508
+ if @api_client.config.debugging
509
+ @api_client.config.logger.debug "API called: PaymentsApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
510
+ end
511
+ return data, status_code, headers
512
+ end
513
+
514
+ # Verify payment instrument
515
+ # Use this endpoint to verify that a customer's payment instrument is valid and associated with them.
516
+ # @param authorization [String] Authorization
517
+ # @param x_yapstone_ip_address [String] IP Address of the client
518
+ # @param verify_instrument_request [VerifyInstrumentRequest] verifyInstrumentRequest
519
+ # @param [Hash] opts the optional parameters
520
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
521
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
522
+ # @return [InstrumentVerificationResponse]
523
+ def verify_payment_instrument(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
524
+ data, _status_code, _headers = verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts)
525
+ data
526
+ end
527
+
528
+ # Verify payment instrument
529
+ # Use this endpoint to verify that a customer&#39;s payment instrument is valid and associated with them.
530
+ # @param authorization [String] Authorization
531
+ # @param x_yapstone_ip_address [String] IP Address of the client
532
+ # @param verify_instrument_request [VerifyInstrumentRequest] verifyInstrumentRequest
533
+ # @param [Hash] opts the optional parameters
534
+ # @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.
535
+ # @option opts [String] :x_yapstone_fpsid Device Finger Print Id
536
+ # @return [Array<(InstrumentVerificationResponse, Integer, Hash)>] InstrumentVerificationResponse data, response status code and response headers
537
+ def verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.verify_payment_instrument ...'
540
+ end
541
+ # verify the required parameter 'authorization' is set
542
+ if @api_client.config.client_side_validation && authorization.nil?
543
+ fail ArgumentError, "Missing the required parameter 'authorization' when calling PaymentsApi.verify_payment_instrument"
544
+ end
545
+ # verify the required parameter 'x_yapstone_ip_address' is set
546
+ if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
547
+ fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling PaymentsApi.verify_payment_instrument"
548
+ end
549
+ # verify the required parameter 'verify_instrument_request' is set
550
+ if @api_client.config.client_side_validation && verify_instrument_request.nil?
551
+ fail ArgumentError, "Missing the required parameter 'verify_instrument_request' when calling PaymentsApi.verify_payment_instrument"
552
+ end
553
+ # resource path
554
+ local_var_path = '/v2/payments/instrument/verify'
555
+
556
+ # query parameters
557
+ query_params = opts[:query_params] || {}
558
+
559
+ # header parameters
560
+ header_params = opts[:header_params] || {}
561
+ # HTTP header 'Accept' (if needed)
562
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
563
+ # HTTP header 'Content-Type'
564
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
565
+ header_params[:'Authorization'] = authorization
566
+ header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
567
+ header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
568
+ header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?
569
+
570
+ # form parameters
571
+ form_params = opts[:form_params] || {}
572
+
573
+ # http body (model)
574
+ post_body = opts[:body] || @api_client.object_to_http_body(verify_instrument_request)
575
+
576
+ # return_type
577
+ return_type = opts[:return_type] || 'InstrumentVerificationResponse'
578
+
579
+ # auth_names
580
+ auth_names = opts[:auth_names] || ['Bearer']
581
+
582
+ new_options = opts.merge(
583
+ :header_params => header_params,
584
+ :query_params => query_params,
585
+ :form_params => form_params,
586
+ :body => post_body,
587
+ :auth_names => auth_names,
588
+ :return_type => return_type
589
+ )
590
+
591
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
592
+ if @api_client.config.debugging
593
+ @api_client.config.logger.debug "API called: PaymentsApi#verify_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
594
+ end
595
+ return data, status_code, headers
596
+ end
597
+ end
598
+ end