bleumi_pay_sdk_ruby 1.0.2 → 1.0.3

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 (124) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -43
  3. data/bleumi_pay_sdk_ruby.gemspec +2 -3
  4. data/docs/BadRequest.md +1 -0
  5. data/docs/Chain.md +11 -0
  6. data/docs/CheckoutToken.md +23 -0
  7. data/docs/CreateCheckoutUrlRequest.md +30 -0
  8. data/docs/CreateCheckoutUrlResponse.md +17 -0
  9. data/docs/CreatePaymentRequest.md +19 -0
  10. data/docs/CreatePaymentResponse.md +15 -0
  11. data/docs/CreatePayoutRequest.md +28 -0
  12. data/docs/CreatePayoutResponse.md +15 -0
  13. data/docs/EthAddress.md +6 -1
  14. data/docs/HostedCheckoutsApi.md +190 -0
  15. data/docs/NetworkBalance.md +29 -0
  16. data/docs/PaginatedPaymentOperations.md +29 -0
  17. data/docs/PaginatedPayments.md +68 -0
  18. data/docs/PaginatedPayoutItems.md +59 -0
  19. data/docs/Payment.md +44 -0
  20. data/docs/PaymentAddresses.md +22 -0
  21. data/docs/PaymentBalances.md +24 -0
  22. data/docs/PaymentOperation.md +46 -0
  23. data/docs/PaymentOperationInputs.md +32 -0
  24. data/docs/PaymentOperationResponse.md +15 -0
  25. data/docs/PaymentRefundRequest.md +16 -0
  26. data/docs/PaymentSettleRequest.md +17 -0
  27. data/docs/PaymentsApi.md +426 -0
  28. data/docs/Payout.md +17 -0
  29. data/docs/PayoutItem.md +39 -0
  30. data/docs/PayoutItemInputs.md +28 -0
  31. data/docs/PayoutsApi.md +137 -0
  32. data/docs/Token.md +15 -0
  33. data/docs/ValidateCheckoutRequest.md +21 -0
  34. data/docs/ValidateCheckoutResponse.md +15 -0
  35. data/docs/WalletAddress.md +14 -0
  36. data/docs/WalletBalance.md +14 -4
  37. data/lib/bleumi_pay_sdk_ruby.rb +32 -15
  38. data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +200 -0
  39. data/lib/bleumi_pay_sdk_ruby/api/{erc20_payments_api.rb → payments_api.rb} +130 -124
  40. data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
  41. data/lib/bleumi_pay_sdk_ruby/api_client.rb +2 -2
  42. data/lib/bleumi_pay_sdk_ruby/api_error.rb +2 -2
  43. data/lib/bleumi_pay_sdk_ruby/configuration.rb +2 -2
  44. data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +13 -3
  45. data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +7 -5
  46. data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +272 -0
  47. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +299 -0
  48. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
  49. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +17 -7
  50. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +18 -22
  51. data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +243 -0
  52. data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
  53. data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +2 -2
  54. data/lib/bleumi_pay_sdk_ruby/models/network_balance.rb +274 -0
  55. data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
  56. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +18 -8
  57. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +18 -8
  58. data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +30 -53
  59. data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +209 -0
  60. data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +207 -0
  61. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +42 -17
  62. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +37 -11
  63. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +17 -7
  64. data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +17 -7
  65. data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +17 -7
  66. data/lib/bleumi_pay_sdk_ruby/models/payout.rb +227 -0
  67. data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
  68. data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
  69. data/lib/bleumi_pay_sdk_ruby/models/token.rb +214 -0
  70. data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → validate_checkout_request.rb} +57 -62
  71. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
  72. data/lib/bleumi_pay_sdk_ruby/models/wallet_address.rb +212 -0
  73. data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +17 -7
  74. data/lib/bleumi_pay_sdk_ruby/version.rb +3 -3
  75. data/spec/api/hosted_checkouts_api_spec.rb +67 -0
  76. data/spec/api/payments_api_spec.rb +122 -0
  77. data/spec/api/payouts_api_spec.rb +61 -0
  78. data/spec/api_client_spec.rb +226 -0
  79. data/spec/configuration_spec.rb +42 -0
  80. data/spec/models/bad_request_spec.rb +47 -0
  81. data/spec/models/chain_spec.rb +35 -0
  82. data/spec/models/checkout_token_spec.rb +65 -0
  83. data/spec/models/create_checkout_url_request_spec.rb +83 -0
  84. data/spec/models/create_checkout_url_response_spec.rb +47 -0
  85. data/spec/models/create_payment_request_spec.rb +53 -0
  86. data/spec/models/create_payment_response_spec.rb +41 -0
  87. data/spec/models/create_payout_request_spec.rb +53 -0
  88. data/spec/models/create_payout_response_spec.rb +41 -0
  89. data/spec/models/eth_address_spec.rb +41 -0
  90. data/spec/models/network_balance_spec.rb +77 -0
  91. data/spec/models/paginated_payment_operations_spec.rb +47 -0
  92. data/spec/models/paginated_payments_spec.rb +47 -0
  93. data/spec/models/paginated_payout_items_spec.rb +47 -0
  94. data/spec/models/payment_addresses_spec.rb +41 -0
  95. data/spec/models/payment_balances_spec.rb +41 -0
  96. data/spec/models/payment_operation_inputs_spec.rb +65 -0
  97. data/spec/models/payment_operation_response_spec.rb +41 -0
  98. data/spec/models/payment_operation_spec.rb +71 -0
  99. data/spec/models/payment_refund_request_spec.rb +41 -0
  100. data/spec/models/payment_settle_request_spec.rb +47 -0
  101. data/spec/models/payment_spec.rb +65 -0
  102. data/spec/models/payout_item_inputs_spec.rb +53 -0
  103. data/spec/models/payout_item_spec.rb +71 -0
  104. data/spec/models/payout_spec.rb +47 -0
  105. data/spec/models/token_spec.rb +41 -0
  106. data/spec/models/validate_checkout_request_spec.rb +59 -0
  107. data/spec/models/validate_checkout_response_spec.rb +41 -0
  108. data/spec/models/wallet_address_spec.rb +41 -0
  109. data/spec/models/wallet_balance_spec.rb +59 -0
  110. data/spec/spec_helper.rb +111 -0
  111. metadata +149 -45
  112. data/docs/Erc20PaymentsApi.md +0 -334
  113. data/docs/EthNetwork.md +0 -9
  114. data/docs/PaginatedWalletOperations.md +0 -8
  115. data/docs/PaginatedWallets.md +0 -8
  116. data/docs/Wallet.md +0 -13
  117. data/docs/WalletCreateInput.md +0 -9
  118. data/docs/WalletCreateOutput.md +0 -10
  119. data/docs/WalletInputs.md +0 -11
  120. data/docs/WalletOperation.md +0 -11
  121. data/docs/WalletOperationInputs.md +0 -10
  122. data/docs/WalletOperationOutput.md +0 -8
  123. data/docs/WalletRefundOperationInput.md +0 -7
  124. data/docs/WalletSettleOperationInput.md +0 -8
@@ -1,49 +1,49 @@
1
1
  =begin
2
2
  #Bleumi Pay API
3
3
 
4
- #A simple and powerful REST API to integrate ERC20 payments into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: info@bleumi.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
13
13
  require 'cgi'
14
14
 
15
15
  module BleumiPay
16
- class Erc20PaymentsApi
16
+ class PaymentsApi
17
17
  attr_accessor :api_client
18
18
 
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Create an unique wallet address to accept payments for an ERC-20 token from a buyer
23
- # @param wallet_create_input [WalletCreateInput]
22
+ # Generate a unique wallet address in the specified network to accept payment
23
+ # @param create_payment_request [CreatePaymentRequest]
24
24
  # @param [Hash] opts the optional parameters
25
- # @option opts [EthNetwork] :chain Ethereum network in which wallet is to be created.
26
- # @return [WalletCreateOutput]
27
- def generate_wallet(wallet_create_input, opts = {})
28
- data, _status_code, _headers = generate_wallet_with_http_info(wallet_create_input, opts)
25
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
26
+ # @return [CreatePaymentResponse]
27
+ def create_payment(create_payment_request, opts = {})
28
+ data, _status_code, _headers = create_payment_with_http_info(create_payment_request, opts)
29
29
  data
30
30
  end
31
31
 
32
- # Create an unique wallet address to accept payments for an ERC-20 token from a buyer
33
- # @param wallet_create_input [WalletCreateInput]
32
+ # Generate a unique wallet address in the specified network to accept payment
33
+ # @param create_payment_request [CreatePaymentRequest]
34
34
  # @param [Hash] opts the optional parameters
35
- # @option opts [EthNetwork] :chain Ethereum network in which wallet is to be created.
36
- # @return [Array<(WalletCreateOutput, Integer, Hash)>] WalletCreateOutput data, response status code and response headers
37
- def generate_wallet_with_http_info(wallet_create_input, opts = {})
35
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
36
+ # @return [Array<(CreatePaymentResponse, Integer, Hash)>] CreatePaymentResponse data, response status code and response headers
37
+ def create_payment_with_http_info(create_payment_request, opts = {})
38
38
  if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.generate_wallet ...'
39
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
40
40
  end
41
- # verify the required parameter 'wallet_create_input' is set
42
- if @api_client.config.client_side_validation && wallet_create_input.nil?
43
- fail ArgumentError, "Missing the required parameter 'wallet_create_input' when calling Erc20PaymentsApi.generate_wallet"
41
+ # verify the required parameter 'create_payment_request' is set
42
+ if @api_client.config.client_side_validation && create_payment_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_payment_request' when calling PaymentsApi.create_payment"
44
44
  end
45
45
  # resource path
46
- local_var_path = '/v1/payment/eth/wallet'
46
+ local_var_path = '/v1/payment'
47
47
 
48
48
  # query parameters
49
49
  query_params = opts[:query_params] || {}
@@ -60,10 +60,10 @@ module BleumiPay
60
60
  form_params = opts[:form_params] || {}
61
61
 
62
62
  # http body (model)
63
- post_body = opts[:body] || @api_client.object_to_http_body(wallet_create_input)
63
+ post_body = opts[:body] || @api_client.object_to_http_body(create_payment_request)
64
64
 
65
65
  # return_type
66
- return_type = opts[:return_type] || 'WalletCreateOutput'
66
+ return_type = opts[:return_type] || 'CreatePaymentResponse'
67
67
 
68
68
  # auth_names
69
69
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -79,34 +79,34 @@ module BleumiPay
79
79
 
80
80
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
81
81
  if @api_client.config.debugging
82
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#generate_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ @api_client.config.logger.debug "API called: PaymentsApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
83
  end
84
84
  return data, status_code, headers
85
85
  end
86
86
 
87
- # Return a specific wallet
88
- # @param id [String] Unique ID identifying the wallet in your system
87
+ # Retrieve the wallet addresses & token balances for a given payment
88
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment)) to retrieve
89
89
  # @param [Hash] opts the optional parameters
90
- # @return [Wallet]
91
- def get_wallet(id, opts = {})
92
- data, _status_code, _headers = get_wallet_with_http_info(id, opts)
90
+ # @return [Payment]
91
+ def get_payment(id, opts = {})
92
+ data, _status_code, _headers = get_payment_with_http_info(id, opts)
93
93
  data
94
94
  end
95
95
 
96
- # Return a specific wallet
97
- # @param id [String] Unique ID identifying the wallet in your system
96
+ # Retrieve the wallet addresses &amp; token balances for a given payment
97
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment)) to retrieve
98
98
  # @param [Hash] opts the optional parameters
99
- # @return [Array<(Wallet, Integer, Hash)>] Wallet data, response status code and response headers
100
- def get_wallet_with_http_info(id, opts = {})
99
+ # @return [Array<(Payment, Integer, Hash)>] Payment data, response status code and response headers
100
+ def get_payment_with_http_info(id, opts = {})
101
101
  if @api_client.config.debugging
102
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.get_wallet ...'
102
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
103
103
  end
104
104
  # verify the required parameter 'id' is set
105
105
  if @api_client.config.client_side_validation && id.nil?
106
- fail ArgumentError, "Missing the required parameter 'id' when calling Erc20PaymentsApi.get_wallet"
106
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.get_payment"
107
107
  end
108
108
  # resource path
109
- local_var_path = '/v1/payment/eth/wallet/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
109
+ local_var_path = '/v1/payment/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
110
110
 
111
111
  # query parameters
112
112
  query_params = opts[:query_params] || {}
@@ -123,7 +123,7 @@ module BleumiPay
123
123
  post_body = opts[:body]
124
124
 
125
125
  # return_type
126
- return_type = opts[:return_type] || 'Wallet'
126
+ return_type = opts[:return_type] || 'Payment'
127
127
 
128
128
  # auth_names
129
129
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -139,40 +139,40 @@ module BleumiPay
139
139
 
140
140
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
141
141
  if @api_client.config.debugging
142
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#get_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ @api_client.config.logger.debug "API called: PaymentsApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
143
  end
144
144
  return data, status_code, headers
145
145
  end
146
146
 
147
- # Return a specific operation of the wallet
148
- # @param id [String] Unique ID identifying the wallet in your system
149
- # @param txid [String] ID of a specific operation of the wallet
147
+ # Retrieve a payment operation for a specific payment.
148
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
149
+ # @param txid [String] ID of a specific operation of the payment
150
150
  # @param [Hash] opts the optional parameters
151
- # @return [WalletOperation]
152
- def get_wallet_operation(id, txid, opts = {})
153
- data, _status_code, _headers = get_wallet_operation_with_http_info(id, txid, opts)
151
+ # @return [PaymentOperation]
152
+ def get_payment_operation(id, txid, opts = {})
153
+ data, _status_code, _headers = get_payment_operation_with_http_info(id, txid, opts)
154
154
  data
155
155
  end
156
156
 
157
- # Return a specific operation of the wallet
158
- # @param id [String] Unique ID identifying the wallet in your system
159
- # @param txid [String] ID of a specific operation of the wallet
157
+ # Retrieve a payment operation for a specific payment.
158
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
159
+ # @param txid [String] ID of a specific operation of the payment
160
160
  # @param [Hash] opts the optional parameters
161
- # @return [Array<(WalletOperation, Integer, Hash)>] WalletOperation data, response status code and response headers
162
- def get_wallet_operation_with_http_info(id, txid, opts = {})
161
+ # @return [Array<(PaymentOperation, Integer, Hash)>] PaymentOperation data, response status code and response headers
162
+ def get_payment_operation_with_http_info(id, txid, opts = {})
163
163
  if @api_client.config.debugging
164
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.get_wallet_operation ...'
164
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment_operation ...'
165
165
  end
166
166
  # verify the required parameter 'id' is set
167
167
  if @api_client.config.client_side_validation && id.nil?
168
- fail ArgumentError, "Missing the required parameter 'id' when calling Erc20PaymentsApi.get_wallet_operation"
168
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.get_payment_operation"
169
169
  end
170
170
  # verify the required parameter 'txid' is set
171
171
  if @api_client.config.client_side_validation && txid.nil?
172
- fail ArgumentError, "Missing the required parameter 'txid' when calling Erc20PaymentsApi.get_wallet_operation"
172
+ fail ArgumentError, "Missing the required parameter 'txid' when calling PaymentsApi.get_payment_operation"
173
173
  end
174
174
  # resource path
175
- local_var_path = '/v1/payment/eth/wallet/{id}/operation/{txid}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'txid' + '}', CGI.escape(txid.to_s))
175
+ local_var_path = '/v1/payment/{id}/operation/{txid}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'txid' + '}', CGI.escape(txid.to_s))
176
176
 
177
177
  # query parameters
178
178
  query_params = opts[:query_params] || {}
@@ -189,7 +189,7 @@ module BleumiPay
189
189
  post_body = opts[:body]
190
190
 
191
191
  # return_type
192
- return_type = opts[:return_type] || 'WalletOperation'
192
+ return_type = opts[:return_type] || 'PaymentOperation'
193
193
 
194
194
  # auth_names
195
195
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -205,36 +205,36 @@ module BleumiPay
205
205
 
206
206
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
207
207
  if @api_client.config.debugging
208
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#get_wallet_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ @api_client.config.logger.debug "API called: PaymentsApi#get_payment_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
209
  end
210
210
  return data, status_code, headers
211
211
  end
212
212
 
213
- # Return the list of operations performed by the mechant on a specific wallet
214
- # @param id [String] Unique ID identifying the wallet in your system
213
+ # Retrieve all payment operations for a specific payment.
214
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
215
215
  # @param [Hash] opts the optional parameters
216
216
  # @option opts [String] :next_token Cursor to start results from
217
- # @return [PaginatedWalletOperations]
218
- def list_wallet_operations(id, opts = {})
219
- data, _status_code, _headers = list_wallet_operations_with_http_info(id, opts)
217
+ # @return [PaginatedPaymentOperations]
218
+ def list_payment_operations(id, opts = {})
219
+ data, _status_code, _headers = list_payment_operations_with_http_info(id, opts)
220
220
  data
221
221
  end
222
222
 
223
- # Return the list of operations performed by the mechant on a specific wallet
224
- # @param id [String] Unique ID identifying the wallet in your system
223
+ # Retrieve all payment operations for a specific payment.
224
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
225
225
  # @param [Hash] opts the optional parameters
226
226
  # @option opts [String] :next_token Cursor to start results from
227
- # @return [Array<(PaginatedWalletOperations, Integer, Hash)>] PaginatedWalletOperations data, response status code and response headers
228
- def list_wallet_operations_with_http_info(id, opts = {})
227
+ # @return [Array<(PaginatedPaymentOperations, Integer, Hash)>] PaginatedPaymentOperations data, response status code and response headers
228
+ def list_payment_operations_with_http_info(id, opts = {})
229
229
  if @api_client.config.debugging
230
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.list_wallet_operations ...'
230
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.list_payment_operations ...'
231
231
  end
232
232
  # verify the required parameter 'id' is set
233
233
  if @api_client.config.client_side_validation && id.nil?
234
- fail ArgumentError, "Missing the required parameter 'id' when calling Erc20PaymentsApi.list_wallet_operations"
234
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.list_payment_operations"
235
235
  end
236
236
  # resource path
237
- local_var_path = '/v1/payment/eth/wallet/{id}/operation'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
237
+ local_var_path = '/v1/payment/{id}/operation'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
238
238
 
239
239
  # query parameters
240
240
  query_params = opts[:query_params] || {}
@@ -252,7 +252,7 @@ module BleumiPay
252
252
  post_body = opts[:body]
253
253
 
254
254
  # return_type
255
- return_type = opts[:return_type] || 'PaginatedWalletOperations'
255
+ return_type = opts[:return_type] || 'PaginatedPaymentOperations'
256
256
 
257
257
  # auth_names
258
258
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -268,40 +268,40 @@ module BleumiPay
268
268
 
269
269
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
270
270
  if @api_client.config.debugging
271
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#list_wallet_operations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
271
+ @api_client.config.logger.debug "API called: PaymentsApi#list_payment_operations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
272
  end
273
273
  return data, status_code, headers
274
274
  end
275
275
 
276
- # Returns a list of wallets
276
+ # Retrieve all payments created.
277
277
  # @param [Hash] opts the optional parameters
278
278
  # @option opts [String] :next_token Cursor to start results from
279
- # @option opts [String] :sort_by Sort wallets by
280
- # @option opts [String] :start_at Get wallets from this timestamp
281
- # @option opts [String] :end_at Get wallets till this timestamp
282
- # @return [PaginatedWallets]
283
- def list_wallets(opts = {})
284
- data, _status_code, _headers = list_wallets_with_http_info(opts)
279
+ # @option opts [String] :sort_by Sort payments by
280
+ # @option opts [String] :start_at Get payments from this timestamp (unix)
281
+ # @option opts [String] :end_at Get payments till this timestamp (unix)
282
+ # @return [PaginatedPayments]
283
+ def list_payments(opts = {})
284
+ data, _status_code, _headers = list_payments_with_http_info(opts)
285
285
  data
286
286
  end
287
287
 
288
- # Returns a list of wallets
288
+ # Retrieve all payments created.
289
289
  # @param [Hash] opts the optional parameters
290
290
  # @option opts [String] :next_token Cursor to start results from
291
- # @option opts [String] :sort_by Sort wallets by
292
- # @option opts [String] :start_at Get wallets from this timestamp
293
- # @option opts [String] :end_at Get wallets till this timestamp
294
- # @return [Array<(PaginatedWallets, Integer, Hash)>] PaginatedWallets data, response status code and response headers
295
- def list_wallets_with_http_info(opts = {})
291
+ # @option opts [String] :sort_by Sort payments by
292
+ # @option opts [String] :start_at Get payments from this timestamp (unix)
293
+ # @option opts [String] :end_at Get payments till this timestamp (unix)
294
+ # @return [Array<(PaginatedPayments, Integer, Hash)>] PaginatedPayments data, response status code and response headers
295
+ def list_payments_with_http_info(opts = {})
296
296
  if @api_client.config.debugging
297
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.list_wallets ...'
297
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.list_payments ...'
298
298
  end
299
299
  allowable_values = ["createdAt", "updatedAt"]
300
300
  if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
301
301
  fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
302
302
  end
303
303
  # resource path
304
- local_var_path = '/v1/payment/eth/wallet'
304
+ local_var_path = '/v1/payment'
305
305
 
306
306
  # query parameters
307
307
  query_params = opts[:query_params] || {}
@@ -322,7 +322,7 @@ module BleumiPay
322
322
  post_body = opts[:body]
323
323
 
324
324
  # return_type
325
- return_type = opts[:return_type] || 'PaginatedWallets'
325
+ return_type = opts[:return_type] || 'PaginatedPayments'
326
326
 
327
327
  # auth_names
328
328
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -338,43 +338,46 @@ module BleumiPay
338
338
 
339
339
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
340
340
  if @api_client.config.debugging
341
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#list_wallets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ @api_client.config.logger.debug "API called: PaymentsApi#list_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
342
  end
343
343
  return data, status_code, headers
344
344
  end
345
345
 
346
- # Refund wallet
347
- # @param id [String] Unique ID identifying this record in your system
348
- # @param wallet_refund_operation_input [WalletRefundOperationInput] Request body - used to specify the token to refund.
346
+ # Refund the balance of a token for a given payment to the buyerAddress
347
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
348
+ # @param payment_refund_request [PaymentRefundRequest] Request body - used to specify the token to refund.
349
349
  # @param [Hash] opts the optional parameters
350
- # @return [WalletOperationOutput]
351
- def refund_wallet(id, wallet_refund_operation_input, opts = {})
352
- data, _status_code, _headers = refund_wallet_with_http_info(id, wallet_refund_operation_input, opts)
350
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created.
351
+ # @return [PaymentOperationResponse]
352
+ def refund_payment(id, payment_refund_request, opts = {})
353
+ data, _status_code, _headers = refund_payment_with_http_info(id, payment_refund_request, opts)
353
354
  data
354
355
  end
355
356
 
356
- # Refund wallet
357
- # @param id [String] Unique ID identifying this record in your system
358
- # @param wallet_refund_operation_input [WalletRefundOperationInput] Request body - used to specify the token to refund.
357
+ # Refund the balance of a token for a given payment to the buyerAddress
358
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
359
+ # @param payment_refund_request [PaymentRefundRequest] Request body - used to specify the token to refund.
359
360
  # @param [Hash] opts the optional parameters
360
- # @return [Array<(WalletOperationOutput, Integer, Hash)>] WalletOperationOutput data, response status code and response headers
361
- def refund_wallet_with_http_info(id, wallet_refund_operation_input, opts = {})
361
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created.
362
+ # @return [Array<(PaymentOperationResponse, Integer, Hash)>] PaymentOperationResponse data, response status code and response headers
363
+ def refund_payment_with_http_info(id, payment_refund_request, opts = {})
362
364
  if @api_client.config.debugging
363
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.refund_wallet ...'
365
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.refund_payment ...'
364
366
  end
365
367
  # verify the required parameter 'id' is set
366
368
  if @api_client.config.client_side_validation && id.nil?
367
- fail ArgumentError, "Missing the required parameter 'id' when calling Erc20PaymentsApi.refund_wallet"
369
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.refund_payment"
368
370
  end
369
- # verify the required parameter 'wallet_refund_operation_input' is set
370
- if @api_client.config.client_side_validation && wallet_refund_operation_input.nil?
371
- fail ArgumentError, "Missing the required parameter 'wallet_refund_operation_input' when calling Erc20PaymentsApi.refund_wallet"
371
+ # verify the required parameter 'payment_refund_request' is set
372
+ if @api_client.config.client_side_validation && payment_refund_request.nil?
373
+ fail ArgumentError, "Missing the required parameter 'payment_refund_request' when calling PaymentsApi.refund_payment"
372
374
  end
373
375
  # resource path
374
- local_var_path = '/v1/payment/eth/wallet/{id}/refund'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
376
+ local_var_path = '/v1/payment/{id}/refund'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
375
377
 
376
378
  # query parameters
377
379
  query_params = opts[:query_params] || {}
380
+ query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
378
381
 
379
382
  # header parameters
380
383
  header_params = opts[:header_params] || {}
@@ -387,10 +390,10 @@ module BleumiPay
387
390
  form_params = opts[:form_params] || {}
388
391
 
389
392
  # http body (model)
390
- post_body = opts[:body] || @api_client.object_to_http_body(wallet_refund_operation_input)
393
+ post_body = opts[:body] || @api_client.object_to_http_body(payment_refund_request)
391
394
 
392
395
  # return_type
393
- return_type = opts[:return_type] || 'WalletOperationOutput'
396
+ return_type = opts[:return_type] || 'PaymentOperationResponse'
394
397
 
395
398
  # auth_names
396
399
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -406,43 +409,46 @@ module BleumiPay
406
409
 
407
410
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
408
411
  if @api_client.config.debugging
409
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#refund_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
412
+ @api_client.config.logger.debug "API called: PaymentsApi#refund_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
410
413
  end
411
414
  return data, status_code, headers
412
415
  end
413
416
 
414
- # Settle a wallet, amount received will be transferred even if less than payment amount
415
- # @param id [String] Unique ID identifying this record in your system
416
- # @param wallet_settle_operation_input [WalletSettleOperationInput] Request body - used to specify the amount to settle.
417
+ # Settle a specific amount of a token for a given payment to the transferAddress and remaining balance (if any) will be refunded to the buyerAddress
418
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
419
+ # @param payment_settle_request [PaymentSettleRequest] Request body - used to specify the amount to settle.
417
420
  # @param [Hash] opts the optional parameters
418
- # @return [WalletOperationOutput]
419
- def settle_wallet(id, wallet_settle_operation_input, opts = {})
420
- data, _status_code, _headers = settle_wallet_with_http_info(id, wallet_settle_operation_input, opts)
421
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created.
422
+ # @return [PaymentOperationResponse]
423
+ def settle_payment(id, payment_settle_request, opts = {})
424
+ data, _status_code, _headers = settle_payment_with_http_info(id, payment_settle_request, opts)
421
425
  data
422
426
  end
423
427
 
424
- # Settle a wallet, amount received will be transferred even if less than payment amount
425
- # @param id [String] Unique ID identifying this record in your system
426
- # @param wallet_settle_operation_input [WalletSettleOperationInput] Request body - used to specify the amount to settle.
428
+ # Settle a specific amount of a token for a given payment to the transferAddress and remaining balance (if any) will be refunded to the buyerAddress
429
+ # @param id [String] Unique identifier of the payment (specified during [Create a Payment](#createPayment))
430
+ # @param payment_settle_request [PaymentSettleRequest] Request body - used to specify the amount to settle.
427
431
  # @param [Hash] opts the optional parameters
428
- # @return [Array<(WalletOperationOutput, Integer, Hash)>] WalletOperationOutput data, response status code and response headers
429
- def settle_wallet_with_http_info(id, wallet_settle_operation_input, opts = {})
432
+ # @option opts [Chain] :chain Ethereum network in which payment is to be created.
433
+ # @return [Array<(PaymentOperationResponse, Integer, Hash)>] PaymentOperationResponse data, response status code and response headers
434
+ def settle_payment_with_http_info(id, payment_settle_request, opts = {})
430
435
  if @api_client.config.debugging
431
- @api_client.config.logger.debug 'Calling API: Erc20PaymentsApi.settle_wallet ...'
436
+ @api_client.config.logger.debug 'Calling API: PaymentsApi.settle_payment ...'
432
437
  end
433
438
  # verify the required parameter 'id' is set
434
439
  if @api_client.config.client_side_validation && id.nil?
435
- fail ArgumentError, "Missing the required parameter 'id' when calling Erc20PaymentsApi.settle_wallet"
440
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.settle_payment"
436
441
  end
437
- # verify the required parameter 'wallet_settle_operation_input' is set
438
- if @api_client.config.client_side_validation && wallet_settle_operation_input.nil?
439
- fail ArgumentError, "Missing the required parameter 'wallet_settle_operation_input' when calling Erc20PaymentsApi.settle_wallet"
442
+ # verify the required parameter 'payment_settle_request' is set
443
+ if @api_client.config.client_side_validation && payment_settle_request.nil?
444
+ fail ArgumentError, "Missing the required parameter 'payment_settle_request' when calling PaymentsApi.settle_payment"
440
445
  end
441
446
  # resource path
442
- local_var_path = '/v1/payment/eth/wallet/{id}/settle'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
447
+ local_var_path = '/v1/payment/{id}/settle'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
443
448
 
444
449
  # query parameters
445
450
  query_params = opts[:query_params] || {}
451
+ query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
446
452
 
447
453
  # header parameters
448
454
  header_params = opts[:header_params] || {}
@@ -455,10 +461,10 @@ module BleumiPay
455
461
  form_params = opts[:form_params] || {}
456
462
 
457
463
  # http body (model)
458
- post_body = opts[:body] || @api_client.object_to_http_body(wallet_settle_operation_input)
464
+ post_body = opts[:body] || @api_client.object_to_http_body(payment_settle_request)
459
465
 
460
466
  # return_type
461
- return_type = opts[:return_type] || 'WalletOperationOutput'
467
+ return_type = opts[:return_type] || 'PaymentOperationResponse'
462
468
 
463
469
  # auth_names
464
470
  auth_names = opts[:auth_names] || ['ApiKeyAuth']
@@ -474,7 +480,7 @@ module BleumiPay
474
480
 
475
481
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
476
482
  if @api_client.config.debugging
477
- @api_client.config.logger.debug "API called: Erc20PaymentsApi#settle_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
483
+ @api_client.config.logger.debug "API called: PaymentsApi#settle_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
478
484
  end
479
485
  return data, status_code, headers
480
486
  end