bleumi_pay_sdk_ruby 1.0.3 → 1.0.4

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -7
  3. data/bleumi_pay_sdk_ruby.gemspec +3 -3
  4. data/docs/AlgorandBalance.md +27 -0
  5. data/docs/BadRequest.md +1 -1
  6. data/docs/Chain.md +4 -3
  7. data/docs/CheckoutToken.md +6 -3
  8. data/docs/CreateCheckoutUrlRequest.md +7 -7
  9. data/docs/CreatePaymentRequest.md +3 -3
  10. data/docs/CreatePaymentResponse.md +1 -1
  11. data/docs/CreatePayoutRequest.md +1 -1
  12. data/docs/CreatePayoutResponse.md +1 -1
  13. data/docs/EthereumBalance.md +29 -0
  14. data/docs/HostedCheckoutsApi.md +26 -12
  15. data/docs/PaginatedPaymentOperations.md +2 -3
  16. data/docs/PaginatedPayments.md +3 -3
  17. data/docs/PaginatedPayoutItems.md +1 -1
  18. data/docs/Payment.md +0 -1
  19. data/docs/PaymentAddresses.md +2 -1
  20. data/docs/PaymentBalances.md +2 -1
  21. data/docs/PaymentOperation.md +2 -2
  22. data/docs/PaymentOperationInputs.md +4 -4
  23. data/docs/PaymentRefundRequest.md +1 -2
  24. data/docs/PaymentSettleRequest.md +1 -1
  25. data/docs/PaymentsApi.md +17 -15
  26. data/docs/Payout.md +2 -1
  27. data/docs/PayoutItem.md +1 -1
  28. data/docs/PayoutItemInputs.md +1 -1
  29. data/docs/PayoutsApi.md +10 -10
  30. data/docs/ValidateCheckoutRequest.md +1 -1
  31. data/docs/WalletAddress.md +1 -0
  32. data/docs/WalletBalance.md +1 -1
  33. data/lib/bleumi_pay_sdk_ruby.rb +5 -5
  34. data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +17 -5
  35. data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +46 -17
  36. data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +14 -6
  37. data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +264 -0
  38. data/lib/bleumi_pay_sdk_ruby/api_client.rb +3 -3
  39. data/lib/bleumi_pay_sdk_ruby/api_error.rb +2 -2
  40. data/lib/bleumi_pay_sdk_ruby/configuration.rb +3 -3
  41. data/lib/bleumi_pay_sdk_ruby/models/{token.rb → algorand_balance.rb} +43 -38
  42. data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +3 -3
  43. data/lib/bleumi_pay_sdk_ruby/models/chain.rb +4 -5
  44. data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +28 -13
  45. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +19 -7
  46. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +2 -2
  47. data/lib/bleumi_pay_sdk_ruby/models/create_payment_request.rb +17 -5
  48. data/lib/bleumi_pay_sdk_ruby/models/create_payment_response.rb +2 -2
  49. data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +4 -3
  50. data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +2 -2
  51. data/lib/bleumi_pay_sdk_ruby/models/{network_balance.rb → ethereum_balance.rb} +13 -46
  52. data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +2 -2
  53. data/lib/bleumi_pay_sdk_ruby/models/paginated_payments.rb +2 -2
  54. data/lib/bleumi_pay_sdk_ruby/models/paginated_payout_items.rb +2 -2
  55. data/lib/bleumi_pay_sdk_ruby/models/payment.rb +2 -2
  56. data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +17 -6
  57. data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +15 -6
  58. data/lib/bleumi_pay_sdk_ruby/models/payment_operation.rb +4 -3
  59. data/lib/bleumi_pay_sdk_ruby/models/payment_operation_inputs.rb +3 -3
  60. data/lib/bleumi_pay_sdk_ruby/models/payment_operation_response.rb +2 -2
  61. data/lib/bleumi_pay_sdk_ruby/models/payment_refund_request.rb +3 -3
  62. data/lib/bleumi_pay_sdk_ruby/models/payment_settle_request.rb +3 -3
  63. data/lib/bleumi_pay_sdk_ruby/models/payout.rb +16 -6
  64. data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +2 -2
  65. data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +2 -2
  66. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +2 -2
  67. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +2 -2
  68. data/lib/bleumi_pay_sdk_ruby/models/wallet_address.rb +2 -2
  69. data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +2 -2
  70. data/lib/bleumi_pay_sdk_ruby/version.rb +3 -3
  71. data/py_create.rb +38 -0
  72. data/spec/api/payments_api_spec.rb +2 -2
  73. data/spec/models/algorand_balance_spec.rb +47 -0
  74. data/spec/models/ethereum_balance_spec.rb +59 -0
  75. metadata +14 -10
  76. data/docs/EthAddress.md +0 -13
  77. data/docs/NetworkBalance.md +0 -29
  78. data/docs/Token.md +0 -15
  79. data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +0 -208
@@ -4,8 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **token** | [**Token**](Token.md) | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens |
8
-
7
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
9
8
 
10
9
  ## Example
11
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **token** | [**Token**](Token.md) | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens |
7
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
8
8
  **amount** | **String** | Amount to be settled |
9
9
 
10
10
  ## Example
@@ -21,20 +21,20 @@ end
21
21
  api_instance = BleumiPay::PayoutsApi.new
22
22
  create_payment_request = BleumiPay::CreatePaymentRequest.new # CreatePaymentRequest |
23
23
  opts = {
24
- chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
24
+ chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
25
25
  }
26
26
 
27
27
  begin
28
28
 
29
29
  create_payment_request.id = '<ID>'
30
- create_payment_request.buyer_address = BleumiPay::EthAddress.new('<BUYER_ADDR>') # Replace <BUYER_ADDR> with the Buyer's Enthereum Network Address
31
- create_payment_request.transfer_address = BleumiPay::EthAddress.new('<MERCHANT_ADDR>') # Replace <MERCHANT_ADDR> with the Merchant's Enthereum Network Address
30
+ create_payment_request.buyer_address = '<BUYER_ADDR>' # Replace <BUYER_ADDR> with the Buyer's Enthereum Network Address
31
+ create_payment_request.transfer_address = '<MERCHANT_ADDR>' # Replace <MERCHANT_ADDR> with the Merchant's Enthereum Network Address
32
32
 
33
33
  #Create a payout.
34
34
  result = api_instance.create_payment(create_payment_request, opts)
35
35
  p result
36
36
  rescue BleumiPay::ApiError => e
37
- puts "Exception when calling PayoutsApi->create_payment: #{e}"
37
+ puts "Exception when calling create_payment: #{e}"
38
38
  end
39
39
  ```
40
40
 
@@ -87,7 +87,7 @@ begin
87
87
  result = api_instance.get_payment(id)
88
88
  p result
89
89
  rescue BleumiPay::ApiError => e
90
- puts "Exception when calling PaymentsApi->get_payment: #{e}"
90
+ puts "Exception when calling get_payment: #{e}"
91
91
  end
92
92
  ```
93
93
 
@@ -146,10 +146,11 @@ end
146
146
 
147
147
  api_instance = BleumiPay::PaymentsApi.new
148
148
  opts = {
149
- next_token: '', # String | Cursor to start results from
150
- sort_by: '<SORT_BY>', # String | Sort wallets by (optional) | Eg. "createdAt"
151
- start_at: '<START_TIMESTAMP>', # String | Get wallets from this timestamp (optional) | Eg. 1546300800 for 1-JAN-2019
152
- end_at: '' # String | Get wallets till this timestamp (optional)
149
+ next_token: '', # String | Cursor to start results from (optional) |
150
+ sort_by: '<SORT_BY>', # String | Sort payments by (optional) | Eg. "createdAt"
151
+ sort_order: '<SORT_ORDER>', # String | Sort Order for payment (optional) | Eg. "ascending"
152
+ start_at: '<START_TIMESTAMP>', # String | Get wallets from this timestamp (optional) | Eg. 1577836800 for 1-JAN-2020
153
+ end_at: nil # String | Get wallets till this timestamp (optional)
153
154
  }
154
155
 
155
156
  begin
@@ -167,7 +168,8 @@ end
167
168
  Name | Type | Description | Notes
168
169
  ------------- | ------------- | ------------- | -------------
169
170
  **next_token** | **String**| Cursor to start results from | [optional]
170
- **sort_by** | **String**| Sort payments by | [optional]
171
+ **sort_by** | **String**| Sort payments by | [optional] 'createdAt' - results will be sorted by created time. <br>'updatedAt' - results will be sorted by last updated time.
172
+ **sort_order** | **String**| Sort payments by | [optional] 'ascending' - results will be sorted in ascending order. <br>'descending' - results will be sorted in ascending order.
171
173
  **start_at** | **String**| Get payments from this timestamp (unix) | [optional]
172
174
  **end_at** | **String**| Get payments till this timestamp (unix) | [optional]
173
175
 
@@ -210,14 +212,14 @@ end
210
212
  api_instance = BleumiPay::PaymentsApi.new
211
213
 
212
214
  opts = {
213
- chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
215
+ chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
214
216
  }
215
217
 
216
218
  begin
217
219
  id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
218
220
  payment_settle_request = BleumiPay::PaymentSettleRequest.new # PaymentSettleRequest | Request body - used to specify the amount to settle.
219
221
  payment_settle_request.amount = '<AMT>' # String | Replace <AMT> with settle amount
220
- payment_settle_request.token = BleumiPay::Token.new('<TOKEN>') # String | Replace <TOKEN> with ETH or XDAI or XDAIT or ECR-20 token contract address
222
+ payment_settle_request.token = '<TOKEN>' # String | Replace <TOKEN> with "ALGO" or "ETH" or "XDAI" or "XDAIT" or ERC-20 'Token Contract Address' or 'Algorand Standard Asset token'
221
223
  #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
222
224
  result = api_instance.settle_payment(id, payment_settle_request, opts)
223
225
  p result
@@ -233,7 +235,7 @@ Name | Type | Description | Notes
233
235
  ------------- | ------------- | ------------- | -------------
234
236
  **id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
235
237
  **payment_settle_request** | [**PaymentSettleRequest**](PaymentSettleRequest.md)| Request body - used to specify the amount to settle. |
236
- **chain** | [**Chain**](.md)| Ethereum network in which payment is to be created. | [optional]
238
+ **chain** | [**Chain**](Chain.md)| Network in which payment is to be created. | [optional]
237
239
 
238
240
  ### Return type
239
241
 
@@ -270,13 +272,13 @@ end
270
272
  api_instance = BleumiPay::PaymentsApi.new
271
273
 
272
274
  opts = {
273
- chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
275
+ chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
274
276
  }
275
277
 
276
278
  begin
277
279
  id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
278
280
  payment_refund_request = BleumiPay::PaymentRefundRequest.new # PaymentRefundRequest | Request body - used to specify the token to refund.
279
- payment_refund_request.token = BleumiPay::Token.new('<TOKEN>') # String | Replace <TOKEN> with ETH or XDAI or XDAIT or ECR-20 token contract address
281
+ payment_refund_request.token = '<TOKEN>' # String | Replace <TOKEN> with "ALGO" or "ETH" or "XDAI" or "XDAIT" or ERC-20 'Token Contract Address' or 'Algorand Standard Asset token'
280
282
 
281
283
  #Refund the balance of a token for a given payment to the buyerAddress
282
284
  result = api_instance.refund_payment(id, payment_refund_request, opts)
@@ -5,7 +5,8 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **transfer_address** | **String** | Address of receiver. This address must be able to receive payments from smart contracts. |
8
- **amount** | **String** | Amount of token to transfer |
8
+ **amount** | **String** | Amount of token to transfer |
9
+ **authorization** <br> (Optional)| **String** | (Only for Algorand) Base64 serialization of an encoded LogicSig signed by the source of the payout |
9
10
 
10
11
  ## Example
11
12
 
@@ -5,7 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **txid** | **String** | Unique identifier for this payout |
8
- **status** | **Boolean** | <b>null</b> - Operation in progress </br> <b>true</b> - Operation confirmed by network </br> <b>false</b> - Operation rejected by network </br> |
8
+ **status** | **Boolean** | <b>null</b> - Operation in progress </br> <b>true</b> - Operation confirmed by network </br> <b>false</b> - Operation rejected by network </br> |
9
9
  **hash** | **String** | Transaction hash of the operation submitted to the network. This field is blank when the operation is in progress. |
10
10
  **created_at** | **Integer** | UNIX timestamp when the payout was created |
11
11
  **updated_at** | **Integer** | UNIX timestamp when the lastest operation was performed |
@@ -5,7 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **salt** | **String** | Unique identifier generated for the txid of the payout (specified during Create a Payout). |
8
- **token** | **String** | Token used for the payout |
8
+ **token** | **String** | Token used for the payout | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
9
9
  **payouts** | [**Array&lt;Payout&gt;**](Payout.md) | Array of payments to be made in this payout. This is an atomic transaction (i.e. either all payments are processed or all of them are rejected). |
10
10
 
11
11
  ## Example
@@ -1,7 +1,6 @@
1
1
  # BleumiPay::PayoutsApi
2
2
 
3
- Payouts are available only for the Ethereum network today and require you to set up a Private Payment Processor and link it to your account. Please contact support@bleumi.com if you want to enable payouts for your account.
4
-
3
+ Payouts are available only for the Ethereum and xDAI networks today and require you to set up a Private Payment Processor and link it to your account. Please contact support@bleumi.com if you want to enable payouts for your account.
5
4
 
6
5
  ## create_payout
7
6
 
@@ -23,7 +22,7 @@ end
23
22
  api_instance = BleumiPay::PayoutsApi.new
24
23
 
25
24
  opts = {
26
- chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
25
+ chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
27
26
  }
28
27
 
29
28
  begin
@@ -42,14 +41,14 @@ begin
42
41
  payouts = [payout1, payout2]
43
42
 
44
43
  create_payout_request.txid = '<TXID>' # str | Replace with unique payout ID
45
- create_payout_request.token = BleumiPay::Token.new('<TOKEN>') # str | Replace <TOKEN> with Token. Eg. ETH or ECR-20 token contract address or XDAI or XDAIT
44
+ create_payout_request.token = '<TOKEN>' # str | Replace <TOKEN> with Token. Eg. ETH or ECR-20 token contract address or XDAI or XDAIT
46
45
  create_payout_request.payouts = payouts # setting the payouts array to the payout create request
47
46
 
48
47
  #Create a payout.
49
48
  result = api_instance.create_payout(create_payout_request, opts)
50
49
  p result
51
50
  rescue BleumiPay::ApiError => e
52
- puts "Exception when calling PayoutsApi->create_payout: #{e}"
51
+ puts "Exception when calling create_payout: #{e}"
53
52
  end
54
53
  ```
55
54
 
@@ -58,8 +57,9 @@ end
58
57
 
59
58
  Name | Type | Description | Notes
60
59
  ------------- | ------------- | ------------- | -------------
61
- **create_payout_request** | [**CreatePayoutRequest**](CreatePayoutRequest.md)| Request body - used to specify payout creation parameters. |
62
- **chain** | [**Chain**](.md)| Ethereum network in which payment is to be created. Please refer documentation for Supported Networks | [optional]
60
+ **create_payout_request** | [**CreatePayoutRequest**](CreatePayoutRequest.md)| Specify payout creation parameters. |
61
+ **chain** | [**Chain**](Chain.md)| Network in which the payout is to be made. Please refer documentation for [Supported Networks](https://pay.bleumi.com/docs/#supported-networks) |
62
+
63
63
 
64
64
  ### Return type
65
65
 
@@ -108,7 +108,7 @@ api_instance = BleumiPay::PayoutsApi.new
108
108
  opts = {
109
109
  next_token: '', # String | Cursor to start results from
110
110
  sort_by: '<SORT_BY>', # String | Sort payouts by (optional) | Eg. "createdAt"
111
- start_at: '<START_TIMESTAMP>', # String | Get payouts from this timestamp (optional) | Eg. 1546300800 for 1-JAN-2019
111
+ start_at: '<START_TIMESTAMP>', # String | Get payouts from this timestamp (optional) | Eg. 1577836800 for 1-JAN-2020
112
112
  end_at: '' # String | Get payouts till this timestamp (optional)
113
113
  }
114
114
 
@@ -117,7 +117,7 @@ begin
117
117
  result = api_instance.list_payouts(opts)
118
118
  p result
119
119
  rescue BleumiPay::ApiError => e
120
- puts "Exception when calling PayoutsApi->list_payouts: #{e}"
120
+ puts "Exception when calling list_payouts: #{e}"
121
121
  end
122
122
  ```
123
123
 
@@ -127,7 +127,7 @@ end
127
127
  Name | Type | Description | Notes
128
128
  ------------- | ------------- | ------------- | -------------
129
129
  **next_token** | **String**| Cursor to start results from | [optional]
130
- **sort_by** | **String**| Sort payments by | [optional]
130
+ **sort_by** | **String**| Sort payouts by | [optional] 'createdAt' - results will be sorted by created time in ascending order. <br>'updatedAt' - results will be sorted by last updated time in ascending order.
131
131
  **start_at** | **String**| Get payouts from this timestamp (unix) | [optional]
132
132
  **end_at** | **String**| Get payouts till this timestamp (unix) | [optional]
133
133
 
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
13
13
 
14
14
  ```json
15
15
  {
16
- "hmac_input": "ropsten|0xbe98e68c0ffbead18f94882b0f5d15eb31930cee|0x84df8548086ec9025e9c93297058bed706e90ddd|10|12",
16
+ "hmac_input": "goerli|0xbe98e68c0ffbead18f94882b0f5d15eb31930cee|0x84df8548086ec9025e9c93297058bed706e90ddd|10|12",
17
17
  "hmac_keyId": "v1",
18
18
  "hmac_alg": "HMAC-SHA256-HEX",
19
19
  "hmac_value": "e842bb5f3f62319864293ecb7ccc01674a0af08e4e74a01ab16b2157c3fce5d6"
@@ -5,6 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **addr** | **String** | Wallet address for the payment in the network |
8
+
8
9
  ## Example
9
10
 
10
11
  ```json
@@ -5,7 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **balance** | **String** | Token balance for the wallet |
8
- **token_balance** | **String** | Token balance for the wallet in Ethereum format |
8
+ **token_balance** | **String** | Token balance for the wallet in Network format |
9
9
  **token_decimals** | **Integer** | Token decimal places |
10
10
  **block_num** | **String** | Block in which the balance was last updated |
11
11
 
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand 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
@@ -17,6 +17,7 @@ require 'bleumi_pay_sdk_ruby/version'
17
17
  require 'bleumi_pay_sdk_ruby/configuration'
18
18
 
19
19
  # Models
20
+ require 'bleumi_pay_sdk_ruby/models/algorand_balance'
20
21
  require 'bleumi_pay_sdk_ruby/models/bad_request'
21
22
  require 'bleumi_pay_sdk_ruby/models/chain'
22
23
  require 'bleumi_pay_sdk_ruby/models/checkout_token'
@@ -26,8 +27,7 @@ require 'bleumi_pay_sdk_ruby/models/create_payment_request'
26
27
  require 'bleumi_pay_sdk_ruby/models/create_payment_response'
27
28
  require 'bleumi_pay_sdk_ruby/models/create_payout_request'
28
29
  require 'bleumi_pay_sdk_ruby/models/create_payout_response'
29
- require 'bleumi_pay_sdk_ruby/models/eth_address'
30
- require 'bleumi_pay_sdk_ruby/models/network_balance'
30
+ require 'bleumi_pay_sdk_ruby/models/ethereum_balance'
31
31
  require 'bleumi_pay_sdk_ruby/models/paginated_payment_operations'
32
32
  require 'bleumi_pay_sdk_ruby/models/paginated_payments'
33
33
  require 'bleumi_pay_sdk_ruby/models/paginated_payout_items'
@@ -42,7 +42,6 @@ require 'bleumi_pay_sdk_ruby/models/payment_settle_request'
42
42
  require 'bleumi_pay_sdk_ruby/models/payout'
43
43
  require 'bleumi_pay_sdk_ruby/models/payout_item'
44
44
  require 'bleumi_pay_sdk_ruby/models/payout_item_inputs'
45
- require 'bleumi_pay_sdk_ruby/models/token'
46
45
  require 'bleumi_pay_sdk_ruby/models/validate_checkout_request'
47
46
  require 'bleumi_pay_sdk_ruby/models/validate_checkout_response'
48
47
  require 'bleumi_pay_sdk_ruby/models/wallet_address'
@@ -52,6 +51,7 @@ require 'bleumi_pay_sdk_ruby/models/wallet_balance'
52
51
  require 'bleumi_pay_sdk_ruby/api/hosted_checkouts_api'
53
52
  require 'bleumi_pay_sdk_ruby/api/payments_api'
54
53
  require 'bleumi_pay_sdk_ruby/api/payouts_api'
54
+ require 'bleumi_pay_sdk_ruby/api/request_validator'
55
55
 
56
56
  module BleumiPay
57
57
  class << self
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand 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
@@ -15,9 +15,11 @@ require 'cgi'
15
15
  module BleumiPay
16
16
  class HostedCheckoutsApi
17
17
  attr_accessor :api_client
18
+ attr_accessor :request_validator
18
19
 
19
- def initialize(api_client = ApiClient.default)
20
+ def initialize(api_client = ApiClient.default, request_validator = RequestValidator.default)
20
21
  @api_client = api_client
22
+ @request_validator = request_validator
21
23
  end
22
24
  # Generate a unique checkout URL to accept payment.
23
25
  # @param create_checkout_url_request [CreateCheckoutUrlRequest] Specify checkout URL creation parameters.
@@ -40,6 +42,11 @@ module BleumiPay
40
42
  if @api_client.config.client_side_validation && create_checkout_url_request.nil?
41
43
  fail ArgumentError, "Missing the required parameter 'create_checkout_url_request' when calling HostedCheckoutsApi.create_checkout_url"
42
44
  end
45
+ # verify the values in the request body are valid
46
+ msg = @request_validator.validate_create_checkout_url_request(create_checkout_url_request)
47
+ if (@request_validator.is_not_empty(msg))
48
+ fail ArgumentError, "`#{msg}` when calling HostedCheckoutsApi.create_checkout_url"
49
+ end
43
50
  # resource path
44
51
  local_var_path = '/v1/payment/hc'
45
52
 
@@ -81,7 +88,7 @@ module BleumiPay
81
88
  return data, status_code, headers
82
89
  end
83
90
 
84
- # Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
91
+ # Retrieve all tokens configured for the Hosted Checkout in your account in the Bleumi Pay Dashboard.
85
92
  # @param [Hash] opts the optional parameters
86
93
  # @return [Array<CheckoutToken>]
87
94
  def list_tokens(opts = {})
@@ -89,7 +96,7 @@ module BleumiPay
89
96
  data
90
97
  end
91
98
 
92
- # Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
99
+ # Retrieve all tokens configured for the Hosted Checkout in your account in the Bleumi Pay Dashboard.
93
100
  # @param [Hash] opts the optional parameters
94
101
  # @return [Array<(Array<CheckoutToken>, Integer, Hash)>] Array<CheckoutToken> data, response status code and response headers
95
102
  def list_tokens_with_http_info(opts = {})
@@ -156,6 +163,11 @@ module BleumiPay
156
163
  if @api_client.config.client_side_validation && validate_checkout_request.nil?
157
164
  fail ArgumentError, "Missing the required parameter 'validate_checkout_request' when calling HostedCheckoutsApi.validate_checkout_payment"
158
165
  end
166
+ # verify the values in the request body are valid
167
+ msg = @request_validator.validate_checkout_payment_params(validate_checkout_request)
168
+ if (@request_validator.is_not_empty(msg))
169
+ fail ArgumentError, "`#{msg}` when calling HostedCheckoutsApi.validate_checkout_payment"
170
+ end
159
171
  # resource path
160
172
  local_var_path = '/v1/payment/hc/validate'
161
173
 
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand 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
@@ -15,14 +15,16 @@ require 'cgi'
15
15
  module BleumiPay
16
16
  class PaymentsApi
17
17
  attr_accessor :api_client
18
+ attr_accessor :request_validator
18
19
 
19
- def initialize(api_client = ApiClient.default)
20
+ def initialize(api_client = ApiClient.default, request_validator = RequestValidator.default)
20
21
  @api_client = api_client
22
+ @request_validator = request_validator
21
23
  end
22
24
  # Generate a unique wallet address in the specified network to accept payment
23
25
  # @param create_payment_request [CreatePaymentRequest]
24
26
  # @param [Hash] opts the optional parameters
25
- # @option opts [Chain] :chain Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
27
+ # @option opts [Chain] :chain Network in which payment is to be created. Please refer documentation for Supported Networks
26
28
  # @return [CreatePaymentResponse]
27
29
  def create_payment(create_payment_request, opts = {})
28
30
  data, _status_code, _headers = create_payment_with_http_info(create_payment_request, opts)
@@ -32,7 +34,7 @@ module BleumiPay
32
34
  # Generate a unique wallet address in the specified network to accept payment
33
35
  # @param create_payment_request [CreatePaymentRequest]
34
36
  # @param [Hash] opts the optional parameters
35
- # @option opts [Chain] :chain Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
37
+ # @option opts [Chain] :chain Network in which payment is to be created. Please refer documentation for Supported Networks
36
38
  # @return [Array<(CreatePaymentResponse, Integer, Hash)>] CreatePaymentResponse data, response status code and response headers
37
39
  def create_payment_with_http_info(create_payment_request, opts = {})
38
40
  if @api_client.config.debugging
@@ -42,12 +44,20 @@ module BleumiPay
42
44
  if @api_client.config.client_side_validation && create_payment_request.nil?
43
45
  fail ArgumentError, "Missing the required parameter 'create_payment_request' when calling PaymentsApi.create_payment"
44
46
  end
47
+
48
+ # verify the values in the request body are valid
49
+ chain = opts[:'chain'] if !opts[:'chain'].nil?
50
+ msg = @request_validator.validate_create_payment_request(create_payment_request, chain)
51
+ if (@request_validator.is_not_empty(msg))
52
+ fail ArgumentError, "`#{msg}` when calling PaymentsApi.create_payment"
53
+ end
54
+
45
55
  # resource path
46
56
  local_var_path = '/v1/payment'
47
57
 
48
58
  # query parameters
49
59
  query_params = opts[:query_params] || {}
50
- query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
60
+ query_params[:'chain'] = chain
51
61
 
52
62
  # header parameters
53
63
  header_params = opts[:header_params] || {}
@@ -85,7 +95,7 @@ module BleumiPay
85
95
  end
86
96
 
87
97
  # 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
98
+ # @param id [String] Unique identifier of the payment (specified during createPayment) to retrieve
89
99
  # @param [Hash] opts the optional parameters
90
100
  # @return [Payment]
91
101
  def get_payment(id, opts = {})
@@ -94,7 +104,7 @@ module BleumiPay
94
104
  end
95
105
 
96
106
  # 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
107
+ # @param id [String] Unique identifier of the payment (specified during createPayment) to retrieve
98
108
  # @param [Hash] opts the optional parameters
99
109
  # @return [Array<(Payment, Integer, Hash)>] Payment data, response status code and response headers
100
110
  def get_payment_with_http_info(id, opts = {})
@@ -277,6 +287,7 @@ module BleumiPay
277
287
  # @param [Hash] opts the optional parameters
278
288
  # @option opts [String] :next_token Cursor to start results from
279
289
  # @option opts [String] :sort_by Sort payments by
290
+ # @option opts [String] :sort_order Sort Order
280
291
  # @option opts [String] :start_at Get payments from this timestamp (unix)
281
292
  # @option opts [String] :end_at Get payments till this timestamp (unix)
282
293
  # @return [PaginatedPayments]
@@ -289,6 +300,7 @@ module BleumiPay
289
300
  # @param [Hash] opts the optional parameters
290
301
  # @option opts [String] :next_token Cursor to start results from
291
302
  # @option opts [String] :sort_by Sort payments by
303
+ # @option opts [String] :sort_order Sort Order
292
304
  # @option opts [String] :start_at Get payments from this timestamp (unix)
293
305
  # @option opts [String] :end_at Get payments till this timestamp (unix)
294
306
  # @return [Array<(PaginatedPayments, Integer, Hash)>] PaginatedPayments data, response status code and response headers
@@ -300,6 +312,10 @@ module BleumiPay
300
312
  if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
301
313
  fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
302
314
  end
315
+ allowable_values = ["ascending", "descending"]
316
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
317
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
318
+ end
303
319
  # resource path
304
320
  local_var_path = '/v1/payment'
305
321
 
@@ -307,6 +323,7 @@ module BleumiPay
307
323
  query_params = opts[:query_params] || {}
308
324
  query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
309
325
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
326
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
310
327
  query_params[:'startAt'] = opts[:'start_at'] if !opts[:'start_at'].nil?
311
328
  query_params[:'endAt'] = opts[:'end_at'] if !opts[:'end_at'].nil?
312
329
 
@@ -344,10 +361,10 @@ module BleumiPay
344
361
  end
345
362
 
346
363
  # 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))
364
+ # @param id [String] Unique identifier of the payment (specified during createPayment)
348
365
  # @param payment_refund_request [PaymentRefundRequest] Request body - used to specify the token to refund.
349
366
  # @param [Hash] opts the optional parameters
350
- # @option opts [Chain] :chain Ethereum network in which payment is to be created.
367
+ # @option opts [Chain] :chain Network in which payment is to be refunded.
351
368
  # @return [PaymentOperationResponse]
352
369
  def refund_payment(id, payment_refund_request, opts = {})
353
370
  data, _status_code, _headers = refund_payment_with_http_info(id, payment_refund_request, opts)
@@ -355,10 +372,10 @@ module BleumiPay
355
372
  end
356
373
 
357
374
  # 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))
375
+ # @param id [String] Unique identifier of the payment (specified during createPayment)
359
376
  # @param payment_refund_request [PaymentRefundRequest] Request body - used to specify the token to refund.
360
377
  # @param [Hash] opts the optional parameters
361
- # @option opts [Chain] :chain Ethereum network in which payment is to be created.
378
+ # @option opts [Chain] :chain Network in which payment is to be refunded.
362
379
  # @return [Array<(PaymentOperationResponse, Integer, Hash)>] PaymentOperationResponse data, response status code and response headers
363
380
  def refund_payment_with_http_info(id, payment_refund_request, opts = {})
364
381
  if @api_client.config.debugging
@@ -372,12 +389,18 @@ module BleumiPay
372
389
  if @api_client.config.client_side_validation && payment_refund_request.nil?
373
390
  fail ArgumentError, "Missing the required parameter 'payment_refund_request' when calling PaymentsApi.refund_payment"
374
391
  end
392
+ # verify the values in the request body are valid
393
+ chain = opts[:'chain'] if !opts[:'chain'].nil?
394
+ msg = @request_validator.validate_refund_payment_request(payment_refund_request, chain)
395
+ if (@request_validator.is_not_empty(msg))
396
+ fail ArgumentError, "`#{msg}` when calling PaymentsApi.refund_payment"
397
+ end
375
398
  # resource path
376
399
  local_var_path = '/v1/payment/{id}/refund'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
377
400
 
378
401
  # query parameters
379
402
  query_params = opts[:query_params] || {}
380
- query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
403
+ query_params[:'chain'] = chain
381
404
 
382
405
  # header parameters
383
406
  header_params = opts[:header_params] || {}
@@ -415,10 +438,10 @@ module BleumiPay
415
438
  end
416
439
 
417
440
  # 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))
441
+ # @param id [String] Unique identifier of the payment (specified during createPayment)
419
442
  # @param payment_settle_request [PaymentSettleRequest] Request body - used to specify the amount to settle.
420
443
  # @param [Hash] opts the optional parameters
421
- # @option opts [Chain] :chain Ethereum network in which payment is to be created.
444
+ # @option opts [Chain] :chain Network in which payment is to be settled.
422
445
  # @return [PaymentOperationResponse]
423
446
  def settle_payment(id, payment_settle_request, opts = {})
424
447
  data, _status_code, _headers = settle_payment_with_http_info(id, payment_settle_request, opts)
@@ -426,10 +449,10 @@ module BleumiPay
426
449
  end
427
450
 
428
451
  # 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))
452
+ # @param id [String] Unique identifier of the payment (specified during createPayment)
430
453
  # @param payment_settle_request [PaymentSettleRequest] Request body - used to specify the amount to settle.
431
454
  # @param [Hash] opts the optional parameters
432
- # @option opts [Chain] :chain Ethereum network in which payment is to be created.
455
+ # @option opts [Chain] :chain Network in which payment is to be settled.
433
456
  # @return [Array<(PaymentOperationResponse, Integer, Hash)>] PaymentOperationResponse data, response status code and response headers
434
457
  def settle_payment_with_http_info(id, payment_settle_request, opts = {})
435
458
  if @api_client.config.debugging
@@ -443,6 +466,12 @@ module BleumiPay
443
466
  if @api_client.config.client_side_validation && payment_settle_request.nil?
444
467
  fail ArgumentError, "Missing the required parameter 'payment_settle_request' when calling PaymentsApi.settle_payment"
445
468
  end
469
+ # verify the values in the request body are valid
470
+ chain = opts[:'chain'] if !opts[:'chain'].nil?
471
+ msg = @request_validator.validate_settle_payment_request(payment_settle_request, chain)
472
+ if (@request_validator.is_not_empty(msg))
473
+ fail ArgumentError, "`#{msg}` when calling PaymentsApi.settle_payment"
474
+ end
446
475
  # resource path
447
476
  local_var_path = '/v1/payment/{id}/settle'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
448
477