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.
- checksums.yaml +4 -4
- data/README.md +61 -43
- data/bleumi_pay_sdk_ruby.gemspec +2 -3
- data/docs/BadRequest.md +1 -0
- data/docs/Chain.md +11 -0
- data/docs/CheckoutToken.md +23 -0
- data/docs/CreateCheckoutUrlRequest.md +30 -0
- data/docs/CreateCheckoutUrlResponse.md +17 -0
- data/docs/CreatePaymentRequest.md +19 -0
- data/docs/CreatePaymentResponse.md +15 -0
- data/docs/CreatePayoutRequest.md +28 -0
- data/docs/CreatePayoutResponse.md +15 -0
- data/docs/EthAddress.md +6 -1
- data/docs/HostedCheckoutsApi.md +190 -0
- data/docs/NetworkBalance.md +29 -0
- data/docs/PaginatedPaymentOperations.md +29 -0
- data/docs/PaginatedPayments.md +68 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +44 -0
- data/docs/PaymentAddresses.md +22 -0
- data/docs/PaymentBalances.md +24 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +32 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +16 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +426 -0
- data/docs/Payout.md +17 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/Token.md +15 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletAddress.md +14 -0
- data/docs/WalletBalance.md +14 -4
- data/lib/bleumi_pay_sdk_ruby.rb +32 -15
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +200 -0
- data/lib/bleumi_pay_sdk_ruby/api/{erc20_payments_api.rb → payments_api.rb} +130 -124
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +13 -3
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +7 -5
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +272 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +299 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +18 -22
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +243 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/network_balance.rb +274 -0
- data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +30 -53
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +209 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +207 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +42 -17
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +37 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +227 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/token.rb +214 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → validate_checkout_request.rb} +57 -62
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_address.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +17 -7
- data/lib/bleumi_pay_sdk_ruby/version.rb +3 -3
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +122 -0
- data/spec/api/payouts_api_spec.rb +61 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/bad_request_spec.rb +47 -0
- data/spec/models/chain_spec.rb +35 -0
- data/spec/models/checkout_token_spec.rb +65 -0
- data/spec/models/create_checkout_url_request_spec.rb +83 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +53 -0
- data/spec/models/create_payment_response_spec.rb +41 -0
- data/spec/models/create_payout_request_spec.rb +53 -0
- data/spec/models/create_payout_response_spec.rb +41 -0
- data/spec/models/eth_address_spec.rb +41 -0
- data/spec/models/network_balance_spec.rb +77 -0
- data/spec/models/paginated_payment_operations_spec.rb +47 -0
- data/spec/models/paginated_payments_spec.rb +47 -0
- data/spec/models/paginated_payout_items_spec.rb +47 -0
- data/spec/models/payment_addresses_spec.rb +41 -0
- data/spec/models/payment_balances_spec.rb +41 -0
- data/spec/models/payment_operation_inputs_spec.rb +65 -0
- data/spec/models/payment_operation_response_spec.rb +41 -0
- data/spec/models/payment_operation_spec.rb +71 -0
- data/spec/models/payment_refund_request_spec.rb +41 -0
- data/spec/models/payment_settle_request_spec.rb +47 -0
- data/spec/models/payment_spec.rb +65 -0
- data/spec/models/payout_item_inputs_spec.rb +53 -0
- data/spec/models/payout_item_spec.rb +71 -0
- data/spec/models/payout_spec.rb +47 -0
- data/spec/models/token_spec.rb +41 -0
- data/spec/models/validate_checkout_request_spec.rb +59 -0
- data/spec/models/validate_checkout_response_spec.rb +41 -0
- data/spec/models/wallet_address_spec.rb +41 -0
- data/spec/models/wallet_balance_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +149 -45
- data/docs/Erc20PaymentsApi.md +0 -334
- data/docs/EthNetwork.md +0 -9
- data/docs/PaginatedWalletOperations.md +0 -8
- data/docs/PaginatedWallets.md +0 -8
- data/docs/Wallet.md +0 -13
- data/docs/WalletCreateInput.md +0 -9
- data/docs/WalletCreateOutput.md +0 -10
- data/docs/WalletInputs.md +0 -11
- data/docs/WalletOperation.md +0 -11
- data/docs/WalletOperationInputs.md +0 -10
- data/docs/WalletOperationOutput.md +0 -8
- data/docs/WalletRefundOperationInput.md +0 -7
- 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
|
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.
|
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
|
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
|
-
#
|
23
|
-
# @param
|
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 [
|
26
|
-
# @return [
|
27
|
-
def
|
28
|
-
data, _status_code, _headers =
|
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
|
-
#
|
33
|
-
# @param
|
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 [
|
36
|
-
# @return [Array<(
|
37
|
-
def
|
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:
|
39
|
+
@api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
|
40
40
|
end
|
41
|
-
# verify the required parameter '
|
42
|
-
if @api_client.config.client_side_validation &&
|
43
|
-
fail ArgumentError, "Missing the required parameter '
|
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
|
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(
|
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] || '
|
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:
|
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
|
-
#
|
88
|
-
# @param id [String] Unique
|
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 [
|
91
|
-
def
|
92
|
-
data, _status_code, _headers =
|
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
|
-
#
|
97
|
-
# @param id [String] Unique
|
96
|
+
# Retrieve the wallet addresses & 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<(
|
100
|
-
def
|
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:
|
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
|
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/
|
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] || '
|
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:
|
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
|
-
#
|
148
|
-
# @param id [String] Unique
|
149
|
-
# @param txid [String] ID of a specific operation of the
|
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 [
|
152
|
-
def
|
153
|
-
data, _status_code, _headers =
|
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
|
-
#
|
158
|
-
# @param id [String] Unique
|
159
|
-
# @param txid [String] ID of a specific operation of the
|
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<(
|
162
|
-
def
|
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:
|
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
|
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
|
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/
|
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] || '
|
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:
|
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
|
-
#
|
214
|
-
# @param id [String] Unique
|
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 [
|
218
|
-
def
|
219
|
-
data, _status_code, _headers =
|
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
|
-
#
|
224
|
-
# @param id [String] Unique
|
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<(
|
228
|
-
def
|
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:
|
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
|
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/
|
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] || '
|
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:
|
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
|
-
#
|
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
|
280
|
-
# @option opts [String] :start_at Get
|
281
|
-
# @option opts [String] :end_at Get
|
282
|
-
# @return [
|
283
|
-
def
|
284
|
-
data, _status_code, _headers =
|
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
|
-
#
|
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
|
292
|
-
# @option opts [String] :start_at Get
|
293
|
-
# @option opts [String] :end_at Get
|
294
|
-
# @return [Array<(
|
295
|
-
def
|
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:
|
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
|
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] || '
|
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:
|
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
|
347
|
-
# @param id [String] Unique
|
348
|
-
# @param
|
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
|
-
# @
|
351
|
-
|
352
|
-
|
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
|
357
|
-
# @param id [String] Unique
|
358
|
-
# @param
|
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
|
-
# @
|
361
|
-
|
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:
|
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
|
369
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.refund_payment"
|
368
370
|
end
|
369
|
-
# verify the required parameter '
|
370
|
-
if @api_client.config.client_side_validation &&
|
371
|
-
fail ArgumentError, "Missing the required parameter '
|
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/
|
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(
|
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] || '
|
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:
|
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
|
415
|
-
# @param id [String] Unique
|
416
|
-
# @param
|
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
|
-
# @
|
419
|
-
|
420
|
-
|
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
|
425
|
-
# @param id [String] Unique
|
426
|
-
# @param
|
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
|
-
# @
|
429
|
-
|
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:
|
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
|
440
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PaymentsApi.settle_payment"
|
436
441
|
end
|
437
|
-
# verify the required parameter '
|
438
|
-
if @api_client.config.client_side_validation &&
|
439
|
-
fail ArgumentError, "Missing the required parameter '
|
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/
|
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(
|
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] || '
|
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:
|
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
|