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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# BleumiPay::NetworkBalance
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**mainnet** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in MainNet | [optional]
|
|
8
|
+
**xdai** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in xDAI | [optional]
|
|
9
|
+
**goerli** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Goerli TestNet | [optional]
|
|
10
|
+
**kovan** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Kovan TestNet | [optional]
|
|
11
|
+
**rinkeby** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Rinkeby TestNet | [optional]
|
|
12
|
+
**ropsten** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Ropsten TestNet | [optional]
|
|
13
|
+
**xdai_testnet** | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in xDAI TestNet | [optional]
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"xdai_testnet": {
|
|
20
|
+
"XDAIT": {
|
|
21
|
+
"balance": "1",
|
|
22
|
+
"token_decimals": 15,
|
|
23
|
+
"blockNum": "1698324",
|
|
24
|
+
"token_balance": "1000000000000000"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# BleumiPay::PaginatedPaymentOperations
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**results** | [**Array<PaymentOperation>**](PaymentOperation.md) | List of operations of the payment in the current page |
|
|
8
|
+
**next_token** | **String** | Cursor to fetch next page of results, empty if no more results | [optional]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"results": [
|
|
16
|
+
{
|
|
17
|
+
"txid": "1574502150086",
|
|
18
|
+
"chain": "xdai_testnet",
|
|
19
|
+
"funcName": "createAndRefundWallet",
|
|
20
|
+
"inputs": {
|
|
21
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e",
|
|
22
|
+
"token": "XDAIT"
|
|
23
|
+
},
|
|
24
|
+
"status": true,
|
|
25
|
+
"hash": "0x79dca6990b9ef4b07db158dbae9969033d058954edaa24e0d52aef80ef05eca8"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# BleumiPay::PaginatedPayments
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**results** | [**Array<Payment>**](Payment.md) | List of payments in the current page |
|
|
8
|
+
**next_token** | **String** | Cursor to fetch next page of results, empty if no more results | [optional]
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"results": [
|
|
15
|
+
{
|
|
16
|
+
"id": "2",
|
|
17
|
+
"addresses": {
|
|
18
|
+
"ethereum": {
|
|
19
|
+
"ropsten": {
|
|
20
|
+
"addr": "0xbe02daaf993b29302c2e983b63eca1465c227245"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"balances": {
|
|
25
|
+
"ethereum": {
|
|
26
|
+
"ropsten": {
|
|
27
|
+
"0x84df8548086ec9025e9c93297058bed706e90ddd": {
|
|
28
|
+
"blockNum": "6831652",
|
|
29
|
+
"token_balance": "0",
|
|
30
|
+
"balance": "0",
|
|
31
|
+
"token_decimals": 18
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"createdAt": 1574493797,
|
|
37
|
+
"updatedAt": 1574502335
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "1",
|
|
41
|
+
"addresses": {
|
|
42
|
+
"ethereum": {
|
|
43
|
+
"xdai_testnet": {
|
|
44
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e"
|
|
45
|
+
},
|
|
46
|
+
"rinkeby": {
|
|
47
|
+
"addr": "0xbea2f9d56c3cc7f2c7e17d294200dd75708eecd8"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"balances": {
|
|
52
|
+
"ethereum": {
|
|
53
|
+
"xdai_testnet": {
|
|
54
|
+
"XDAIT": {
|
|
55
|
+
"blockNum": "1698324",
|
|
56
|
+
"token_balance": "1000000000000000",
|
|
57
|
+
"balance": "1",
|
|
58
|
+
"token_decimals": 15
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"createdAt": 1574493617,
|
|
64
|
+
"updatedAt": 1574494588
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# BleumiPay::PaginatedPayoutItems
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**results** | [**Array<PayoutItem>**](PayoutItem.md) | List of payouts of the payment in the current page |
|
|
8
|
+
**next_token** | **String** | Cursor to fetch next page of results, empty if no more results | [optional]
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"results": [
|
|
15
|
+
{
|
|
16
|
+
"txid": "12345-6789-10",
|
|
17
|
+
"status": false,
|
|
18
|
+
"hash": "<N/A>",
|
|
19
|
+
"createdAt": 1574501464,
|
|
20
|
+
"updatedAt": 1574501769,
|
|
21
|
+
"inputs": {
|
|
22
|
+
"salt": "0x6f3b4b923b133a82dddef57139b6bbd622e7343128983518557cd13201c5462b",
|
|
23
|
+
"token": "0x84df8548086ec9025e9c93297058bed706e90ddd",
|
|
24
|
+
"payouts": [
|
|
25
|
+
{
|
|
26
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
|
27
|
+
"amount": "15"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"amount": "21",
|
|
31
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"txid": "12345-6789",
|
|
38
|
+
"status": true,
|
|
39
|
+
"hash": "0xbb7b393f61fdd8cf1337010003c46115fbf451b29e40098b9af1ff55ee9465b2",
|
|
40
|
+
"createdAt": 1574501339,
|
|
41
|
+
"updatedAt": 1574501659,
|
|
42
|
+
"inputs": {
|
|
43
|
+
"salt": "0x09d6f6e0c0c781a6c49153db62c72e4d8b159f742a42e8c4cfb18fc2b9c44224",
|
|
44
|
+
"token": "0x84df8548086ec9025e9c93297058bed706e90ddd",
|
|
45
|
+
"payouts": [
|
|
46
|
+
{
|
|
47
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
|
48
|
+
"amount": "1"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07",
|
|
52
|
+
"amount": "1"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
data/docs/Payment.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"id": "1",
|
|
19
|
+
"addresses": {
|
|
20
|
+
"ethereum": {
|
|
21
|
+
"xdai_testnet": {
|
|
22
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e"
|
|
23
|
+
},
|
|
24
|
+
"rinkeby": {
|
|
25
|
+
"addr": "0xbea2f9d56c3cc7f2c7e17d294200dd75708eecd8"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"balances": {
|
|
30
|
+
"ethereum": {
|
|
31
|
+
"xdai_testnet": {
|
|
32
|
+
"XDAIT": {
|
|
33
|
+
"balance": "1",
|
|
34
|
+
"token_decimals": 15,
|
|
35
|
+
"blockNum": "1698324",
|
|
36
|
+
"token_balance": "1000000000000000"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"createdAt": 1574493617,
|
|
42
|
+
"updatedAt": 1574494588
|
|
43
|
+
}
|
|
44
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# BleumiPay::PaymentAddresses
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**ethereum** | [**Hash<String, WalletAddress>**](WalletAddress.md) | A dictionary which gives the address of the wallet generated for each network | [optional]
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"ethereum": {
|
|
14
|
+
"xdai_testnet": {
|
|
15
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e"
|
|
16
|
+
},
|
|
17
|
+
"rinkeby": {
|
|
18
|
+
"addr": "0xbea2f9d56c3cc7f2c7e17d294200dd75708eecd8"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# BleumiPay::PaymentBalances
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**ethereum** | [**Hash<String, NetworkBalance>**](NetworkBalance.md) | A dictionary which gives the token balances in each network | [optional]
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"ethereum": {
|
|
14
|
+
"xdai_testnet": {
|
|
15
|
+
"XDAIT": {
|
|
16
|
+
"balance": "1",
|
|
17
|
+
"token_decimals": 15,
|
|
18
|
+
"blockNum": "1698324",
|
|
19
|
+
"token_balance": "1000000000000000"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
@@ -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": "ropsten",
|
|
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,32 @@
|
|
|
1
|
+
# BleumiPay::PaymentOperationInputs
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**addr** | **String** | Address of the wallet |
|
|
8
|
+
**amount** | **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> <contract address of ERC-20 token></b> - for ERC-20 Tokens |
|
|
10
|
+
**token_amount** | **String** | Token amount to be settled in network format (Only for settle operation) |
|
|
11
|
+
**token_decimals** | **Integer** | Token decimal places (Only for settle operation) |
|
|
12
|
+
|
|
13
|
+
## Settle Operation Example
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"addr": "0xbec374e0acb4b7b6fde45b11287e61beb108e868",
|
|
18
|
+
"amount": "10",
|
|
19
|
+
"token": "0x115615dbd0f835344725146fa6343219315f15e5",
|
|
20
|
+
"token_amount": "10000000",
|
|
21
|
+
"token_decimals": 6
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Refund Operation Example
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e",
|
|
30
|
+
"token": "XDAIT"
|
|
31
|
+
}
|
|
32
|
+
```
|
|
@@ -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,16 @@
|
|
|
1
|
+
# BleumiPay::PaymentRefundRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
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> <contract address of ERC-20 token></b> - for ERC-20 Tokens |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"token": "XDAIT"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# BleumiPay::PaymentSettleRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
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> <contract address of ERC-20 token></b> - for ERC-20 Tokens |
|
|
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,426 @@
|
|
|
1
|
+
# BleumiPay::PaymentsApi
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## create_payment
|
|
5
|
+
|
|
6
|
+
> CreatePaymentResponse create_payment(create_payment_request, opts)
|
|
7
|
+
|
|
8
|
+
This method generates a unique wallet address in the specified network to accept 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::PayoutsApi.new
|
|
22
|
+
create_payment_request = BleumiPay::CreatePaymentRequest.new # CreatePaymentRequest |
|
|
23
|
+
opts = {
|
|
24
|
+
chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
begin
|
|
28
|
+
|
|
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
|
|
32
|
+
|
|
33
|
+
#Create a payout.
|
|
34
|
+
result = api_instance.create_payment(create_payment_request, opts)
|
|
35
|
+
p result
|
|
36
|
+
rescue BleumiPay::ApiError => e
|
|
37
|
+
puts "Exception when calling PayoutsApi->create_payment: #{e}"
|
|
38
|
+
end
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Parameters
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Name | Type | Description | Notes
|
|
45
|
+
------------- | ------------- | ------------- | -------------
|
|
46
|
+
**create_payment_request** | [**CreatePaymentRequest**](CreatePaymentRequest.md)| Specify checkout URL creation parameters. |
|
|
47
|
+
|
|
48
|
+
### Return type
|
|
49
|
+
|
|
50
|
+
[**CreatePaymentResponse**](CreatePaymentResponse.md)
|
|
51
|
+
|
|
52
|
+
Field | Type | Description
|
|
53
|
+
----- | ----- | -----
|
|
54
|
+
addr | string | Wallet address
|
|
55
|
+
|
|
56
|
+
### 400 Errors
|
|
57
|
+
|
|
58
|
+
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.
|
|
59
|
+
|
|
60
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
61
|
+
---- | ----
|
|
62
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
63
|
+
ValidationError <br> <i>wallet_already_exists|<addr></i> | A wallet with address <addr> has already been created with the specified payment 'id' for the given network
|
|
64
|
+
|
|
65
|
+
## get_payment
|
|
66
|
+
|
|
67
|
+
> Payment get_payment(id)
|
|
68
|
+
|
|
69
|
+
This method retrieves the wallet addresses & token balances for a given payment.
|
|
70
|
+
|
|
71
|
+
### Example
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
# load the gem
|
|
75
|
+
require 'bleumi_pay_sdk_ruby'
|
|
76
|
+
# setup authorization
|
|
77
|
+
BleumiPay.configure do |config|
|
|
78
|
+
# Configure API key authorization: ApiKeyAuth
|
|
79
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
83
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment) to retrieve
|
|
84
|
+
|
|
85
|
+
begin
|
|
86
|
+
#Retrieve the wallet addresses & token balances for a given payment
|
|
87
|
+
result = api_instance.get_payment(id)
|
|
88
|
+
p result
|
|
89
|
+
rescue BleumiPay::ApiError => e
|
|
90
|
+
puts "Exception when calling PaymentsApi->get_payment: #{e}"
|
|
91
|
+
end
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Parameters
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Name | Type | Description | Notes
|
|
98
|
+
------------- | ------------- | ------------- | -------------
|
|
99
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) to retrieve |
|
|
100
|
+
|
|
101
|
+
### Return type
|
|
102
|
+
|
|
103
|
+
[**Payment**](Payment.md)
|
|
104
|
+
|
|
105
|
+
Field | Type | Description
|
|
106
|
+
----- | ----- | -----
|
|
107
|
+
addresses | dictionary | A dictionary which gives the address of the wallet generated for each network
|
|
108
|
+
balances | dictionary | A dictionary which gives the token balances in each network
|
|
109
|
+
createdAt | integer | The created UNIX timestamp of the payment
|
|
110
|
+
updatedAt | integer | The last updated UNIX timestamp of the payment
|
|
111
|
+
|
|
112
|
+
### 400 Errors
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
117
|
+
---- | ----
|
|
118
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## list_payments
|
|
122
|
+
|
|
123
|
+
> PaginatedPayments list_payments(opts)
|
|
124
|
+
|
|
125
|
+
This method retrieves all payments created.
|
|
126
|
+
|
|
127
|
+
### Pagination
|
|
128
|
+
|
|
129
|
+
The list of payments is returned as an array in the 'results' field. The list is restricted to a maximum of 10 per page.
|
|
130
|
+
|
|
131
|
+
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.
|
|
132
|
+
|
|
133
|
+
When the value of 'nextToken' field is an empty string, there are no more payments.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Example
|
|
137
|
+
|
|
138
|
+
```ruby
|
|
139
|
+
# load the gem
|
|
140
|
+
require 'bleumi_pay_sdk_ruby'
|
|
141
|
+
# setup authorization
|
|
142
|
+
BleumiPay.configure do |config|
|
|
143
|
+
# Configure API key authorization: ApiKeyAuth
|
|
144
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
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)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
begin
|
|
156
|
+
#Retrieve all payments created.
|
|
157
|
+
result = api_instance.list_payments(opts)
|
|
158
|
+
p result
|
|
159
|
+
rescue BleumiPay::ApiError => e
|
|
160
|
+
puts "Exception when calling PaymentsApi->list_payments: #{e}"
|
|
161
|
+
end
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Parameters
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
Name | Type | Description | Notes
|
|
168
|
+
------------- | ------------- | ------------- | -------------
|
|
169
|
+
**next_token** | **String**| Cursor to start results from | [optional]
|
|
170
|
+
**sort_by** | **String**| Sort payments by | [optional]
|
|
171
|
+
**start_at** | **String**| Get payments from this timestamp (unix) | [optional]
|
|
172
|
+
**end_at** | **String**| Get payments till this timestamp (unix) | [optional]
|
|
173
|
+
|
|
174
|
+
### Return type
|
|
175
|
+
|
|
176
|
+
[**PaginatedPayments**](PaginatedPayments.md)
|
|
177
|
+
|
|
178
|
+
Parameter | Type | Description
|
|
179
|
+
--------- | ------- | -----------
|
|
180
|
+
nextToken | | Cursor to fetch next set of results (if next set is available)
|
|
181
|
+
results[] | | Array of payments, output format is similar to the response of the [Retrieve a Payment](#get_payment) endpoint
|
|
182
|
+
|
|
183
|
+
### 400 Errors
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
|
|
187
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
188
|
+
---- | ----
|
|
189
|
+
MalformedRequest <br> <i>nextToken_invalid</i> | 'nextToken' value is invalid
|
|
190
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
191
|
+
|
|
192
|
+
## settle_payment
|
|
193
|
+
|
|
194
|
+
> PaymentOperationResponse settle_payment(id, payment_settle_request, opts)
|
|
195
|
+
|
|
196
|
+
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)).
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Example
|
|
200
|
+
|
|
201
|
+
```ruby
|
|
202
|
+
# load the gem
|
|
203
|
+
require 'bleumi_pay_sdk_ruby'
|
|
204
|
+
# setup authorization
|
|
205
|
+
BleumiPay.configure do |config|
|
|
206
|
+
# Configure API key authorization: ApiKeyAuth
|
|
207
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
211
|
+
|
|
212
|
+
opts = {
|
|
213
|
+
chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
begin
|
|
217
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
|
218
|
+
payment_settle_request = BleumiPay::PaymentSettleRequest.new # PaymentSettleRequest | Request body - used to specify the amount to settle.
|
|
219
|
+
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
|
|
221
|
+
#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
|
+
result = api_instance.settle_payment(id, payment_settle_request, opts)
|
|
223
|
+
p result
|
|
224
|
+
rescue BleumiPay::ApiError => e
|
|
225
|
+
puts "Exception when calling PaymentsApi->settle_payment: #{e}"
|
|
226
|
+
end
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Parameters
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
Name | Type | Description | Notes
|
|
233
|
+
------------- | ------------- | ------------- | -------------
|
|
234
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
|
235
|
+
**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]
|
|
237
|
+
|
|
238
|
+
### Return type
|
|
239
|
+
|
|
240
|
+
[**PaymentOperationResponse**](PaymentOperationResponse.md)
|
|
241
|
+
|
|
242
|
+
### 400 Errors
|
|
243
|
+
|
|
244
|
+
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.
|
|
245
|
+
|
|
246
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
247
|
+
---- | ----
|
|
248
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
249
|
+
ValidationError <br> <i>no_gas_accounts</i> | No active gas accounts present in account, please activate atleast one account from the developer portal
|
|
250
|
+
ValidationError <br> <i>prev_tx_inprogress</i> | A previous operation is still being processed for this wallet
|
|
251
|
+
ValidationError <br> <i>invalid_token</i> | Provided token is not valid for the specified 'net' & 'chain'
|
|
252
|
+
|
|
253
|
+
## refund_payment
|
|
254
|
+
|
|
255
|
+
> PaymentOperationResponse refund_payment(id, payment_refund_request, opts)
|
|
256
|
+
|
|
257
|
+
This method refunds the balance of a token for a given payment to the buyerAddress (specified during [Create a Payment](#create_payment)).
|
|
258
|
+
|
|
259
|
+
### Example
|
|
260
|
+
|
|
261
|
+
```ruby
|
|
262
|
+
# load the gem
|
|
263
|
+
require 'bleumi_pay_sdk_ruby'
|
|
264
|
+
# setup authorization
|
|
265
|
+
BleumiPay.configure do |config|
|
|
266
|
+
# Configure API key authorization: ApiKeyAuth
|
|
267
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
271
|
+
|
|
272
|
+
opts = {
|
|
273
|
+
chain: BleumiPay::Chain::ROPSTEN # Chain | Ethereum network in which payment is to be created.
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
begin
|
|
277
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
|
278
|
+
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
|
|
280
|
+
|
|
281
|
+
#Refund the balance of a token for a given payment to the buyerAddress
|
|
282
|
+
result = api_instance.refund_payment(id, payment_refund_request, opts)
|
|
283
|
+
p result
|
|
284
|
+
rescue BleumiPay::ApiError => e
|
|
285
|
+
puts "Exception when calling PaymentsApi->refund_payment: #{e}"
|
|
286
|
+
end
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Parameters
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
Name | Type | Description | Notes
|
|
293
|
+
------------- | ------------- | ------------- | -------------
|
|
294
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
|
295
|
+
**payment_refund_request** | [**PaymentRefundRequest**](PaymentRefundRequest.md)| Request body - used to specify the token to refund. |
|
|
296
|
+
**chain** | [**Chain**](Chain.md)| Ethereum network in which payment is to be created. | [optional]
|
|
297
|
+
|
|
298
|
+
### Return type
|
|
299
|
+
|
|
300
|
+
[**PaymentOperationResponse**](PaymentOperationResponse.md)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
Parameter | Type | Description
|
|
304
|
+
--------- | ------- | -----------
|
|
305
|
+
txid | | Unique identifier for the refund operation
|
|
306
|
+
|
|
307
|
+
### 400 Errors
|
|
308
|
+
|
|
309
|
+
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.
|
|
310
|
+
|
|
311
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
312
|
+
---- | ----
|
|
313
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
314
|
+
ValidationError <br> <i>no_gas_accounts</i> | No active gas accounts present in account, please activate atleast one account from the developer portal
|
|
315
|
+
ValidationError <br> <i>prev_tx_inprogress</i> | A previous operation is still being processed for this wallet
|
|
316
|
+
ValidationError <br> <i>invalid_token</i> | Provided address is not a valid ERC-20 token
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
## get_payment_operation
|
|
320
|
+
|
|
321
|
+
> PaymentOperation get_payment_operation(id, txid)
|
|
322
|
+
|
|
323
|
+
This method retrieves a payment operation for a specific payment.
|
|
324
|
+
|
|
325
|
+
### Example
|
|
326
|
+
|
|
327
|
+
```ruby
|
|
328
|
+
# load the gem
|
|
329
|
+
require 'bleumi_pay_sdk_ruby'
|
|
330
|
+
# setup authorization
|
|
331
|
+
BleumiPay.configure do |config|
|
|
332
|
+
# Configure API key authorization: ApiKeyAuth
|
|
333
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
337
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
|
|
338
|
+
txid = '<TXID>' # String | ID of a specific operation of the payment
|
|
339
|
+
|
|
340
|
+
begin
|
|
341
|
+
#Retrieve a payment operation for a specific payment.
|
|
342
|
+
result = api_instance.get_payment_operation(id, txid)
|
|
343
|
+
p result
|
|
344
|
+
rescue BleumiPay::ApiError => e
|
|
345
|
+
puts "Exception when calling PaymentsApi->get_payment_operation: #{e}"
|
|
346
|
+
end
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Parameters
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
Name | Type | Description | Notes
|
|
353
|
+
------------- | ------------- | ------------- | -------------
|
|
354
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
|
355
|
+
**txid** | **String**| ID of a specific operation of the payment |
|
|
356
|
+
|
|
357
|
+
### Return type
|
|
358
|
+
|
|
359
|
+
[**PaymentOperation**](PaymentOperation.md)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## list_payment_operations
|
|
363
|
+
|
|
364
|
+
> PaginatedPaymentOperations list_payment_operations(id, opts)
|
|
365
|
+
|
|
366
|
+
This method retrieves all payment operations for a specific payment.
|
|
367
|
+
|
|
368
|
+
### Pagination
|
|
369
|
+
|
|
370
|
+
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.
|
|
371
|
+
|
|
372
|
+
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.
|
|
373
|
+
|
|
374
|
+
When the value of 'nextToken' field is an empty string, there are no more operations.
|
|
375
|
+
|
|
376
|
+
### Example
|
|
377
|
+
|
|
378
|
+
```ruby
|
|
379
|
+
# load the gem
|
|
380
|
+
require 'bleumi_pay_sdk_ruby'
|
|
381
|
+
# setup authorization
|
|
382
|
+
BleumiPay.configure do |config|
|
|
383
|
+
# Configure API key authorization: ApiKeyAuth
|
|
384
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
api_instance = BleumiPay::PaymentsApi.new
|
|
388
|
+
id = '<ID>' # String | Unique identifier of the payment (specified during Create payment)
|
|
389
|
+
opts = {
|
|
390
|
+
next_token: '' # String | Cursor to start results from
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
begin
|
|
394
|
+
#Retrieve all payment operations for a specific payment.
|
|
395
|
+
result = api_instance.list_payment_operations(id, opts)
|
|
396
|
+
p result
|
|
397
|
+
rescue BleumiPay::ApiError => e
|
|
398
|
+
puts "Exception when calling PaymentsApi->list_payment_operations: #{e}"
|
|
399
|
+
end
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Parameters
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
Name | Type | Description | Notes
|
|
406
|
+
------------- | ------------- | ------------- | -------------
|
|
407
|
+
**id** | **String**| Unique identifier of the payment (specified during [Create a Payment](#create_payment)) |
|
|
408
|
+
**next_token** | **String**| Cursor to start results from | [optional]
|
|
409
|
+
|
|
410
|
+
### Return type
|
|
411
|
+
|
|
412
|
+
[**PaginatedPaymentOperations**](PaginatedPaymentOperations.md)
|
|
413
|
+
|
|
414
|
+
Parameter | Type | Description
|
|
415
|
+
--------- | ------- | -----------
|
|
416
|
+
nextToken | | Cursor to fetch next set of results (if next set is available)
|
|
417
|
+
results[] | | Array of payment operations, output format is similar to the response of the [Retrieve a Payment Operation](#get_payment_operation) endpoint
|
|
418
|
+
|
|
419
|
+
### 400 Errors
|
|
420
|
+
|
|
421
|
+
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.
|
|
422
|
+
|
|
423
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
424
|
+
---- | ----
|
|
425
|
+
MalformedRequest <br> <i>nextToken_invalid</i> | 'nextToken' value is invalid
|
|
426
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|