bleumi_pay_sdk_ruby 1.0.2 → 1.0.7
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/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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# BleumiPay::CreatePayoutResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**salt** | **String** | Unique id generated for the given txid |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"addr": "0xbea2f9d56c3cc7f2c7e17d294200dd75708eecd8"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# BleumiPay::EthereumBalance
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**mainnet** <br>(Optional) | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Ethereum MainNet |
|
|
8
|
+
**goerli** <br>(Optional) | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in Ethereum Goerli TestNet |
|
|
9
|
+
**xdai** <br>(Optional) | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in xDAI |
|
|
10
|
+
**xdai_testnet** <br>(Optional) | [**Hash<String, WalletBalance>**](WalletBalance.md) | A dictionary which gives the token balances in xDAI TestNet |
|
|
11
|
+
|
|
12
|
+
## Example - Goerli - TestNet
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"balances": {
|
|
17
|
+
"ethereum": {
|
|
18
|
+
"goerli": {
|
|
19
|
+
"0x115615dbd0f835344725146fa6343219315f15e5": {
|
|
20
|
+
"blockNum": "2049977",
|
|
21
|
+
"token_balance": "10000000",
|
|
22
|
+
"balance": "10",
|
|
23
|
+
"safety": "high",
|
|
24
|
+
"token_decimals": 6
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# BleumiPay::EthereumWalletAddress
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**addr** | **String** | Wallet address for the payment in the network |
|
|
8
|
+
**inputs** | [**EthereumWalletInputs**](EthereumWalletInputs.md) | Inputs used for the wallet creation |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"addr": "0xbe7b6dd3a81b9ae6b27b9a4690af39690095c791",
|
|
15
|
+
"inputs": {
|
|
16
|
+
"buyer": "0x713883bf69b786f0a7ab6e2248a70c50577f6b34",
|
|
17
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
|
18
|
+
"salt": "0x5fca1a8d4c6e8786f915a57a9bdde2be9d643b93f366ffa713384fe75762e4aa",
|
|
19
|
+
"walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
|
|
20
|
+
"walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# BleumiPay::EthereumWalletInputs
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**buyer** | **String** | Buyer Address |
|
|
8
|
+
**merchant** | **String** | Merchant Address |
|
|
9
|
+
**salt** | **String** | Salt |
|
|
10
|
+
**wallet_library** | **String** | Wallet Library |
|
|
11
|
+
**wallet_proxy** | **String** | Wallet Proxy |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"buyer": "0x713883bf69b786f0a7ab6e2248a70c50577f6b34",
|
|
18
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
|
19
|
+
"salt": "0x5fca1a8d4c6e8786f915a57a9bdde2be9d643b93f366ffa713384fe75762e4aa",
|
|
20
|
+
"walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
|
|
21
|
+
"walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# BleumiPay::HostedCheckoutsApi
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## create_checkout_url
|
|
5
|
+
|
|
6
|
+
> CreateCheckoutUrlResponse create_checkout_url(create_checkout_url_request)
|
|
7
|
+
|
|
8
|
+
This method generates a unique checkout URL 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::HostedCheckoutsApi.new
|
|
22
|
+
create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreateCheckoutUrlRequest | Specify checkout URL creation parameters.
|
|
23
|
+
|
|
24
|
+
begin
|
|
25
|
+
|
|
26
|
+
create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreatePayoutRequest | Specify payout creation parameters.
|
|
27
|
+
create_checkout_url_request.id = '<ID>' # Eg. 1
|
|
28
|
+
create_checkout_url_request.currency = "<CURRENCY>" # Eg. USD
|
|
29
|
+
create_checkout_url_request.amount = "<AMOUNT>" # Eg. 10
|
|
30
|
+
create_checkout_url_request.success_url = "<SUCCESS_URL>" # Eg. https://demo.store/api/completeOrder
|
|
31
|
+
create_checkout_url_request.cancel_url = "<CANCEL_URL>" # Eg. https://demo.store/api/cancelOrder
|
|
32
|
+
create_checkout_url_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. | Optional
|
|
33
|
+
create_checkout_url_request.chain = BleumiPay::Chain::GOERLI # Replace with any Chain as required
|
|
34
|
+
|
|
35
|
+
#Generate a unique checkout URL to accept payment.
|
|
36
|
+
result = api_instance.create_checkout_url(create_checkout_url_request)
|
|
37
|
+
p result
|
|
38
|
+
rescue BleumiPay::ApiError => e
|
|
39
|
+
puts "Exception when calling HostedCheckoutsApi->create_checkout_url: #{e}"
|
|
40
|
+
end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Parameters
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Name | Type | Description | Notes
|
|
47
|
+
------------- | ------------- | ------------- | -------------
|
|
48
|
+
**create_checkout_url_request** | [**CreateCheckoutUrlRequest**](CreateCheckoutUrlRequest.md)| Specify checkout URL creation parameters. |
|
|
49
|
+
|
|
50
|
+
### Return type
|
|
51
|
+
|
|
52
|
+
[**CreateCheckoutUrlResponse**](CreateCheckoutUrlResponse.md)
|
|
53
|
+
|
|
54
|
+
Field | Type | Description
|
|
55
|
+
----- | ----- | -----
|
|
56
|
+
id | string | Unique identifier generated for this checkout URL
|
|
57
|
+
url | string | URL for buyer to complete payment
|
|
58
|
+
|
|
59
|
+
Format - hmac_input GET parameter passed in successUrl
|
|
60
|
+
|
|
61
|
+
The hmac_input GET parameter passed to successUrl contains payment parameters as a pipe ('|') separated string in the following order,
|
|
62
|
+
<ul style="font-weight: 500">
|
|
63
|
+
<li><b>Chain</b> - Please refer documentation for <a href="https://pay.bleumi.com/docs/#supported-networks" target="_blank">Supported Networks</a> </li>
|
|
64
|
+
<li><b>Wallet Address</b></li>
|
|
65
|
+
<li><b>Token</b><br>
|
|
66
|
+
<i>ETH</i> - for Ethereum<br>
|
|
67
|
+
<i>XDAI</i> - for xDai<br>
|
|
68
|
+
<i>XDAIT</i> - for xDai Testnet<br>
|
|
69
|
+
<i>ALGO</i> - for Algo <br>
|
|
70
|
+
<i>RBTC</i> - for R-BTC <br>
|
|
71
|
+
<i><asset id></i> - for Algorand Standard Asset <br>
|
|
72
|
+
<i><contract address of ERC-20 token></i> - for ERC-20; Please refer to <a href="https://pay.bleumi.com/docs/#erc-20" target="_blank">ERC-20 Tokens</a> for contract address;<br>
|
|
73
|
+
<i><contract address of RSK ERC-20 token></i> - for RSK ERC-20; Please refer to <a href="https://pay.bugnet.work/docs/#rsk-tokens-erc-20" target="_blank">RSK ERC-20 Tokens</a> for contract address;<br>
|
|
74
|
+
</li>
|
|
75
|
+
<li><b>Amount</b> - Token amount for the payment</li>
|
|
76
|
+
<li><b>Number of block confirmations</b><br>
|
|
77
|
+
</li>
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
80
|
+
|
|
81
|
+
Call [Validate a Checkout Payment](#validate_checkout_payment) method to validate the GET parameters passed in successUrl and then cross-check the payment parameters of hmac.input GET parameter with your database.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### 400 Errors
|
|
85
|
+
|
|
86
|
+
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.
|
|
87
|
+
|
|
88
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
89
|
+
---- | ----
|
|
90
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
91
|
+
ValidationError <br> <i>no_tokens_defined</i> | Please configure tokens for the Hosted Checkout in your account in the <a href="https://pay.bleumi.com/app/" target="_blank">Bleumi Pay Dashboard</a>
|
|
92
|
+
ValidationError <br> <i>no_tokens_defined_for_currency</i> | No tokens have been defined in your account for the specified currency
|
|
93
|
+
ValidationError <br> <i>invalid_token</i> | The token provided is not valid for the specified currency
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## list_tokens
|
|
97
|
+
|
|
98
|
+
> Array<CheckoutToken> list_tokens
|
|
99
|
+
|
|
100
|
+
Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
# load the gem
|
|
106
|
+
require 'bleumi_pay_sdk_ruby'
|
|
107
|
+
# setup authorization
|
|
108
|
+
BleumiPay.configure do |config|
|
|
109
|
+
# Configure API key authorization: ApiKeyAuth
|
|
110
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
api_instance = BleumiPay::HostedCheckoutsApi.new
|
|
114
|
+
|
|
115
|
+
begin
|
|
116
|
+
#Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
|
117
|
+
result = api_instance.list_tokens
|
|
118
|
+
p result
|
|
119
|
+
rescue BleumiPay::ApiError => e
|
|
120
|
+
puts "Exception when calling HostedCheckoutsApi->list_tokens: #{e}"
|
|
121
|
+
end
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Parameters
|
|
125
|
+
|
|
126
|
+
This endpoint does not need any parameter.
|
|
127
|
+
|
|
128
|
+
### Return type
|
|
129
|
+
|
|
130
|
+
[**Array<CheckoutToken>**](CheckoutToken.md)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### 400 Errors
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
|
|
137
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
138
|
+
---- | ----
|
|
139
|
+
ValidationError <br> <i>no_tokens_defined</i> | No tokens have been defined in your account
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## validate_checkout_payment
|
|
143
|
+
|
|
144
|
+
> ValidateCheckoutResponse validate_checkout_payment(validate_checkout_request)
|
|
145
|
+
|
|
146
|
+
Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Example
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
# load the gem
|
|
153
|
+
require 'bleumi_pay_sdk_ruby'
|
|
154
|
+
# setup authorization
|
|
155
|
+
BleumiPay.configure do |config|
|
|
156
|
+
# Configure API key authorization: ApiKeyAuth
|
|
157
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
api_instance = BleumiPay::HostedCheckoutsApi.new
|
|
161
|
+
|
|
162
|
+
begin
|
|
163
|
+
validate_checkout_request = BleumiPay::ValidateCheckoutRequest.new # ValidateCheckoutRequest | Specify validation of checkout parameters.
|
|
164
|
+
validate_checkout_request.hmac_alg = '<ALD>' # Eg. HMAC-SHA256-HEX
|
|
165
|
+
validate_checkout_request.hmac_input = '<INPUT>' # Eg. goerli|0xbeaea438bc2e19d097906b597219c288e8eb7b2e|0x115615dbd0f835344725146fa6343219315f15e5|10|12
|
|
166
|
+
validate_checkout_request.hmac_key_id = '<VER>' # Eg. v1
|
|
167
|
+
validate_checkout_request.hmac_value = '<HMAC_VALUE>' # Eg. bdf82eb42efac09150d62ac1bcadd2fd0f64852ded2b571567c905217adf246a
|
|
168
|
+
#Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
|
169
|
+
result = api_instance.validate_checkout_payment(validate_checkout_request)
|
|
170
|
+
p result
|
|
171
|
+
rescue BleumiPay::ApiError => e
|
|
172
|
+
puts "Exception when calling HostedCheckoutsApi->validate_checkout_payment: #{e}"
|
|
173
|
+
end
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Parameters
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
Name | Type | Description | Notes
|
|
180
|
+
------------- | ------------- | ------------- | -------------
|
|
181
|
+
**validate_checkout_request** | [**ValidateCheckoutRequest**](ValidateCheckoutRequest.md)| Specify validation of checkout parameters. |
|
|
182
|
+
|
|
183
|
+
### Return type
|
|
184
|
+
|
|
185
|
+
[**ValidateCheckoutResponse**](ValidateCheckoutResponse.md)
|
|
186
|
+
|
|
187
|
+
Field | Type | Description
|
|
188
|
+
----- | ----- | -----
|
|
189
|
+
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
|
|
190
|
+
|
|
191
|
+
### 400 Errors
|
|
192
|
+
|
|
193
|
+
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.
|
|
194
|
+
|
|
195
|
+
errorCode <br> <i>errorMessage</i> | Description
|
|
196
|
+
---- | ----
|
|
197
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
|
@@ -0,0 +1,28 @@
|
|
|
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** <br> (Optional) | **String** | Cursor to fetch next page of results, empty if no more results |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"results": [
|
|
15
|
+
{
|
|
16
|
+
"txid": "1574502150086",
|
|
17
|
+
"chain": "xdai_testnet",
|
|
18
|
+
"funcName": "createAndRefundWallet",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"addr": "0xbe1fa332f24ba568108ba55a25eccf93d882f54e",
|
|
21
|
+
"token": "XDAIT"
|
|
22
|
+
},
|
|
23
|
+
"status": true,
|
|
24
|
+
"hash": "0x79dca6990b9ef4b07db158dbae9969033d058954edaa24e0d52aef80ef05eca8"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
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** <br> (Optional) | **String** | Cursor to fetch next page of results, empty if no more results |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"results": [
|
|
15
|
+
{
|
|
16
|
+
"id": "1412",
|
|
17
|
+
"addresses": {
|
|
18
|
+
"algorand": {
|
|
19
|
+
"alg_testnet": {
|
|
20
|
+
"inputs": {
|
|
21
|
+
"merchant": "CQRMTAHZJA3SIEOTEMZXCAIZKUWE2CCLBCFYQI4NINU43IOTEWT4LOT4IY",
|
|
22
|
+
"salt": "b1929e6dd3956e0a3abeedb2bd53adc6sHQp0Ksuc4Zyf3Elzdgogqah2hA80y/61+rgF3vRE3YWu/JFPJfM8w==",
|
|
23
|
+
"gas": "ZGXGUNO47C2E7EUO2B3UAY6DETVBI5E2RFDKT4KC3VTWNENE7IVF2F43WY",
|
|
24
|
+
"programBytes": "ASYGIBQiyYD5SDckEdMjM3EBGVUsTQhLCIuII41Dac2h0yWnIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIMmuajXc+LRPko7Qd0BjwyTqFHSaiUap8ULdZ2aRpPoqA3BheQVheGZlciASpk2P8CvJS+NGPcbU9eXjbT2KyTUtTvztmxRR3ShmODEHKBIxBygSETEJKRIxCSgSMQkoEhExCSoSEREQMQ8rEhAxFCgSMRQoEhExFSkSMRUoEjEVKBIRERAxDycEEhARMQUBJwUSEDEUMQASEQ==",
|
|
25
|
+
"buyer": "CQRMTAHZJA3SIEOTEMZXCAIZKUWE2CCLBCFYQI4NINU43IOTEWT4LOT4IY"
|
|
26
|
+
},
|
|
27
|
+
"addr": "BE4XD5QRRXOSAMWJRFHUVZ6DHIP2GQ6YHOHNEP3V3OPEM7SQ4PZMT6WTD4"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"balances": {
|
|
32
|
+
"algorand": {
|
|
33
|
+
"alg_testnet": {
|
|
34
|
+
"127647": {
|
|
35
|
+
"blockNum": "5388041",
|
|
36
|
+
"token_balance": "10000000",
|
|
37
|
+
"balance": "10",
|
|
38
|
+
"safety": "high",
|
|
39
|
+
"token_decimals": 6
|
|
40
|
+
},
|
|
41
|
+
"ALGO": {
|
|
42
|
+
"blockNum": "5388035",
|
|
43
|
+
"token_balance": "209000",
|
|
44
|
+
"balance": "0.209",
|
|
45
|
+
"safety": "high",
|
|
46
|
+
"token_decimals": 6
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"createdAt": 1583731367,
|
|
52
|
+
"updatedAt": 1583731695
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "1411",
|
|
56
|
+
"addresses": {
|
|
57
|
+
"ethereum": {
|
|
58
|
+
"goerli": {
|
|
59
|
+
"inputs": {
|
|
60
|
+
"walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
|
|
61
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
|
62
|
+
"salt": "0xc866b93db0433948f8a47ecb98aac4690999112f8da7ee31a2106cfdd789c2d0",
|
|
63
|
+
"walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049",
|
|
64
|
+
"buyer": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41"
|
|
65
|
+
},
|
|
66
|
+
"addr": "0xbe22e5c3347b25d16918a841fada2bd76a70d9ac"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"balances": {
|
|
71
|
+
"ethereum": {
|
|
72
|
+
"goerli": {
|
|
73
|
+
"0x84df8548086ec9025e9c93297058bed706e90ddd": {
|
|
74
|
+
"balance": "4",
|
|
75
|
+
"token_decimals": 18,
|
|
76
|
+
"blockNum": "2313213",
|
|
77
|
+
"safety": "high",
|
|
78
|
+
"token_balance": "4000000000000000000"
|
|
79
|
+
},
|
|
80
|
+
"0x115615dbd0f835344725146fa6343219315f15e5": {
|
|
81
|
+
"balance": "9",
|
|
82
|
+
"token_decimals": 6,
|
|
83
|
+
"blockNum": "2313213",
|
|
84
|
+
"safety": "high",
|
|
85
|
+
"token_balance": "9000000"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"createdAt": 1583730573,
|
|
91
|
+
"updatedAt": 1583730823
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
@@ -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** (Optional) | **String** | Cursor to fetch next page of results, empty if no more results |
|
|
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
|
+
```
|