bleumi_pay_sdk_ruby 1.0.2 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +67 -47
- data/bleumi_pay_sdk_ruby.gemspec +4 -5
- data/docs/AlgorandBalance.md +28 -0
- data/docs/AlgorandWalletAddress.md +24 -0
- data/docs/AlgorandWalletInputs.md +23 -0
- data/docs/BadRequest.md +2 -1
- data/docs/Chain.md +14 -0
- data/docs/CheckoutToken.md +28 -0
- data/docs/CreateCheckoutUrlRequest.md +28 -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/EthereumBalance.md +30 -0
- data/docs/EthereumWalletAddress.md +23 -0
- data/docs/EthereumWalletInputs.md +23 -0
- data/docs/HostedCheckoutsApi.md +197 -0
- data/docs/PaginatedPaymentOperations.md +28 -0
- data/docs/PaginatedPayments.md +95 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +67 -0
- data/docs/PaymentAddresses.md +21 -0
- data/docs/PaymentBalances.md +21 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +31 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +14 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +368 -0
- data/docs/Payout.md +18 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/RskBalance.md +28 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletBalance.md +18 -4
- data/hc_create.rb +40 -0
- data/hc_list.rb +17 -0
- data/hc_validate.rb +22 -0
- data/lib/bleumi_pay_sdk_ruby.rb +38 -17
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +517 -0
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +288 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +11 -9
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +3 -3
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +4 -4
- data/lib/bleumi_pay_sdk_ruby/models/algorand_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_inputs.rb +247 -0
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +15 -5
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +12 -9
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +302 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +312 -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} +33 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +19 -23
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_balance.rb +241 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → ethereum_wallet_inputs.rb} +35 -50
- 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} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +31 -54
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +231 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +225 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +44 -18
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +38 -12
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +237 -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/rsk_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +257 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +37 -12
- data/lib/bleumi_pay_sdk_ruby/version.rb +4 -4
- data/po_create.rb +39 -0
- data/po_list.rb +23 -0
- data/py_create.rb +48 -0
- data/py_get.rb +18 -0
- data/py_getop.rb +19 -0
- data/py_list.rb +24 -0
- data/py_listops.rb +21 -0
- data/py_refund.rb +43 -0
- data/py_settle.rb +43 -0
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +123 -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/algorand_balance_spec.rb +47 -0
- data/spec/models/algorand_wallet_address_spec.rb +47 -0
- data/spec/models/algorand_wallet_inputs_spec.rb +65 -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 +77 -0
- data/spec/models/create_checkout_url_request_spec.rb +89 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +59 -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/ethereum_balance_spec.rb +59 -0
- data/spec/models/ethereum_wallet_address_spec.rb +47 -0
- data/spec/models/ethereum_wallet_inputs_spec.rb +65 -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 +53 -0
- data/spec/models/payment_balances_spec.rb +53 -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 +53 -0
- data/spec/models/rsk_balance_spec.rb +47 -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_balance_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +180 -49
- data/docs/Erc20PaymentsApi.md +0 -334
- data/docs/EthAddress.md +0 -8
- 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/lib/bleumi_pay_sdk_ruby/api/erc20_payments_api.rb +0 -482
- data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +0 -208
data/docs/Payment.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# BleumiPay::Payment
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique ID identifying the payment; specified when it was created by your system |
|
8
|
+
**addresses** | [**PaymentAddresses**](PaymentAddresses.md) | A dictionary which gives the address of the wallet generated for each network |
|
9
|
+
**balances** | [**PaymentBalances**](PaymentBalances.md) | A dictionary which gives the token balances in each network |
|
10
|
+
**created_at** | **Integer** | UNIX timestamp when the payment was created |
|
11
|
+
**updated_at** | **Integer** | UNIX timestamp when the lastest operation was performed |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```json
|
16
|
+
{
|
17
|
+
"id": "1432",
|
18
|
+
"addresses": {
|
19
|
+
"ethereum": {
|
20
|
+
"goerli": {
|
21
|
+
"inputs": {
|
22
|
+
"walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
|
23
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
24
|
+
"salt": "0xa497eadc72a5ca6af3ade21d8cdf5e76d15a08e5c2097095b7079a959e5a9be7",
|
25
|
+
"walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049",
|
26
|
+
"buyer": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41"
|
27
|
+
},
|
28
|
+
"addr": "0xbea9ba68eb642c21b1966310a33d0dbfa7f61ade"
|
29
|
+
},
|
30
|
+
"xdai_testnet": {
|
31
|
+
"inputs": {
|
32
|
+
"walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049",
|
33
|
+
"buyer": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
34
|
+
"walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
|
35
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
36
|
+
"salt": "0x870a006007a88ad69c1ce6561b13e4a22f0cd64596f2a2671f5860c63d353ea6"
|
37
|
+
},
|
38
|
+
"addr": "0xbe537259a1af5d5c649351ddae0f6bdf69adb1fe"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
},
|
42
|
+
"balances": {
|
43
|
+
"ethereum": {
|
44
|
+
"goerli": {
|
45
|
+
"0x115615dbd0f835344725146fa6343219315f15e5": {
|
46
|
+
"balance": "0",
|
47
|
+
"token_decimals": 6,
|
48
|
+
"blockNum": "2314477",
|
49
|
+
"safety": "high",
|
50
|
+
"token_balance": "0"
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"xdai_testnet": {
|
54
|
+
"XDAIT": {
|
55
|
+
"token_decimals": 15,
|
56
|
+
"blockNum": "2314454",
|
57
|
+
"token_balance": "5000000000000000",
|
58
|
+
"safety": "high",
|
59
|
+
"balance": "5"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
},
|
64
|
+
"createdAt": 1583748155,
|
65
|
+
"updatedAt": 1583748766
|
66
|
+
}
|
67
|
+
```
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# BleumiPay::PaymentAddresses
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**ethereum** | [**Hash<String, EthereumWalletAddress>**](EthereumWalletAddress.md) | | [optional]
|
8
|
+
**algorand** | [**Hash<String, AlgorandWalletAddress>**](AlgorandWalletAddress.md) | | [optional]
|
9
|
+
**rsk** | [**Hash<String, EthereumWalletAddress>**](EthereumWalletAddress.md) | | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'BleumiPay'
|
15
|
+
|
16
|
+
instance = BleumiPay::PaymentAddresses.new(ethereum: null,
|
17
|
+
algorand: null,
|
18
|
+
rsk: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# BleumiPay::PaymentBalances
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**ethereum** | [**EthereumBalance**](EthereumBalance.md) | | [optional]
|
8
|
+
**algorand** | [**AlgorandBalance**](AlgorandBalance.md) | | [optional]
|
9
|
+
**rsk** | [**RskBalance**](RskBalance.md) | | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'BleumiPay'
|
15
|
+
|
16
|
+
instance = BleumiPay::PaymentBalances.new(ethereum: null,
|
17
|
+
algorand: null,
|
18
|
+
rsk: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# BleumiPay::PaymentOperation
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**txid** | **String** | Transaction ID of the operation | [optional]
|
8
|
+
**chain** | **String** | Network in which the operation was carried out |
|
9
|
+
**func_name** | **String** | Name of the function invoked on the Payment Processor.<br/><br/>Functions available:<br/> - createAndSettleWallet<br/> - createAndRefundWallet
|
10
|
+
**status** | **Boolean** | <b>null</b> - operation in progress <br/> <b>true</b> - operation completed successfuly <br/> <b>false</b> - operation failed to process |
|
11
|
+
**inputs** | [**PaymentOperationInputs**](PaymentOperationInputs.md) | The inputs provided during this operation creation |
|
12
|
+
**hash** | **String** | Transaction hash of operation submitted to the network. This field is blank when operation is in progress. |
|
13
|
+
|
14
|
+
## Settle Opeation Example
|
15
|
+
|
16
|
+
```json
|
17
|
+
{
|
18
|
+
"txid": "1574828863297",
|
19
|
+
"chain": "goerli",
|
20
|
+
"funcName": "createAndSettleWallet",
|
21
|
+
"inputs": {
|
22
|
+
"addr": "0xbec374e0acb4b7b6fde45b11287e61beb108e868",
|
23
|
+
"amount": "10",
|
24
|
+
"token": "0x115615dbd0f835344725146fa6343219315f15e5",
|
25
|
+
"token_amount": "10000000",
|
26
|
+
"token_decimals": 6
|
27
|
+
},
|
28
|
+
"status": true,
|
29
|
+
"hash": "0xc347fd450cd80da133401c3b290832e478236a7cbb98eda9e44c108ebc601bb9"
|
30
|
+
}
|
31
|
+
```
|
32
|
+
|
33
|
+
## Refund Operation Example
|
34
|
+
|
35
|
+
```json
|
36
|
+
{
|
37
|
+
"chain": "xdai_testnet",
|
38
|
+
"funcName": "createAndRefundWallet",
|
39
|
+
"inputs": {
|
40
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e",
|
41
|
+
"token": "XDAIT"
|
42
|
+
},
|
43
|
+
"status": true,
|
44
|
+
"hash": "0x79dca6990b9ef4b07db158dbae9969033d058954edaa24e0d52aef80ef05eca8"
|
45
|
+
}
|
46
|
+
```
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# BleumiPay::PaymentOperationInputs
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**addr** | **String** | Address of the wallet |
|
8
|
+
**amount** <br> (Optional) | **String** | Amount (Only for settle operation) |
|
9
|
+
**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>RBTC</b> - for R-BTC <br/> <b> <asset id></b> - for Algorand Standard Asset <br/> <b> <contract address of ERC-20 token></b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> <contract address of RSK ERC-20 token></b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
|
10
|
+
**token_decimals** <br> (Optional) | **Integer** | Token decimal places (Only for settle operation) |
|
11
|
+
|
12
|
+
## Settle Operation Example
|
13
|
+
|
14
|
+
```json
|
15
|
+
{
|
16
|
+
"addr": "0xbec374e0acb4b7b6fde45b11287e61beb108e868",
|
17
|
+
"amount": "10",
|
18
|
+
"token": "0x115615dbd0f835344725146fa6343219315f15e5",
|
19
|
+
"token_amount": "10000000",
|
20
|
+
"token_decimals": 6
|
21
|
+
}
|
22
|
+
```
|
23
|
+
|
24
|
+
## Refund Operation Example
|
25
|
+
|
26
|
+
```json
|
27
|
+
{
|
28
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e",
|
29
|
+
"token": "XDAIT"
|
30
|
+
}
|
31
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# BleumiPay::PaymentOperationResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**txid** | **String** | Unique identifier for the payment operation transaction |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```json
|
12
|
+
{
|
13
|
+
"txid": "1574502130940"
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# BleumiPay::PaymentRefundRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
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>RBTC</b> - for R-BTC <br/> <b> <asset id></b> - for Algorand Standard Asset <br/> <b> <contract address of ERC-20 token></b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> <contract address of RSK ERC-20 token></b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```json
|
11
|
+
{
|
12
|
+
"token": "XDAIT"
|
13
|
+
}
|
14
|
+
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# BleumiPay::PaymentSettleRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
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>RBTC</b> - for R-BTC <br/> <b> <asset id></b> - for Algorand Standard Asset <br/> <b> <contract address of ERC-20 token></b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> <contract address of RSK ERC-20 token></b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
|
8
|
+
**amount** | **String** | Amount to be settled |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```json
|
13
|
+
{
|
14
|
+
"amount": "5",
|
15
|
+
"token": "0x84df8548086ec9025e9c93297058bed706e90ddd"
|
16
|
+
}
|
17
|
+
```
|
data/docs/PaymentsApi.md
ADDED
@@ -0,0 +1,368 @@
|
|
1
|
+
# BleumiPay::PaymentsApi
|
2
|
+
|
3
|
+
|
4
|
+
## get_payment
|
5
|
+
|
6
|
+
> Payment get_payment(id)
|
7
|
+
|
8
|
+
This method retrieves the wallet addresses & token balances for a given payment.
|
9
|
+
|
10
|
+
### Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
# load the gem
|
14
|
+
require 'bleumi_pay_sdk_ruby'
|
15
|
+
# setup authorization
|
16
|
+
BleumiPay.configure do |config|
|
17
|
+
# Configure API key authorization: ApiKeyAuth
|
18
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
19
|
+
end
|
20
|
+
|
21
|
+
api_instance = BleumiPay::PaymentsApi.new
|
22
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment) to retrieve
|
23
|
+
|
24
|
+
begin
|
25
|
+
#Retrieve the wallet addresses & token balances for a given payment
|
26
|
+
result = api_instance.get_payment(id)
|
27
|
+
p result
|
28
|
+
rescue BleumiPay::ApiError => e
|
29
|
+
puts "Exception when calling get_payment: #{e}"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
### Parameters
|
34
|
+
|
35
|
+
|
36
|
+
Name | Type | Description | Notes
|
37
|
+
------------- | ------------- | ------------- | -------------
|
38
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) to retrieve |
|
39
|
+
|
40
|
+
### Return type
|
41
|
+
|
42
|
+
[**Payment**](Payment.md)
|
43
|
+
|
44
|
+
Field | Type | Description
|
45
|
+
----- | ----- | -----
|
46
|
+
addresses | dictionary | A dictionary which gives the address of the wallet generated for each network
|
47
|
+
balances | dictionary | A dictionary which gives the token balances in each network
|
48
|
+
createdAt | integer | The created UNIX timestamp of the payment
|
49
|
+
updatedAt | integer | The last updated UNIX timestamp of the payment
|
50
|
+
|
51
|
+
### 400 Errors
|
52
|
+
|
53
|
+
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.
|
54
|
+
|
55
|
+
errorCode <br> <i>errorMessage</i> | Description
|
56
|
+
---- | ----
|
57
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
58
|
+
|
59
|
+
|
60
|
+
## list_payments
|
61
|
+
|
62
|
+
> PaginatedPayments list_payments(opts)
|
63
|
+
|
64
|
+
This method retrieves all payments created.
|
65
|
+
|
66
|
+
### Pagination
|
67
|
+
|
68
|
+
The list of payments is returned as an array in the 'results' field. The list is restricted to a maximum of 10 per page.
|
69
|
+
|
70
|
+
If there are more than 10 payments, a cursor is returned in the 'nextToken' field. Passing this as the 'nextToken' query parameter will fetch the next page.
|
71
|
+
|
72
|
+
When the value of 'nextToken' field is an empty string, there are no more payments.
|
73
|
+
|
74
|
+
|
75
|
+
### Example
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
# load the gem
|
79
|
+
require 'bleumi_pay_sdk_ruby'
|
80
|
+
# setup authorization
|
81
|
+
BleumiPay.configure do |config|
|
82
|
+
# Configure API key authorization: ApiKeyAuth
|
83
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
84
|
+
end
|
85
|
+
|
86
|
+
api_instance = BleumiPay::PaymentsApi.new
|
87
|
+
opts = {
|
88
|
+
next_token: '', # String | Cursor to start results from (optional) |
|
89
|
+
sort_by: '<SORT_BY>', # String | Sort payments by (optional) | Eg. "createdAt"
|
90
|
+
sort_order: '<SORT_ORDER>', # String | Sort Order for payment (optional) | Eg. "ascending"
|
91
|
+
start_at: '<START_TIMESTAMP>', # String | Get wallets from this timestamp (optional) | Eg. 1577836800 for 1-JAN-2020
|
92
|
+
end_at: nil # String | Get wallets till this timestamp (optional)
|
93
|
+
}
|
94
|
+
|
95
|
+
begin
|
96
|
+
#Retrieve all payments created.
|
97
|
+
result = api_instance.list_payments(opts)
|
98
|
+
p result
|
99
|
+
rescue BleumiPay::ApiError => e
|
100
|
+
puts "Exception when calling PaymentsApi->list_payments: #{e}"
|
101
|
+
end
|
102
|
+
```
|
103
|
+
|
104
|
+
### Parameters
|
105
|
+
|
106
|
+
|
107
|
+
Name | Type | Description | Notes
|
108
|
+
------------- | ------------- | ------------- | -------------
|
109
|
+
**next_token** | **String**| Cursor to start results from | [optional]
|
110
|
+
**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.
|
111
|
+
**sort_order** | **String**| Sort payments by | [optional] 'ascending' - results will be sorted in ascending order. <br>'descending' - results will be sorted in ascending order.
|
112
|
+
**start_at** | **String**| Get payments from this timestamp (unix) | [optional]
|
113
|
+
**end_at** | **String**| Get payments till this timestamp (unix) | [optional]
|
114
|
+
|
115
|
+
### Return type
|
116
|
+
|
117
|
+
[**PaginatedPayments**](PaginatedPayments.md)
|
118
|
+
|
119
|
+
Parameter | Type | Description
|
120
|
+
--------- | ------- | -----------
|
121
|
+
nextToken | | Cursor to fetch next set of results (if next set is available)
|
122
|
+
results[] | | Array of payments, output format is similar to the response of the [Retrieve a Payment](#get_payment) endpoint
|
123
|
+
|
124
|
+
### 400 Errors
|
125
|
+
|
126
|
+
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.
|
127
|
+
|
128
|
+
errorCode <br> <i>errorMessage</i> | Description
|
129
|
+
---- | ----
|
130
|
+
MalformedRequest <br> <i>nextToken_invalid</i> | 'nextToken' value is invalid
|
131
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
132
|
+
|
133
|
+
## settle_payment
|
134
|
+
|
135
|
+
> PaymentOperationResponse settle_payment(id, payment_settle_request, opts)
|
136
|
+
|
137
|
+
This method settles a specific amount of a token for a given payment to the transferAddress (specified during [Create a Payment](#create_payment)) and remaining balance (if any) will be refunded to the buyerAddress (specified during [Create a Payment](#create_payment)).
|
138
|
+
|
139
|
+
|
140
|
+
### Example
|
141
|
+
|
142
|
+
```ruby
|
143
|
+
# load the gem
|
144
|
+
require 'bleumi_pay_sdk_ruby'
|
145
|
+
# setup authorization
|
146
|
+
BleumiPay.configure do |config|
|
147
|
+
# Configure API key authorization: ApiKeyAuth
|
148
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
149
|
+
end
|
150
|
+
|
151
|
+
api_instance = BleumiPay::PaymentsApi.new
|
152
|
+
|
153
|
+
opts = {
|
154
|
+
chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
|
155
|
+
}
|
156
|
+
|
157
|
+
begin
|
158
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
159
|
+
payment_settle_request = BleumiPay::PaymentSettleRequest.new # PaymentSettleRequest | Request body - used to specify the amount to settle.
|
160
|
+
payment_settle_request.amount = '<AMT>' # String | Replace <AMT> with settle amount
|
161
|
+
payment_settle_request.token = '<TOKEN>' # Replace <TOKEN> by anyone of the following values: 'ETH' or 'XDAI' or 'XDAIT' or ECR-20 Contract Address or 'RBTC' or RSK ECR-20 Contract Address or 'Asset ID' of Algorand Standard Asset.
|
162
|
+
|
163
|
+
# 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
|
164
|
+
result = api_instance.settle_payment(id, payment_settle_request, opts)
|
165
|
+
p result
|
166
|
+
rescue BleumiPay::ApiError => e
|
167
|
+
puts "Exception when calling PaymentsApi->settle_payment: #{e}"
|
168
|
+
end
|
169
|
+
```
|
170
|
+
|
171
|
+
### Parameters
|
172
|
+
|
173
|
+
|
174
|
+
Name | Type | Description | Notes
|
175
|
+
------------- | ------------- | ------------- | -------------
|
176
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
177
|
+
**payment_settle_request** | [**PaymentSettleRequest**](PaymentSettleRequest.md)| Request body - used to specify the amount to settle. |
|
178
|
+
**chain** | [**Chain**](Chain.md)| Network in which payment is to be created. | [optional]
|
179
|
+
|
180
|
+
### Return type
|
181
|
+
|
182
|
+
[**PaymentOperationResponse**](PaymentOperationResponse.md)
|
183
|
+
|
184
|
+
### 400 Errors
|
185
|
+
|
186
|
+
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.
|
187
|
+
|
188
|
+
errorCode <br> <i>errorMessage</i> | Description
|
189
|
+
---- | ----
|
190
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
191
|
+
ValidationError <br> <i>no_gas_accounts</i> | No active gas accounts present in account, please activate atleast one account from the developer portal
|
192
|
+
ValidationError <br> <i>prev_tx_inprogress</i> | A previous operation is still being processed for this wallet
|
193
|
+
ValidationError <br> <i>invalid_token</i> | Provided token is not valid for the specified 'net' & 'chain'
|
194
|
+
|
195
|
+
## refund_payment
|
196
|
+
|
197
|
+
> PaymentOperationResponse refund_payment(id, payment_refund_request, opts)
|
198
|
+
|
199
|
+
This method refunds the balance of a token for a given payment to the buyerAddress (specified during [Create a Payment](#create_payment)).
|
200
|
+
|
201
|
+
### Example
|
202
|
+
|
203
|
+
```ruby
|
204
|
+
# load the gem
|
205
|
+
require 'bleumi_pay_sdk_ruby'
|
206
|
+
# setup authorization
|
207
|
+
BleumiPay.configure do |config|
|
208
|
+
# Configure API key authorization: ApiKeyAuth
|
209
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
210
|
+
end
|
211
|
+
|
212
|
+
api_instance = BleumiPay::PaymentsApi.new
|
213
|
+
|
214
|
+
opts = {
|
215
|
+
chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created.
|
216
|
+
}
|
217
|
+
|
218
|
+
begin
|
219
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
220
|
+
payment_refund_request = BleumiPay::PaymentRefundRequest.new # PaymentRefundRequest | Request body - used to specify the token to refund.
|
221
|
+
payment_refund_request.token = '<TOKEN>' # String | Replace <TOKEN> by anyone of the following values: 'ETH' or 'XDAI' or 'XDAIT' or ECR-20 Contract Address or 'RBTC' or RSK ECR-20 Contract Address or 'Asset ID' of Algorand Standard Asset.
|
222
|
+
|
223
|
+
#Refund the balance of a token for a given payment to the buyerAddress
|
224
|
+
result = api_instance.refund_payment(id, payment_refund_request, opts)
|
225
|
+
p result
|
226
|
+
rescue BleumiPay::ApiError => e
|
227
|
+
puts "Exception when calling PaymentsApi->refund_payment: #{e}"
|
228
|
+
end
|
229
|
+
```
|
230
|
+
|
231
|
+
### Parameters
|
232
|
+
|
233
|
+
|
234
|
+
Name | Type | Description | Notes
|
235
|
+
------------- | ------------- | ------------- | -------------
|
236
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
237
|
+
**payment_refund_request** | [**PaymentRefundRequest**](PaymentRefundRequest.md)| Request body - used to specify the token to refund. |
|
238
|
+
**chain** | [**Chain**](Chain.md)| Ethereum network in which payment is to be created. | [optional]
|
239
|
+
|
240
|
+
### Return type
|
241
|
+
|
242
|
+
[**PaymentOperationResponse**](PaymentOperationResponse.md)
|
243
|
+
|
244
|
+
|
245
|
+
Parameter | Type | Description
|
246
|
+
--------- | ------- | -----------
|
247
|
+
txid | | Unique identifier for the refund operation
|
248
|
+
|
249
|
+
### 400 Errors
|
250
|
+
|
251
|
+
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.
|
252
|
+
|
253
|
+
errorCode <br> <i>errorMessage</i> | Description
|
254
|
+
---- | ----
|
255
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
256
|
+
ValidationError <br> <i>no_gas_accounts</i> | No active gas accounts present in account, please activate atleast one account from the developer portal
|
257
|
+
ValidationError <br> <i>prev_tx_inprogress</i> | A previous operation is still being processed for this wallet
|
258
|
+
ValidationError <br> <i>invalid_token</i> | Provided address is not a valid ERC-20 token
|
259
|
+
|
260
|
+
|
261
|
+
## get_payment_operation
|
262
|
+
|
263
|
+
> PaymentOperation get_payment_operation(id, txid)
|
264
|
+
|
265
|
+
This method retrieves a payment operation for a specific payment.
|
266
|
+
|
267
|
+
### Example
|
268
|
+
|
269
|
+
```ruby
|
270
|
+
# load the gem
|
271
|
+
require 'bleumi_pay_sdk_ruby'
|
272
|
+
# setup authorization
|
273
|
+
BleumiPay.configure do |config|
|
274
|
+
# Configure API key authorization: ApiKeyAuth
|
275
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
276
|
+
end
|
277
|
+
|
278
|
+
api_instance = BleumiPay::PaymentsApi.new
|
279
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
280
|
+
txid = '<TXID>' # String | ID of a specific operation of the payment
|
281
|
+
|
282
|
+
begin
|
283
|
+
#Retrieve a payment operation for a specific payment.
|
284
|
+
result = api_instance.get_payment_operation(id, txid)
|
285
|
+
p result
|
286
|
+
rescue BleumiPay::ApiError => e
|
287
|
+
puts "Exception when calling PaymentsApi->get_payment_operation: #{e}"
|
288
|
+
end
|
289
|
+
```
|
290
|
+
|
291
|
+
### Parameters
|
292
|
+
|
293
|
+
|
294
|
+
Name | Type | Description | Notes
|
295
|
+
------------- | ------------- | ------------- | -------------
|
296
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
297
|
+
**txid** | **String**| ID of a specific operation of the payment |
|
298
|
+
|
299
|
+
### Return type
|
300
|
+
|
301
|
+
[**PaymentOperation**](PaymentOperation.md)
|
302
|
+
|
303
|
+
|
304
|
+
## list_payment_operations
|
305
|
+
|
306
|
+
> PaginatedPaymentOperations list_payment_operations(id, opts)
|
307
|
+
|
308
|
+
This method retrieves all payment operations for a specific payment.
|
309
|
+
|
310
|
+
### Pagination
|
311
|
+
|
312
|
+
The list of operations is returned as an array in the 'results' field. The list is restricted to a maximum of 10 operations per page.
|
313
|
+
|
314
|
+
If there are more than 10 operations for a wallet, a cursor is passed in the 'nextToken' field. Passing this as the 'nextToken' query parameter will fetch the next page.
|
315
|
+
|
316
|
+
When the value of 'nextToken' field is an empty string, there are no more operations.
|
317
|
+
|
318
|
+
### Example
|
319
|
+
|
320
|
+
```ruby
|
321
|
+
# load the gem
|
322
|
+
require 'bleumi_pay_sdk_ruby'
|
323
|
+
# setup authorization
|
324
|
+
BleumiPay.configure do |config|
|
325
|
+
# Configure API key authorization: ApiKeyAuth
|
326
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
327
|
+
end
|
328
|
+
|
329
|
+
api_instance = BleumiPay::PaymentsApi.new
|
330
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during Create payment)
|
331
|
+
opts = {
|
332
|
+
next_token: '' # String | Cursor to start results from
|
333
|
+
}
|
334
|
+
|
335
|
+
begin
|
336
|
+
#Retrieve all payment operations for a specific payment.
|
337
|
+
result = api_instance.list_payment_operations(id, opts)
|
338
|
+
p result
|
339
|
+
rescue BleumiPay::ApiError => e
|
340
|
+
puts "Exception when calling PaymentsApi->list_payment_operations: #{e}"
|
341
|
+
end
|
342
|
+
```
|
343
|
+
|
344
|
+
### Parameters
|
345
|
+
|
346
|
+
|
347
|
+
Name | Type | Description | Notes
|
348
|
+
------------- | ------------- | ------------- | -------------
|
349
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
350
|
+
**next_token** | **String**| Cursor to start results from | [optional]
|
351
|
+
|
352
|
+
### Return type
|
353
|
+
|
354
|
+
[**PaginatedPaymentOperations**](PaginatedPaymentOperations.md)
|
355
|
+
|
356
|
+
Parameter | Type | Description
|
357
|
+
--------- | ------- | -----------
|
358
|
+
nextToken | | Cursor to fetch next set of results (if next set is available)
|
359
|
+
results[] | | Array of payment operations, output format is similar to the response of the [Retrieve a Payment Operation](#get_payment_operation) endpoint
|
360
|
+
|
361
|
+
### 400 Errors
|
362
|
+
|
363
|
+
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.
|
364
|
+
|
365
|
+
errorCode <br> <i>errorMessage</i> | Description
|
366
|
+
---- | ----
|
367
|
+
MalformedRequest <br> <i>nextToken_invalid</i> | 'nextToken' value is invalid
|
368
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|