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
data/docs/Payout.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# BleumiPay::Payout
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
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 |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```json
|
13
|
+
{
|
14
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
15
|
+
"amount": "1"
|
16
|
+
}
|
17
|
+
```
|
data/docs/PayoutItem.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# BleumiPay::PayoutItem
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
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> |
|
9
|
+
**hash** | **String** | Transaction hash of the operation submitted to the network. This field is blank when the operation is in progress. |
|
10
|
+
**created_at** | **Integer** | UNIX timestamp when the payout was created |
|
11
|
+
**updated_at** | **Integer** | UNIX timestamp when the lastest operation was performed |
|
12
|
+
**inputs** | [**PayoutItemInputs**](PayoutItemInputs.md) | Inputs provided for this payout creation |
|
13
|
+
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```json
|
18
|
+
{
|
19
|
+
"txid": "12345-6789-10",
|
20
|
+
"status": false,
|
21
|
+
"hash": "<N/A>",
|
22
|
+
"createdAt": 1574501464,
|
23
|
+
"updatedAt": 1574501769,
|
24
|
+
"inputs": {
|
25
|
+
"salt": "0x6f3b4b923b133a82dddef57139b6bbd622e7343128983518557cd13201c5462b",
|
26
|
+
"token": "0x84df8548086ec9025e9c93297058bed706e90ddd",
|
27
|
+
"payouts": [
|
28
|
+
{
|
29
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
30
|
+
"amount": "15"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07",
|
34
|
+
"amount": "21"
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
}
|
39
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# BleumiPay::PayoutItemInputs
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
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 |
|
9
|
+
**payouts** | [**Array<Payout>**](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
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```json
|
14
|
+
{
|
15
|
+
"salt": "0x6f3b4b923b133a82dddef57139b6bbd622e7343128983518557cd13201c5462b",
|
16
|
+
"token": "0x84df8548086ec9025e9c93297058bed706e90ddd",
|
17
|
+
"payouts": [
|
18
|
+
{
|
19
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
20
|
+
"amount": "15"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"amount": "21",
|
24
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
```
|
data/docs/PayoutsApi.md
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
# BleumiPay::PayoutsApi
|
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
|
+
|
5
|
+
|
6
|
+
## create_payout
|
7
|
+
|
8
|
+
> CreatePayoutResponse create_payout(create_payout_request, opts)
|
9
|
+
|
10
|
+
This method makes a payout from your Private Payment Processor.
|
11
|
+
|
12
|
+
### Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
# load the gem
|
16
|
+
require 'bleumi_pay_sdk_ruby'
|
17
|
+
# setup authorization
|
18
|
+
BleumiPay.configure do |config|
|
19
|
+
# Configure API key authorization: ApiKeyAuth
|
20
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
21
|
+
end
|
22
|
+
|
23
|
+
api_instance = BleumiPay::PayoutsApi.new
|
24
|
+
|
25
|
+
opts = {
|
26
|
+
chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
|
27
|
+
}
|
28
|
+
|
29
|
+
begin
|
30
|
+
|
31
|
+
create_payout_request = BleumiPay::CreatePayoutRequest.new # CreatePayoutRequest | Request body - used to specify payout creation parameters.
|
32
|
+
# This example shows 2 payouts being created
|
33
|
+
# Creating Payout-1
|
34
|
+
payout1 = BleumiPay::Payout.new
|
35
|
+
payout1.amount = '<PAYOUT_AMT_1>' # str | Replace <PAYOUT_AMT_1> with the 1st payout's amount
|
36
|
+
payout1.transfer_address = '<PAYOUT_ADDR_1>' # str | Replace <PAYOUT_ADDR_1> with the 1st payout's receiver's address
|
37
|
+
# Creating Payout-2
|
38
|
+
payout2 = BleumiPay::Payout.new
|
39
|
+
payout2.amount = '<PAYOUT_AMT_2>' # str | Replace <PAYOUT_AMT_2> with the 2nd payout's amount
|
40
|
+
payout2.transfer_address = '<PAYOUT_ADDR_2>' # str | Replace <PAYOUT_ADDR_2> with the 2nd payout's receiver's address
|
41
|
+
# Creating a payouts array with both the payouts created above
|
42
|
+
payouts = [payout1, payout2]
|
43
|
+
|
44
|
+
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
|
46
|
+
create_payout_request.payouts = payouts # setting the payouts array to the payout create request
|
47
|
+
|
48
|
+
#Create a payout.
|
49
|
+
result = api_instance.create_payout(create_payout_request, opts)
|
50
|
+
p result
|
51
|
+
rescue BleumiPay::ApiError => e
|
52
|
+
puts "Exception when calling PayoutsApi->create_payout: #{e}"
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
### Parameters
|
57
|
+
|
58
|
+
|
59
|
+
Name | Type | Description | Notes
|
60
|
+
------------- | ------------- | ------------- | -------------
|
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]
|
63
|
+
|
64
|
+
### Return type
|
65
|
+
|
66
|
+
[**CreatePayoutResponse**](CreatePayoutResponse.md)
|
67
|
+
|
68
|
+
Field | Type | Description
|
69
|
+
----- | ----- | -----
|
70
|
+
salt | string | Unique id generated for the given txid
|
71
|
+
|
72
|
+
### 400 Errors
|
73
|
+
|
74
|
+
The following table is a list of possible error codes that can be returned, along with additional information about how to resolve them for a response with 400 status code.
|
75
|
+
|
76
|
+
errorCode <br> <i>errorMessage</i> | Description
|
77
|
+
---- | ----
|
78
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
79
|
+
ValidationError <br> <i>invalid_token</i> | Provided token is not valid for the specified 'chain'
|
80
|
+
ValidationError <br> <i>no_gas_accounts</i> | No active gas accounts present in your account. Please activate at least one gas account from the <a href="https://pay.bleumi.com/app/" target="_blank">Bleumi Pay Dashboard</a>.
|
81
|
+
ValidationError <br> <i>txid_already_exists</i> | The 'txid' provided has been used previously
|
82
|
+
ValidationError <br> <i>not_whitelisted|<addr></i> | The <addr> provided has not been whitelisted in your Private Payment Processor
|
83
|
+
ValidationError <br> <i>payouts_requires_private_payment_processor</i> | Private Payment Processor is not set up and linked to your account
|
84
|
+
|
85
|
+
|
86
|
+
## list_payouts
|
87
|
+
|
88
|
+
> PaginatedPayoutItems list_payouts(opts)
|
89
|
+
|
90
|
+
The list of payouts is returned as an array in the 'results' field. The list is restricted to a maximum of 10 payouts per page.
|
91
|
+
|
92
|
+
If there are more than 10 payouts, a cursor is returned in the 'nextToken' field. Passing this as the 'nextToken' query parameter will fetch the next page.
|
93
|
+
|
94
|
+
When the value of 'nextToken' field is an empty string, there are no more payouts.
|
95
|
+
|
96
|
+
### Example
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
# load the gem
|
100
|
+
require 'bleumi_pay_sdk_ruby'
|
101
|
+
# setup authorization
|
102
|
+
BleumiPay.configure do |config|
|
103
|
+
# Configure API key authorization: ApiKeyAuth
|
104
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
105
|
+
end
|
106
|
+
|
107
|
+
api_instance = BleumiPay::PayoutsApi.new
|
108
|
+
opts = {
|
109
|
+
next_token: '', # String | Cursor to start results from
|
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
|
112
|
+
end_at: '' # String | Get payouts till this timestamp (optional)
|
113
|
+
}
|
114
|
+
|
115
|
+
begin
|
116
|
+
#Returns a list of payouts
|
117
|
+
result = api_instance.list_payouts(opts)
|
118
|
+
p result
|
119
|
+
rescue BleumiPay::ApiError => e
|
120
|
+
puts "Exception when calling PayoutsApi->list_payouts: #{e}"
|
121
|
+
end
|
122
|
+
```
|
123
|
+
|
124
|
+
### Parameters
|
125
|
+
|
126
|
+
|
127
|
+
Name | Type | Description | Notes
|
128
|
+
------------- | ------------- | ------------- | -------------
|
129
|
+
**next_token** | **String**| Cursor to start results from | [optional]
|
130
|
+
**sort_by** | **String**| Sort payments by | [optional]
|
131
|
+
**start_at** | **String**| Get payouts from this timestamp (unix) | [optional]
|
132
|
+
**end_at** | **String**| Get payouts till this timestamp (unix) | [optional]
|
133
|
+
|
134
|
+
### Return type
|
135
|
+
|
136
|
+
[**PaginatedPayoutItems**](PaginatedPayoutItems.md)
|
137
|
+
|
data/docs/Token.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# BleumiPay::Token
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**addr** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b> <contract address of ERC-20 token></b> - for ERC-20 Tokens |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```json
|
12
|
+
{
|
13
|
+
"addr": "0x84df8548086ec9025e9c93297058bed706e90ddd"
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# BleumiPay::ValidateCheckoutRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**hmac_input** | **String** | Payment Details. Passed as GET parameter in successUrl. |
|
8
|
+
**hmac_key_id** | **String** | KeyId used to generate the HMAC. Passed as GET parameter in successUrl. |
|
9
|
+
**hmac_alg** | **String** | Algorithm used to generate the HMAC. Passed as GET parameter in successUrl. |
|
10
|
+
**hmac_value** | **String** | HMAC passed as GET parameter in successUrl. |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```json
|
15
|
+
{
|
16
|
+
"hmac_input": "ropsten|0xbe98e68c0ffbead18f94882b0f5d15eb31930cee|0x84df8548086ec9025e9c93297058bed706e90ddd|10|12",
|
17
|
+
"hmac_keyId": "v1",
|
18
|
+
"hmac_alg": "HMAC-SHA256-HEX",
|
19
|
+
"hmac_value": "e842bb5f3f62319864293ecb7ccc01674a0af08e4e74a01ab16b2157c3fce5d6"
|
20
|
+
}
|
21
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# BleumiPay::ValidateCheckoutResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**valid** | **Boolean** | <b>true</b> - The data has been generated by Bleumi Pay <br/> <b>false</b> - The data has not been generated by Bleumi Pay, the payment must be treated as unpaid |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```json
|
12
|
+
{
|
13
|
+
"valid": true
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# BleumiPay::WalletAddress
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**addr** | **String** | Wallet address for the payment in the network |
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```json
|
11
|
+
{
|
12
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e"
|
13
|
+
}
|
14
|
+
```
|
data/docs/WalletBalance.md
CHANGED
@@ -4,8 +4,18 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
-
**balance** | **String** |
|
8
|
-
**token_balance** | **String** |
|
9
|
-
**token_decimals** | **Integer** |
|
10
|
-
**block_num** | **String** | Block in which the
|
7
|
+
**balance** | **String** | Token balance for the wallet |
|
8
|
+
**token_balance** | **String** | Token balance for the wallet in Ethereum format |
|
9
|
+
**token_decimals** | **Integer** | Token decimal places |
|
10
|
+
**block_num** | **String** | Block in which the balance was last updated |
|
11
11
|
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```json
|
15
|
+
{
|
16
|
+
"balance": "1",
|
17
|
+
"token_decimals": 15,
|
18
|
+
"blockNum": "1698324",
|
19
|
+
"token_balance": "1000000000000000"
|
20
|
+
}
|
21
|
+
```
|
data/lib/bleumi_pay_sdk_ruby.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
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
|
|
@@ -18,23 +18,40 @@ require 'bleumi_pay_sdk_ruby/configuration'
|
|
18
18
|
|
19
19
|
# Models
|
20
20
|
require 'bleumi_pay_sdk_ruby/models/bad_request'
|
21
|
+
require 'bleumi_pay_sdk_ruby/models/chain'
|
22
|
+
require 'bleumi_pay_sdk_ruby/models/checkout_token'
|
23
|
+
require 'bleumi_pay_sdk_ruby/models/create_checkout_url_request'
|
24
|
+
require 'bleumi_pay_sdk_ruby/models/create_checkout_url_response'
|
25
|
+
require 'bleumi_pay_sdk_ruby/models/create_payment_request'
|
26
|
+
require 'bleumi_pay_sdk_ruby/models/create_payment_response'
|
27
|
+
require 'bleumi_pay_sdk_ruby/models/create_payout_request'
|
28
|
+
require 'bleumi_pay_sdk_ruby/models/create_payout_response'
|
21
29
|
require 'bleumi_pay_sdk_ruby/models/eth_address'
|
22
|
-
require 'bleumi_pay_sdk_ruby/models/
|
23
|
-
require 'bleumi_pay_sdk_ruby/models/
|
24
|
-
require 'bleumi_pay_sdk_ruby/models/
|
25
|
-
require 'bleumi_pay_sdk_ruby/models/
|
30
|
+
require 'bleumi_pay_sdk_ruby/models/network_balance'
|
31
|
+
require 'bleumi_pay_sdk_ruby/models/paginated_payment_operations'
|
32
|
+
require 'bleumi_pay_sdk_ruby/models/paginated_payments'
|
33
|
+
require 'bleumi_pay_sdk_ruby/models/paginated_payout_items'
|
34
|
+
require 'bleumi_pay_sdk_ruby/models/payment'
|
35
|
+
require 'bleumi_pay_sdk_ruby/models/payment_addresses'
|
36
|
+
require 'bleumi_pay_sdk_ruby/models/payment_balances'
|
37
|
+
require 'bleumi_pay_sdk_ruby/models/payment_operation'
|
38
|
+
require 'bleumi_pay_sdk_ruby/models/payment_operation_inputs'
|
39
|
+
require 'bleumi_pay_sdk_ruby/models/payment_operation_response'
|
40
|
+
require 'bleumi_pay_sdk_ruby/models/payment_refund_request'
|
41
|
+
require 'bleumi_pay_sdk_ruby/models/payment_settle_request'
|
42
|
+
require 'bleumi_pay_sdk_ruby/models/payout'
|
43
|
+
require 'bleumi_pay_sdk_ruby/models/payout_item'
|
44
|
+
require 'bleumi_pay_sdk_ruby/models/payout_item_inputs'
|
45
|
+
require 'bleumi_pay_sdk_ruby/models/token'
|
46
|
+
require 'bleumi_pay_sdk_ruby/models/validate_checkout_request'
|
47
|
+
require 'bleumi_pay_sdk_ruby/models/validate_checkout_response'
|
48
|
+
require 'bleumi_pay_sdk_ruby/models/wallet_address'
|
26
49
|
require 'bleumi_pay_sdk_ruby/models/wallet_balance'
|
27
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_create_input'
|
28
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_create_output'
|
29
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_inputs'
|
30
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_operation'
|
31
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_operation_inputs'
|
32
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_operation_output'
|
33
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_refund_operation_input'
|
34
|
-
require 'bleumi_pay_sdk_ruby/models/wallet_settle_operation_input'
|
35
50
|
|
36
51
|
# APIs
|
37
|
-
require 'bleumi_pay_sdk_ruby/api/
|
52
|
+
require 'bleumi_pay_sdk_ruby/api/hosted_checkouts_api'
|
53
|
+
require 'bleumi_pay_sdk_ruby/api/payments_api'
|
54
|
+
require 'bleumi_pay_sdk_ruby/api/payouts_api'
|
38
55
|
|
39
56
|
module BleumiPay
|
40
57
|
class << self
|
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: info@bleumi.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module BleumiPay
|
16
|
+
class HostedCheckoutsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Generate a unique checkout URL to accept payment.
|
23
|
+
# @param create_checkout_url_request [CreateCheckoutUrlRequest] Specify checkout URL creation parameters.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [CreateCheckoutUrlResponse]
|
26
|
+
def create_checkout_url(create_checkout_url_request, opts = {})
|
27
|
+
data, _status_code, _headers = create_checkout_url_with_http_info(create_checkout_url_request, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Generate a unique checkout URL to accept payment.
|
32
|
+
# @param create_checkout_url_request [CreateCheckoutUrlRequest] Specify checkout URL creation parameters.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(CreateCheckoutUrlResponse, Integer, Hash)>] CreateCheckoutUrlResponse data, response status code and response headers
|
35
|
+
def create_checkout_url_with_http_info(create_checkout_url_request, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: HostedCheckoutsApi.create_checkout_url ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'create_checkout_url_request' is set
|
40
|
+
if @api_client.config.client_side_validation && create_checkout_url_request.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'create_checkout_url_request' when calling HostedCheckoutsApi.create_checkout_url"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/v1/payment/hc'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
53
|
+
# HTTP header 'Content-Type'
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_checkout_url_request)
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'CreateCheckoutUrlResponse'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: HostedCheckoutsApi#create_checkout_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [Array<CheckoutToken>]
|
87
|
+
def list_tokens(opts = {})
|
88
|
+
data, _status_code, _headers = list_tokens_with_http_info(opts)
|
89
|
+
data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [Array<(Array<CheckoutToken>, Integer, Hash)>] Array<CheckoutToken> data, response status code and response headers
|
95
|
+
def list_tokens_with_http_info(opts = {})
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug 'Calling API: HostedCheckoutsApi.list_tokens ...'
|
98
|
+
end
|
99
|
+
# resource path
|
100
|
+
local_var_path = '/v1/payment/hc/tokens'
|
101
|
+
|
102
|
+
# query parameters
|
103
|
+
query_params = opts[:query_params] || {}
|
104
|
+
|
105
|
+
# header parameters
|
106
|
+
header_params = opts[:header_params] || {}
|
107
|
+
# HTTP header 'Accept' (if needed)
|
108
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
109
|
+
|
110
|
+
# form parameters
|
111
|
+
form_params = opts[:form_params] || {}
|
112
|
+
|
113
|
+
# http body (model)
|
114
|
+
post_body = opts[:body]
|
115
|
+
|
116
|
+
# return_type
|
117
|
+
return_type = opts[:return_type] || 'Array<CheckoutToken>'
|
118
|
+
|
119
|
+
# auth_names
|
120
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
121
|
+
|
122
|
+
new_options = opts.merge(
|
123
|
+
:header_params => header_params,
|
124
|
+
:query_params => query_params,
|
125
|
+
:form_params => form_params,
|
126
|
+
:body => post_body,
|
127
|
+
:auth_names => auth_names,
|
128
|
+
:return_type => return_type
|
129
|
+
)
|
130
|
+
|
131
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug "API called: HostedCheckoutsApi#list_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
134
|
+
end
|
135
|
+
return data, status_code, headers
|
136
|
+
end
|
137
|
+
|
138
|
+
# Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
139
|
+
# @param validate_checkout_request [ValidateCheckoutRequest] Specify validation of checkout parameters.
|
140
|
+
# @param [Hash] opts the optional parameters
|
141
|
+
# @return [ValidateCheckoutResponse]
|
142
|
+
def validate_checkout_payment(validate_checkout_request, opts = {})
|
143
|
+
data, _status_code, _headers = validate_checkout_payment_with_http_info(validate_checkout_request, opts)
|
144
|
+
data
|
145
|
+
end
|
146
|
+
|
147
|
+
# Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
148
|
+
# @param validate_checkout_request [ValidateCheckoutRequest] Specify validation of checkout parameters.
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @return [Array<(ValidateCheckoutResponse, Integer, Hash)>] ValidateCheckoutResponse data, response status code and response headers
|
151
|
+
def validate_checkout_payment_with_http_info(validate_checkout_request, opts = {})
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug 'Calling API: HostedCheckoutsApi.validate_checkout_payment ...'
|
154
|
+
end
|
155
|
+
# verify the required parameter 'validate_checkout_request' is set
|
156
|
+
if @api_client.config.client_side_validation && validate_checkout_request.nil?
|
157
|
+
fail ArgumentError, "Missing the required parameter 'validate_checkout_request' when calling HostedCheckoutsApi.validate_checkout_payment"
|
158
|
+
end
|
159
|
+
# resource path
|
160
|
+
local_var_path = '/v1/payment/hc/validate'
|
161
|
+
|
162
|
+
# query parameters
|
163
|
+
query_params = opts[:query_params] || {}
|
164
|
+
|
165
|
+
# header parameters
|
166
|
+
header_params = opts[:header_params] || {}
|
167
|
+
# HTTP header 'Accept' (if needed)
|
168
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
169
|
+
# HTTP header 'Content-Type'
|
170
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
171
|
+
|
172
|
+
# form parameters
|
173
|
+
form_params = opts[:form_params] || {}
|
174
|
+
|
175
|
+
# http body (model)
|
176
|
+
post_body = opts[:body] || @api_client.object_to_http_body(validate_checkout_request)
|
177
|
+
|
178
|
+
# return_type
|
179
|
+
return_type = opts[:return_type] || 'ValidateCheckoutResponse'
|
180
|
+
|
181
|
+
# auth_names
|
182
|
+
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
183
|
+
|
184
|
+
new_options = opts.merge(
|
185
|
+
:header_params => header_params,
|
186
|
+
:query_params => query_params,
|
187
|
+
:form_params => form_params,
|
188
|
+
:body => post_body,
|
189
|
+
:auth_names => auth_names,
|
190
|
+
:return_type => return_type
|
191
|
+
)
|
192
|
+
|
193
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug "API called: HostedCheckoutsApi#validate_checkout_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
196
|
+
end
|
197
|
+
return data, status_code, headers
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|