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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc384aaf481786ccd3546ddc5358d31d94d13b150b7d6e1452d2516f0a0e84e6
|
4
|
+
data.tar.gz: e3733fd251abb802c79ade9ac224baf851550fcf6551efed73e9b84332bee38f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8960f23b98ec45fc14766ca95b1438c60cdf19f0c187164605d3f1ca8c79e2d7a5ece991317a4593c21b1029658067b2c8cbbbf94eed3e657faaac099f4b28a
|
7
|
+
data.tar.gz: 654e9d7eb14a69596378ecd0fdc092271322cc08e7a697f607216cc872c054ccb51cb4a8c86e7bbf1c55e5bbaa79555c3cc465c6b5d9ea75f51e61617bc18262
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
[](https://raw.githubusercontent.com/bleumi/bleumi-pay-sdk-ruby/master/LICENSE)
|
6
6
|
|
7
|
-
The Bleumi Pay SDK is a one-stop shop to help you integrate
|
7
|
+
The Bleumi Pay SDK is a one-stop shop to help you integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application. The SDK bundles [Bleumi Pay API](https://pay.bleumi.com/docs/#introduction) into one SDK to ease implementation and support.
|
8
8
|
|
9
9
|
bleumi-pay-sdk-ruby is a Ruby library that provides an interface between your Rubu=y application and [Bleumi Pay API](https://pay.bleumi.com/docs/#introduction). This tutorial covers the basics, including examples, needed to use the SDK.
|
10
10
|
|
@@ -36,42 +36,38 @@ Add the following in the Gemfile:
|
|
36
36
|
|
37
37
|
gem 'bleumi_pay_sdk_ruby', :git => 'https://github.com/bleumi/bleumi_pay_sdk_ruby.git'
|
38
38
|
|
39
|
-
|
40
39
|
### Run Sample Code
|
41
40
|
|
42
|
-
The following code generates a
|
41
|
+
The following code generates a payment request to accept payment from the buyer:
|
42
|
+
|
43
43
|
|
44
44
|
```ruby
|
45
|
-
#
|
45
|
+
# load the gem
|
46
46
|
require 'bleumi_pay_sdk_ruby'
|
47
|
-
|
48
|
-
# Setup authorization
|
47
|
+
# setup authorization
|
49
48
|
BleumiPay.configure do |config|
|
50
49
|
# Configure API key authorization: ApiKeyAuth
|
51
50
|
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
52
51
|
end
|
53
52
|
|
54
|
-
api_instance = BleumiPay::
|
55
|
-
|
53
|
+
api_instance = BleumiPay::PayoutsApi.new
|
54
|
+
create_payment_request = BleumiPay::CreatePaymentRequest.new # CreatePaymentRequest |
|
56
55
|
opts = {
|
57
|
-
chain: BleumiPay::
|
56
|
+
chain: BleumiPay::Chain.new # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
|
58
57
|
}
|
59
58
|
|
60
|
-
buyer_address = BleumiPay::EthAddress.new('<BUYER_ADDR>') # Replace <BUYER_ADDR> with the Buyer's Enthereum Network Address
|
61
|
-
transfer_address = BleumiPay::EthAddress.new('<MERCHANT_ADDR>') # Replace <MERCHANT_ADDR> with the Merchant's Enthereum Network Address
|
62
|
-
|
63
|
-
wallet_create_input.id = '<ID>'
|
64
|
-
wallet_create_input.buyer_address = buyer_address
|
65
|
-
wallet_create_input.transfer_address = transfer_address
|
66
|
-
|
67
59
|
begin
|
68
|
-
|
69
|
-
|
60
|
+
|
61
|
+
create_payment_request.id = '<ID>'
|
62
|
+
create_payment_request.buyer_address = BleumiPay::EthAddress.new('<BUYER_ADDR>') # Replace <BUYER_ADDR> with the Buyer's Enthereum Network Address
|
63
|
+
create_payment_request.transfer_address = BleumiPay::EthAddress.new('<MERCHANT_ADDR>') # Replace <MERCHANT_ADDR> with the Merchant's Enthereum Network Address
|
64
|
+
|
65
|
+
#Create a payout.
|
66
|
+
result = api_instance.create_payment(create_payment_request, opts)
|
70
67
|
p result
|
71
68
|
rescue BleumiPay::ApiError => e
|
72
|
-
puts "Exception when calling
|
69
|
+
puts "Exception when calling PayoutsApi->create_payment: #{e}"
|
73
70
|
end
|
74
|
-
|
75
71
|
```
|
76
72
|
|
77
73
|
More examples can be found under each method in [SDK Classes](#sdk-classes) section.
|
@@ -80,31 +76,53 @@ More examples can be found under each method in [SDK Classes](#sdk-classes) sect
|
|
80
76
|
|
81
77
|
Class | Method | HTTP request | Description
|
82
78
|
------------ | ------------- | ------------- | -------------
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
BleumiPay::PaymentsApi | [**create_payment**](docs/PaymentsApi.md#create_payment) | **POST** /v1/payment | Generate a unique wallet address in the specified network to accept payment
|
80
|
+
BleumiPay::PaymentsApi | [**get_payment**](docs/PaymentsApi.md#get_payment) | **GET** /v1/payment/{id} | Retrieve the wallet addresses & token balances for a given payment
|
81
|
+
BleumiPay::PaymentsApi | [**list_payments**](docs/PaymentsApi.md#list_payments) | **GET** /v1/payment | Retrieve all payments created.
|
82
|
+
BleumiPay::PaymentsApi | [**settle_payment**](docs/PaymentsApi.md#settle_payment) | **POST** /v1/payment/{id}/settle | 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
|
83
|
+
BleumiPay::PaymentsApi | [**refund_payment**](docs/PaymentsApi.md#refund_payment) | **POST** /v1/payment/{id}/refund | Refund the balance of a token for a given payment to the buyerAddress
|
84
|
+
BleumiPay::PaymentsApi | [**get_payment_operation**](docs/PaymentsApi.md#get_payment_operation) | **GET** /v1/payment/{id}/operation/{txid} | Retrieve a payment operation for a specific payment.
|
85
|
+
BleumiPay::PaymentsApi | [**list_payment_operations**](docs/PaymentsApi.md#list_payment_operations) | **GET** /v1/payment/{id}/operation | Retrieve all payment operations for a specific payment.
|
86
|
+
BleumiPay::HostedCheckoutsApi | [**create_checkout_url**](docs/HostedCheckoutsApi.md#create_checkout_url) | **POST** /v1/payment/hc | Generate a unique checkout URL to accept payment.
|
87
|
+
BleumiPay::HostedCheckoutsApi | [**list_tokens**](docs/HostedCheckoutsApi.md#list_tokens) | **GET** /v1/payment/hc/tokens | Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
88
|
+
BleumiPay::HostedCheckoutsApi | [**validate_checkout_payment**](docs/HostedCheckoutsApi.md#validate_checkout_payment) | **POST** /v1/payment/hc/validate | Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
89
|
+
BleumiPay::PayoutsApi | [**create_payout**](docs/PayoutsApi.md#create_payout) | **POST** /v1/payout | Create a payout.
|
90
|
+
*BleumiPay::PayoutsApi* | [**list_payouts**](docs/PayoutsApi.md#list_payouts) | **GET** /v1/payout | Returns a list of payouts
|
91
|
+
|
90
92
|
|
91
93
|
## Documentation for Models
|
92
94
|
|
93
|
-
- [BadRequest](docs/BadRequest.md)
|
94
|
-
- [
|
95
|
-
- [
|
96
|
-
- [
|
97
|
-
- [
|
98
|
-
- [
|
99
|
-
- [
|
100
|
-
- [
|
101
|
-
- [
|
102
|
-
- [
|
103
|
-
- [
|
104
|
-
- [
|
105
|
-
- [
|
106
|
-
- [
|
107
|
-
- [
|
95
|
+
- [BleumiPay::BadRequest](docs/BadRequest.md)
|
96
|
+
- [BleumiPay::Chain](docs/Chain.md)
|
97
|
+
- [BleumiPay::CheckoutToken](docs/CheckoutToken.md)
|
98
|
+
- [BleumiPay::CreateCheckoutUrlRequest](docs/CreateCheckoutUrlRequest.md)
|
99
|
+
- [BleumiPay::CreateCheckoutUrlResponse](docs/CreateCheckoutUrlResponse.md)
|
100
|
+
- [BleumiPay::CreatePaymentRequest](docs/CreatePaymentRequest.md)
|
101
|
+
- [BleumiPay::CreatePaymentResponse](docs/CreatePaymentResponse.md)
|
102
|
+
- [BleumiPay::CreatePayoutRequest](docs/CreatePayoutRequest.md)
|
103
|
+
- [BleumiPay::CreatePayoutResponse](docs/CreatePayoutResponse.md)
|
104
|
+
- [BleumiPay::EthAddress](docs/EthAddress.md)
|
105
|
+
- [BleumiPay::NetworkBalance](docs/NetworkBalance.md)
|
106
|
+
- [BleumiPay::PaginatedPaymentOperations](docs/PaginatedPaymentOperations.md)
|
107
|
+
- [BleumiPay::PaginatedPayments](docs/PaginatedPayments.md)
|
108
|
+
- [BleumiPay::PaginatedPayoutItems](docs/PaginatedPayoutItems.md)
|
109
|
+
- [BleumiPay::Payment](docs/Payment.md)
|
110
|
+
- [BleumiPay::PaymentAddresses](docs/PaymentAddresses.md)
|
111
|
+
- [BleumiPay::PaymentBalances](docs/PaymentBalances.md)
|
112
|
+
- [BleumiPay::PaymentOperation](docs/PaymentOperation.md)
|
113
|
+
- [BleumiPay::PaymentOperationInputs](docs/PaymentOperationInputs.md)
|
114
|
+
- [BleumiPay::PaymentOperationResponse](docs/PaymentOperationResponse.md)
|
115
|
+
- [BleumiPay::PaymentRefundRequest](docs/PaymentRefundRequest.md)
|
116
|
+
- [BleumiPay::PaymentSettleRequest](docs/PaymentSettleRequest.md)
|
117
|
+
- [BleumiPay::Payout](docs/Payout.md)
|
118
|
+
- [BleumiPay::PayoutItem](docs/PayoutItem.md)
|
119
|
+
- [BleumiPay::PayoutItemInputs](docs/PayoutItemInputs.md)
|
120
|
+
- [BleumiPay::Token](docs/Token.md)
|
121
|
+
- [BleumiPay::ValidateCheckoutRequest](docs/ValidateCheckoutRequest.md)
|
122
|
+
- [BleumiPay::ValidateCheckoutResponse](docs/ValidateCheckoutResponse.md)
|
123
|
+
- [BleumiPay::WalletAddress](docs/WalletAddress.md)
|
124
|
+
- [BleumiPay::WalletBalance](docs/WalletBalance.md)
|
125
|
+
|
108
126
|
|
109
127
|
## Limitations
|
110
128
|
|
@@ -114,4 +132,4 @@ Erc20PaymentsApi | [**list_wallet_operations**](docs/Erc20PaymentsApi.md#list_wa
|
|
114
132
|
|
115
133
|
Copyright 2019 Bleumi, Inc.
|
116
134
|
|
117
|
-
Code licensed under the [MIT License](LICENSE).
|
135
|
+
Code licensed under the [MIT License](LICENSE).
|
data/bleumi_pay_sdk_ruby.gemspec
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
=begin
|
4
4
|
#Bleumi Pay API
|
5
5
|
|
6
|
-
#A simple and powerful REST API to integrate
|
6
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Contact: info@bleumi.com
|
10
10
|
Generated by: https://openapi-generator.tech
|
11
|
-
OpenAPI Generator version: 4.2.
|
11
|
+
OpenAPI Generator version: 4.2.2
|
12
12
|
|
13
13
|
=end
|
14
14
|
|
@@ -36,5 +36,4 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.test_files = `find spec/*`.split("\n")
|
37
37
|
s.executables = []
|
38
38
|
s.require_paths = ["lib"]
|
39
|
-
s.metadata = { "source_code_uri" => "https://github.com/bleumi/bleumi-pay-sdk-ruby" }
|
40
39
|
end
|
data/docs/BadRequest.md
CHANGED
@@ -6,3 +6,4 @@ Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**error_code** | **String** | Code for error class. Complete list of error codes is available [here](https://pay.bleumi.com/docs/#errors) |
|
8
8
|
**error_message** | **String** | Error description | [optional]
|
9
|
+
|
data/docs/Chain.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# BleumiPay::Chain
|
2
|
+
|
3
|
+
## Enum
|
4
|
+
|
5
|
+
* `MAINNET` (value: `"mainnet"`)
|
6
|
+
* `ROPSTEN` (value: `"ropsten"`)
|
7
|
+
* `GOERLI` (value: `"goerli"`)
|
8
|
+
* `KOVAN` (value: `"kovan"`)
|
9
|
+
* `RINKEBY` (value: `"rinkeby"`)
|
10
|
+
* `XDAI` (value: `"xdai"`)
|
11
|
+
* `XDAI_TESTNET` (value: `"xdai_testnet"`)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# BleumiPay::CheckoutToken
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**chain** | **String** | The chain in which the token is defined |
|
8
|
+
**transfer_address** | **String** | The destination address when payments are received in this token |
|
9
|
+
**name** | **String** | Name of the token |
|
10
|
+
**symbol** | **String** | Symbol of the token |
|
11
|
+
**decimals** | **String** | The decimal places supported |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```json
|
16
|
+
{
|
17
|
+
"chain": "ropsten",
|
18
|
+
"transferAddress": "0xd15bdd17175825742a5904b21008dd3a019a060e",
|
19
|
+
"name": "USD p18",
|
20
|
+
"symbol": "USD18",
|
21
|
+
"decimals": 18
|
22
|
+
}
|
23
|
+
```
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# BleumiPay::CreateCheckoutUrlRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique identifier for this payment. <br> <b>Warning!</b> - Do not reuse this id with the [Create a Payment](PaymentApi.md#create_payment) endpoint. |
|
8
|
+
**currency** | **String** | Currency Code<br><br> When you configure custom tokens for the Hosted Checkout in your account in the <a href="https://pay.bleumi.com/app/" target="_blank">Bleumi Pay Dashboard</a>, please use:<br> - ISO 4217 Alphabetic Code for fiat, gold, silver, etc.<br> - Token Symbol for crypto |
|
9
|
+
**amount** | **String** | Token amount for this payment |
|
10
|
+
**cancel_url** | **String** | Buyer will be redirected to this URL upon canceling the payment. |
|
11
|
+
**success_url** | **String** | Buyer will be redirected to this URL upon successfully completing the payment and the following data is passed as GET parameters, <ul style="font-weight: 500"><li><b>id</b> - Unique identifier of the checkout URL</li><li><b>hmac.input</b> - Payment parameters used to generate HMAC. The format is described below.</li><li><b>hmac.keyId</b> - Key ID used to generate HMAC</li><li><b>hmac.alg</b> - Algorithm used to generate HMAC</li><li><b>hmac.value</b> - HMAC generated for hmac.input</li></ul>
|
12
|
+
**BuyerAddress**<br>(Optional) | [**EthAddress**](EthAddress.md) | Refund address for this payment.
|
13
|
+
You can set this to your address to manually handle refunds (outside of Bleumi Pay) to your buyer. | [optional]
|
14
|
+
**token**<br>(Optional) | [**Token**](Token.md) | If this field is not specified, a list of tokens configured for the provided currency code for the Hosted Checkout in your account in the <a href="https://pay.bleumi.com/app/" target="_blank">Bleumi Pay Dashboard</a> is sent to the buyer. The buyer can complete the payment using any one of token from this list. <br><br> Set the token which must be used by the buyer for this payment. The token provided must be set in your portal for the provided currency code. The token is assumed to be 1:1 with the currency unit. <br><br> <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; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; | [optional]
|
15
|
+
**Chain**<br>(Optional) | [**Chain**](Chain.md) | (Required if specifying 'token') Network in which the hosted checkout is to be created. Please refer to the [Supported Networks.](https://pay.bleumi.com/docs/#supported-networks) | [optional]
|
16
|
+
|
17
|
+
## Example
|
18
|
+
|
19
|
+
```json
|
20
|
+
{
|
21
|
+
"id": "4",
|
22
|
+
"currency": "USD",
|
23
|
+
"amount": "10",
|
24
|
+
"cancelUrl": "https://demo.store/api/cancelOrder",
|
25
|
+
"successUrl": "https://demo.store/api/completeOrder",
|
26
|
+
"token":"0x115615dbd0f835344725146fa6343219315f15e5",
|
27
|
+
"chain":"ropsten",
|
28
|
+
"buyerAddress":"0x713883BF69B786f0A7aB6E2248a70C50577F6b34"
|
29
|
+
}
|
30
|
+
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# BleumiPay::CreateCheckoutUrlResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique identifier generated for this checkout URL |
|
8
|
+
**url** | **String** | URL for buyer to complete payment |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```json
|
13
|
+
{
|
14
|
+
"id": "TBCItOjmR52dFo1a6JxCqQ",
|
15
|
+
"url": "https://pay.bleumi.io/?id=TBCItOjmR52dFo1a6JxCqQ"
|
16
|
+
}
|
17
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# BleumiPay::CreatePaymentRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | Unique ID identifying the payment |
|
8
|
+
**buyer_address** | [**EthAddress**](EthAddress.md) | Address of buyer. Refund operations on this wallet will use this address. You can set this to your address to manually handle refunds (outside of Bleumi Pay) to your buyer. <br/> <b>Warning!</b> - This address must be able to receive payments from smart contracts.|
|
9
|
+
**transfer_address** | [**EthAddress**](EthAddress.md) | Your deposit address. Settle operations on this wallet will use this address. <br/> <b>Warning!</b> - This address must be able to receive payments from smart contracts.|
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```json
|
14
|
+
{
|
15
|
+
"id": "1",
|
16
|
+
"buyerAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
17
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07"
|
18
|
+
}
|
19
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# BleumiPay::CreatePaymentResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**addr** | **String** | Wallet address | The unique wallet address generated
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```json
|
12
|
+
{
|
13
|
+
"addr": "0xbea2f9d56c3cc7f2c7e17d294200dd75708eecd8"
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# BleumiPay::CreatePayoutRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**txid** | **String** | Unique identifier for this payout |
|
8
|
+
**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 |
|
9
|
+
**payouts** | [**Array<Payout>**](Payout.md) | Array of payments to be made in this payout. This is an atomic transaction (i.e. either all payments are processed or all of them are rejected). |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```json
|
14
|
+
{
|
15
|
+
"txid": "12345-6789",
|
16
|
+
"token": "0x84df8548086EC9025E9C93297058Bed706E90DDD",
|
17
|
+
"payouts": [
|
18
|
+
{
|
19
|
+
"transferAddress": "0xD15BDD17175825742A5904b21008dd3A019a060E",
|
20
|
+
"amount": "1"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"transferAddress": "0x7Dc30B85084aA1608e5C1Ce39c804Be177e40A07",
|
24
|
+
"amount": "1"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
```
|
@@ -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
|
+
"salt": "0x09d6f6e0c0c781a6c49153db62c72e4d8b159f742a42e8c4cfb18fc2b9c44224"
|
14
|
+
}
|
15
|
+
```
|
data/docs/EthAddress.md
CHANGED
@@ -4,5 +4,10 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
-
**addr** | **String** | Valid Ethereum address string should pass validation pattern: '^0x[a-fA-F0-9]{40}$'|
|
7
|
+
**addr** | **String** | Valid Ethereum address string should pass validation pattern: '^0x[a-fA-F0-9]{40}$' |
|
8
8
|
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```json
|
12
|
+
0x13e4ACeFE6a6700604929946E70E6443E4E73447
|
13
|
+
```
|
@@ -0,0 +1,190 @@
|
|
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 = BleumiPay::Token.new('<TOKEN>') # Replace <TOKEN> with ETH or XDAI or ERC-20 Token Contract Address or XDAIT
|
33
|
+
create_checkout_url_request.chain = BleumiPay::Chain::ROPSTEN #
|
34
|
+
create_checkout_url_request.buyer_address = BleumiPay::EthAddress.new('<BUYER_ADDR>') # Replace <BUYER_ADDR> with the buyer's Ethereum Address
|
35
|
+
|
36
|
+
|
37
|
+
#Generate a unique checkout URL to accept payment.
|
38
|
+
result = api_instance.create_checkout_url(create_checkout_url_request)
|
39
|
+
p result
|
40
|
+
rescue BleumiPay::ApiError => e
|
41
|
+
puts "Exception when calling HostedCheckoutsApi->create_checkout_url: #{e}"
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
### Parameters
|
46
|
+
|
47
|
+
|
48
|
+
Name | Type | Description | Notes
|
49
|
+
------------- | ------------- | ------------- | -------------
|
50
|
+
**create_checkout_url_request** | [**CreateCheckoutUrlRequest**](CreateCheckoutUrlRequest.md)| Specify checkout URL creation parameters. |
|
51
|
+
|
52
|
+
### Return type
|
53
|
+
|
54
|
+
[**CreateCheckoutUrlResponse**](CreateCheckoutUrlResponse.md)
|
55
|
+
|
56
|
+
Field | Type | Description
|
57
|
+
----- | ----- | -----
|
58
|
+
id | string | Unique identifier generated for this checkout URL
|
59
|
+
url | string | URL for buyer to complete payment
|
60
|
+
|
61
|
+
### Format - hmac.input GET parameter passed in successUrl
|
62
|
+
|
63
|
+
The hmac.input GET parameter passed to successUrl contains payment parameters as a pipe ('|') separated string in the following order,
|
64
|
+
<ul style="font-weight: 500">
|
65
|
+
<li><b>Chain</b> - Please refer documentation for <a href="https://pay.bleumi.com/docs/#supported-networks" target="_blank">Supported Networks</a> </li>
|
66
|
+
<li><b>Wallet Address</b></li>
|
67
|
+
<li><b>Token</b><br> <i>ETH</i> - for Ethereum<br> <i>XDAI</i> - for xDai<br> <i>XDAIT</i> - for xDai Testnet<br> <i><contract address of ERC-20 token></i> - for ERC-20; Please refer to [ERC-20 Tokens](/docs/#erc-20) for contract address;</li>
|
68
|
+
<li><b>Amount</b> - Token amount for the payment</li>
|
69
|
+
<li><b>Number of block confirmations</b><br> <i>12</i> - for ETH<br> <i>0</i> - for XDAI<br> <i>0</i> - for XDAIT<br> <i>12</i> - for ERC-20</li></li>
|
70
|
+
</ul>
|
71
|
+
|
72
|
+
<aside class="notice">
|
73
|
+
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.
|
74
|
+
</aside>
|
75
|
+
|
76
|
+
|
77
|
+
### 400 Errors
|
78
|
+
|
79
|
+
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.
|
80
|
+
|
81
|
+
errorCode <br> <i>errorMessage</i> | Description
|
82
|
+
---- | ----
|
83
|
+
ValidationError <br> <i><details></i> | Details on input which does not conform to the above schema
|
84
|
+
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>
|
85
|
+
ValidationError <br> <i>no_tokens_defined_for_currency</i> | No tokens have been defined in your account for the specified currency
|
86
|
+
ValidationError <br> <i>invalid_token</i> | The token provided is not valid for the specified currency
|
87
|
+
|
88
|
+
|
89
|
+
## list_tokens
|
90
|
+
|
91
|
+
> CheckoutTokens list_tokens
|
92
|
+
|
93
|
+
Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
94
|
+
|
95
|
+
### Example
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
# load the gem
|
99
|
+
require 'bleumi_pay_sdk_ruby'
|
100
|
+
# setup authorization
|
101
|
+
BleumiPay.configure do |config|
|
102
|
+
# Configure API key authorization: ApiKeyAuth
|
103
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
104
|
+
end
|
105
|
+
|
106
|
+
api_instance = BleumiPay::HostedCheckoutsApi.new
|
107
|
+
|
108
|
+
begin
|
109
|
+
#Retrieve all tokens configured for the Hosted Checkout in your account in the [Bleumi Pay Dashboard](https://pay.bleumi.com/app/).
|
110
|
+
result = api_instance.list_tokens
|
111
|
+
p result
|
112
|
+
rescue BleumiPay::ApiError => e
|
113
|
+
puts "Exception when calling HostedCheckoutsApi->list_tokens: #{e}"
|
114
|
+
end
|
115
|
+
```
|
116
|
+
|
117
|
+
### Parameters
|
118
|
+
|
119
|
+
This endpoint does not need any parameter.
|
120
|
+
|
121
|
+
### Return type
|
122
|
+
|
123
|
+
[**CheckoutTokens**](CheckoutTokens.md)
|
124
|
+
|
125
|
+
|
126
|
+
### 400 Errors
|
127
|
+
|
128
|
+
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.
|
129
|
+
|
130
|
+
errorCode <br> <i>errorMessage</i> | Description
|
131
|
+
---- | ----
|
132
|
+
ValidationError <br> <i>no_tokens_defined</i> | No tokens have been defined in your account
|
133
|
+
|
134
|
+
|
135
|
+
## validate_checkout_payment
|
136
|
+
|
137
|
+
> ValidateCheckoutResponse validate_checkout_payment(validate_checkout_request)
|
138
|
+
|
139
|
+
Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
140
|
+
|
141
|
+
|
142
|
+
### Example
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
# load the gem
|
146
|
+
require 'bleumi_pay_sdk_ruby'
|
147
|
+
# setup authorization
|
148
|
+
BleumiPay.configure do |config|
|
149
|
+
# Configure API key authorization: ApiKeyAuth
|
150
|
+
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
|
151
|
+
end
|
152
|
+
|
153
|
+
api_instance = BleumiPay::HostedCheckoutsApi.new
|
154
|
+
|
155
|
+
begin
|
156
|
+
validate_checkout_request = BleumiPay::ValidateCheckoutRequest.new # ValidateCheckoutRequest | Specify validation of checkout parameters.
|
157
|
+
validate_checkout_request.hmac_alg = '<ALD>' # Eg. HMAC-SHA256-HEX
|
158
|
+
validate_checkout_request.hmac_input = '<INPUT>' # Eg. ropsten|0xbe33cde200e113f4847c66e9498f2c30e81635ad|0x115615dbd0f835344725146fa6343219315f15e5|10|12
|
159
|
+
validate_checkout_request.hmac_key_id = '<VER>' # Eg. v1
|
160
|
+
validate_checkout_request.hmac_value = '<HMAC_VALUE>' # Eg. 0d910e8dfd087dd0d0b7c3f6504f7f4316b507afc81c09e844cfeee0f3dbaef6
|
161
|
+
#Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
|
162
|
+
result = api_instance.validate_checkout_payment(validate_checkout_request)
|
163
|
+
p result
|
164
|
+
rescue BleumiPay::ApiError => e
|
165
|
+
puts "Exception when calling HostedCheckoutsApi->validate_checkout_payment: #{e}"
|
166
|
+
end
|
167
|
+
```
|
168
|
+
|
169
|
+
### Parameters
|
170
|
+
|
171
|
+
|
172
|
+
Name | Type | Description | Notes
|
173
|
+
------------- | ------------- | ------------- | -------------
|
174
|
+
**validate_checkout_request** | [**ValidateCheckoutRequest**](ValidateCheckoutRequest.md)| Specify validation of checkout parameters. |
|
175
|
+
|
176
|
+
### Return type
|
177
|
+
|
178
|
+
[**ValidateCheckoutResponse**](ValidateCheckoutResponse.md)
|
179
|
+
|
180
|
+
Field | Type | Description
|
181
|
+
----- | ----- | -----
|
182
|
+
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
|
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
|