bleumi_pay_sdk_ruby 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +22 -22
  4. data/bleumi_pay_sdk_ruby.gemspec +1 -1
  5. data/docs/AlgorandBalance.md +1 -0
  6. data/docs/Chain.md +2 -0
  7. data/docs/CreateCheckoutUrlRequest.md +2 -4
  8. data/docs/CreatePayoutRequest.md +1 -1
  9. data/docs/EthereumBalance.md +1 -0
  10. data/docs/HostedCheckoutsApi.md +12 -17
  11. data/docs/PaginatedPayments.md +4 -0
  12. data/docs/Payment.md +2 -0
  13. data/docs/PaymentAddresses.md +13 -31
  14. data/docs/PaymentBalances.md +13 -25
  15. data/docs/PaymentOperationInputs.md +1 -2
  16. data/docs/PaymentRefundRequest.md +1 -2
  17. data/docs/PaymentSettleRequest.md +1 -1
  18. data/docs/PaymentsApi.md +4 -67
  19. data/docs/PayoutsApi.md +2 -2
  20. data/docs/RskBalance.md +28 -0
  21. data/docs/WalletBalance.md +14 -10
  22. data/hc_create.rb +40 -0
  23. data/hc_list.rb +17 -0
  24. data/hc_validate.rb +22 -0
  25. data/lib/bleumi_pay_sdk_ruby.rb +1 -0
  26. data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +5 -13
  27. data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +40 -16
  28. data/lib/bleumi_pay_sdk_ruby/api_client.rb +7 -5
  29. data/lib/bleumi_pay_sdk_ruby/models/chain.rb +2 -0
  30. data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +15 -4
  31. data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +13 -4
  32. data/lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb +219 -0
  33. data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +19 -4
  34. data/lib/bleumi_pay_sdk_ruby/version.rb +1 -1
  35. data/po_create.rb +39 -0
  36. data/po_list.rb +23 -0
  37. data/py_create.rb +48 -0
  38. data/py_get.rb +18 -0
  39. data/py_getop.rb +19 -0
  40. data/py_list.rb +24 -0
  41. data/py_listops.rb +21 -0
  42. data/py_refund.rb +43 -0
  43. data/py_settle.rb +43 -0
  44. data/spec/api_client_spec.rb +1 -1
  45. data/spec/models/payment_addresses_spec.rb +6 -0
  46. data/spec/models/payment_balances_spec.rb +6 -0
  47. data/spec/models/rsk_balance_spec.rb +47 -0
  48. data/spec/models/wallet_balance_spec.rb +6 -0
  49. metadata +22 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc66c63b369f8b31f6efadf51a1fe953f53ed5c92efb33be6dd432ffd9ddd82d
4
- data.tar.gz: a9f5da041c836a6668b4a2fcba3b678e5357e492925d948d91571e07c2dc9239
3
+ metadata.gz: 2516d7bc08d49d915d4ee4c530a9928635d54a5ffefead3092129d401ab27afe
4
+ data.tar.gz: 9a95feecb24b512e60e14e1a7f6da2a84e4f65ebb7a001eebd49d3544306eceb
5
5
  SHA512:
6
- metadata.gz: ad034fa51a5de8561679b7c04c3ce668867c7f6bbe179aa955b188bbc6cc4350d45d68c02745c22b1f9702afeb5501c4dbe826ccd819e6aa77d0e7419fec5820
7
- data.tar.gz: 5b89ea7404b9a6160020206454d7ec59912ff49758260109fc8fccf478ebef4e7fbf953e5ed4007c0dbab9a6fadd34ffc1c39e490b8eac1d77bf80f3daef3ce6
6
+ metadata.gz: f17f1028e071ebd35c5ba82c7043e7c62a3da57c5ee4fae50da9b14d7b5e28ce24f501d50587229013f138e2ab9ecf73039885f61621ecb76ae780c5a641a1c2
7
+ data.tar.gz: c57949398c04c9dffe9dd0124c3d22de9bb70da39c8ba1ad6b9a4f03d885c0dbc27109b98141ee1e2b8e750082b70d7f88b4eb79198ff51e515979d71389c127
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'rake', '~> 12.3.3'
6
+ gem 'rake', '~> 13.0.1'
7
7
  gem 'pry-byebug'
8
8
  gem 'rubocop', '~> 0.66.0'
9
9
  end
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- <img src="https://pay.bleumi.com/wp-content/uploads/2019/04/logo_dark_bleumi_invoice_6797x1122.png" height="30">
1
+ <img src="./assets/images/BleumiPay.png" height="30">
2
2
 
3
3
  # Bleumi Pay SDK for Ruby
4
4
 
5
5
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](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 Algorand, Ethereum, ERC-20 and 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.
7
+ The Bleumi Pay SDK helps you integrate Algo, Algorand Standard Asset, Ethereum, ERC-20, RSK, RSK ERC-20 & xDai payments and 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
- bleumi-pay-sdk-ruby is a Ruby library that provides an interface between your Ruby application and [Bleumi Pay API](https://pay.bleumi.com/docs/#introduction). This tutorial covers the basics, including examples, needed to use the SDK.
9
+ **bleumi-pay-sdk-ruby** is a Ruby library that provides an interface between your Ruby 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
 
11
11
  ## Getting Started
12
12
 
@@ -38,7 +38,7 @@ Add the following in the Gemfile:
38
38
 
39
39
  ### Run Sample Code
40
40
 
41
- The following code generates a payment request to accept payment from the buyer:
41
+ The following code generates an unique checkout URL to accept payment from the buyer:
42
42
 
43
43
 
44
44
  ```ruby
@@ -50,23 +50,25 @@ BleumiPay.configure do |config|
50
50
  config.api_key['x-api-key'] = '<YOUR_API_KEY>'
51
51
  end
52
52
 
53
- api_instance = BleumiPay::PayoutsApi.new
54
- create_payment_request = BleumiPay::CreatePaymentRequest.new # CreatePaymentRequest |
55
- opts = {
56
- chain: BleumiPay::Chain::GOERLI # Chain | Network in which payment is to be created. Please refer documentation for Supported Networks
57
- }
53
+ api_instance = BleumiPay::HostedCheckoutsApi.new
54
+ create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreateCheckoutUrlRequest | Specify checkout URL creation parameters.
58
55
 
59
56
  begin
60
-
61
- create_payment_request.id = '<ID>'
62
- create_payment_request.buyer_address = '<BUYER_ADDR>' # Replace <BUYER_ADDR> with the Buyer's Network Address
63
- create_payment_request.transfer_address = '<MERCHANT_ADDR>' # Replace <MERCHANT_ADDR> with the Merchant's Network Address
64
57
 
65
- #Create a payout.
66
- result = api_instance.create_payment(create_payment_request, opts)
58
+ create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreatePayoutRequest | Specify payout creation parameters.
59
+ create_checkout_url_request.id = '<ID>' # Eg. 1
60
+ create_checkout_url_request.currency = "<CURRENCY>" # Eg. USD
61
+ create_checkout_url_request.amount = "<AMOUNT>" # Eg. 10
62
+ create_checkout_url_request.success_url = "<SUCCESS_URL>" # Eg. https://demo.store/api/completeOrder
63
+ create_checkout_url_request.cancel_url = "<CANCEL_URL>" # Eg. https://demo.store/api/cancelOrder
64
+ 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
65
+ create_checkout_url_request.chain = BleumiPay::Chain::GOERLI # Replace with any Chain as required
66
+
67
+ #Generate a unique checkout URL to accept payment.
68
+ result = api_instance.create_checkout_url(create_checkout_url_request)
67
69
  p result
68
70
  rescue BleumiPay::ApiError => e
69
- puts "Exception when calling PayoutsApi->create_payment: #{e}"
71
+ puts "Exception when calling HostedCheckoutsApi->create_checkout_url: #{e}"
70
72
  end
71
73
  ```
72
74
 
@@ -76,16 +78,15 @@ More examples can be found under each method in [SDK Classes](#sdk-classes) sect
76
78
 
77
79
  Class | Method | HTTP request | Description
78
80
  ------------ | ------------- | ------------- | -------------
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
81
+ BleumiPay::HostedCheckoutsApi | [**create_checkout_url**](docs/HostedCheckoutsApi.md#create_checkout_url) | **POST** /v1/payment/hc | Generate a unique checkout URL to accept payment.
82
+ 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/).
83
+ 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.
80
84
  BleumiPay::PaymentsApi | [**get_payment**](docs/PaymentsApi.md#get_payment) | **GET** /v1/payment/{id} | Retrieve the wallet addresses & token balances for a given payment
81
85
  BleumiPay::PaymentsApi | [**list_payments**](docs/PaymentsApi.md#list_payments) | **GET** /v1/payment | Retrieve all payments created.
82
86
  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
87
  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
88
  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
89
  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
90
  BleumiPay::PayoutsApi | [**create_payout**](docs/PayoutsApi.md#create_payout) | **POST** /v1/payout | Create a payout.
90
91
  *BleumiPay::PayoutsApi* | [**list_payouts**](docs/PayoutsApi.md#list_payouts) | **GET** /v1/payout | Returns a list of payouts
91
92
 
@@ -100,8 +101,6 @@ BleumiPay::PayoutsApi | [**create_payout**](docs/PayoutsApi.md#create_payout) |
100
101
  - [BleumiPay::CheckoutToken](docs/CheckoutToken.md)
101
102
  - [BleumiPay::CreateCheckoutUrlRequest](docs/CreateCheckoutUrlRequest.md)
102
103
  - [BleumiPay::CreateCheckoutUrlResponse](docs/CreateCheckoutUrlResponse.md)
103
- - [BleumiPay::CreatePaymentRequest](docs/CreatePaymentRequest.md)
104
- - [BleumiPay::CreatePaymentResponse](docs/CreatePaymentResponse.md)
105
104
  - [BleumiPay::CreatePayoutRequest](docs/CreatePayoutRequest.md)
106
105
  - [BleumiPay::CreatePayoutResponse](docs/CreatePayoutResponse.md)
107
106
  - [BleumiPay::EthereumBalance](docs/EthereumBalance.md)
@@ -121,6 +120,7 @@ BleumiPay::PayoutsApi | [**create_payout**](docs/PayoutsApi.md#create_payout) |
121
120
  - [BleumiPay::Payout](docs/Payout.md)
122
121
  - [BleumiPay::PayoutItem](docs/PayoutItem.md)
123
122
  - [BleumiPay::PayoutItemInputs](docs/PayoutItemInputs.md)
123
+ - [BleumiPay::RskBalance](docs/RskBalance.md)
124
124
  - [BleumiPay::ValidateCheckoutRequest](docs/ValidateCheckoutRequest.md)
125
125
  - [BleumiPay::ValidateCheckoutResponse](docs/ValidateCheckoutResponse.md)
126
126
  - [BleumiPay::WalletBalance](docs/WalletBalance.md)
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.email = ["info@bleumi.com"]
24
24
  s.homepage = "https://pay.bleumi.com/"
25
25
  s.summary = "Bleumi Pay API Ruby Gem"
26
- s.description = "The Bleumi Pay SDK is a one-stop shop to help you integrate Algorand, Ethereum, ERC-20 and xDai payments and/or payouts into your business."
26
+ s.description = "The Bleumi Pay SDK helps you integrate Algo, Algorand Standard Asset, Ethereum, ERC-20, RSK, RSK ERC-20 & xDai payments and payouts into your business or application. The SDK bundles 'Bleumi Pay API' into one SDK to ease implementation and support."
27
27
  s.license = "MIT"
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
@@ -18,6 +18,7 @@ Name | Type | Description | Notes
18
18
  "blockNum": "4457461",
19
19
  "token_balance": "10000000",
20
20
  "balance": "10",
21
+ "safety": "high",
21
22
  "token_decimals": 6
22
23
  }
23
24
  }
@@ -10,3 +10,5 @@ Network enumeration. Please refer to the [Supported Networks](https://pay.bleumi
10
10
  * `XDAI_TESTNET` (value: `"xdai_testnet"`)
11
11
  * `ALG_MAINNET` (value: `"alg_mainnet"`)
12
12
  * `ALG_TESTNET` (value: `"alg_testnet"`)
13
+ * `RSK` (value: `"rsk"`)
14
+ * `RSK_TESTNET` (value: `"rsk_testnet"`)
@@ -9,9 +9,8 @@ Name | Type | Description | Notes
9
9
  **amount** | **String** | Token amount for this payment |
10
10
  **cancel_url** | **String** | Buyer will be redirected to this URL upon canceling the payment. |
11
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
- **buyer_address** <br>(Optional)| **String** | Address of buyer. Refund operations on this payment will use this address. You can set this to your address to manually handle refunds (outside of Bleumi Pay) to your buyer. This address must be able to receive payments from smart contracts. |
13
12
  **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) |
14
- **token** <br>(Optional)| **String** | 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>ALGO</b> - for Algo<br> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset<br> <b>&lt;contract address of ERC-20 token&gt;</b> - for ERC-20; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
13
+ **token** <br>(Optional)| **String** | 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>ALGO</b> - for Algo <br/> <b>RBTC</b> - for R-BTC <br/> <b> &lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> &lt;contract address of RSK ERC-20 token&gt;</b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
15
14
  **base64_transform** <br>(Optional)| **Boolean** | Base64 encode hmac_input GET parameter passed to the successUrl |
16
15
 
17
16
  ## Example
@@ -24,7 +23,6 @@ Name | Type | Description | Notes
24
23
  "cancelUrl": "https://demo.store/api/cancelOrder",
25
24
  "successUrl": "https://demo.store/api/completeOrder",
26
25
  "token":"0x115615dbd0f835344725146fa6343219315f15e5",
27
- "chain":"goerli",
28
- "buyerAddress":"0x713883BF69B786f0A7aB6E2248a70C50577F6b34"
26
+ "chain":"goerli"
29
27
  }
30
28
  ```
@@ -5,7 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **txid** | **String** | Unique identifier for this payout |
8
- **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
8
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>RBTC</b> - for R-BTC <br/> <b> &lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> &lt;contract address of RSK ERC-20 token&gt;</b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
9
9
  **payouts** | [**Array&lt;Payout&gt;**](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
10
 
11
11
  ## Example
@@ -20,6 +20,7 @@ Name | Type | Description | Notes
20
20
  "blockNum": "2049977",
21
21
  "token_balance": "10000000",
22
22
  "balance": "10",
23
+ "safety": "high",
23
24
  "token_decimals": 6
24
25
  }
25
26
  }
@@ -23,16 +23,14 @@ create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreateCh
23
23
 
24
24
  begin
25
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> with ETH or XDAI or ERC-20 Token Contract Address or XDAIT
33
- create_checkout_url_request.chain = BleumiPay::Chain::GOERLI #
34
- create_checkout_url_request.buyer_address = '<BUYER_ADDR>' # Replace <BUYER_ADDR> with the buyer's Ethereum Address
35
-
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
36
34
 
37
35
  #Generate a unique checkout URL to accept payment.
38
36
  result = api_instance.create_checkout_url(create_checkout_url_request)
@@ -69,16 +67,13 @@ The hmac_input GET parameter passed to successUrl contains payment parameters as
69
67
  <i>XDAI</i> - for xDai<br>
70
68
  <i>XDAIT</i> - for xDai Testnet<br>
71
69
  <i>ALGO</i> - for Algo <br>
70
+ <i>RBTC</i> - for R-BTC <br>
72
71
  <i>&lt;asset id&gt;</i> - for Algorand Standard Asset <br>
73
- <i>&lt;contract address of ERC-20 token&gt;</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; </li>
72
+ <i>&lt;contract address of ERC-20 token&gt;</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>&lt;contract address of RSK ERC-20 token&gt;</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>
74
75
  <li><b>Amount</b> - Token amount for the payment</li>
75
76
  <li><b>Number of block confirmations</b><br>
76
- <i>12</i> - for ETH<br>
77
- <i>0</i> - for XDAI<br>
78
- <i>0</i> - for XDAIT<br>
79
- <i>0</i> - for ALGO<br>
80
- <i>0</i> - for Algorand Standard Asset<br>
81
- <i>12</i> - for ERC-20<br>
82
77
  </li>
83
78
  </li>
84
79
  </ul>
@@ -35,12 +35,14 @@ Name | Type | Description | Notes
35
35
  "blockNum": "5388041",
36
36
  "token_balance": "10000000",
37
37
  "balance": "10",
38
+ "safety": "high",
38
39
  "token_decimals": 6
39
40
  },
40
41
  "ALGO": {
41
42
  "blockNum": "5388035",
42
43
  "token_balance": "209000",
43
44
  "balance": "0.209",
45
+ "safety": "high",
44
46
  "token_decimals": 6
45
47
  }
46
48
  }
@@ -72,12 +74,14 @@ Name | Type | Description | Notes
72
74
  "balance": "4",
73
75
  "token_decimals": 18,
74
76
  "blockNum": "2313213",
77
+ "safety": "high",
75
78
  "token_balance": "4000000000000000000"
76
79
  },
77
80
  "0x115615dbd0f835344725146fa6343219315f15e5": {
78
81
  "balance": "9",
79
82
  "token_decimals": 6,
80
83
  "blockNum": "2313213",
84
+ "safety": "high",
81
85
  "token_balance": "9000000"
82
86
  }
83
87
  }
@@ -46,6 +46,7 @@ Name | Type | Description | Notes
46
46
  "balance": "0",
47
47
  "token_decimals": 6,
48
48
  "blockNum": "2314477",
49
+ "safety": "high",
49
50
  "token_balance": "0"
50
51
  }
51
52
  },
@@ -54,6 +55,7 @@ Name | Type | Description | Notes
54
55
  "token_decimals": 15,
55
56
  "blockNum": "2314454",
56
57
  "token_balance": "5000000000000000",
58
+ "safety": "high",
57
59
  "balance": "5"
58
60
  }
59
61
  }
@@ -4,36 +4,18 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **ethereum** | [**Hash&lt;String, EthereumWalletAddress&gt;**](EthereumWalletAddress.md) | A dictionary which gives the address of the wallet generated for each Ethereum network |
8
- **algorand** | [**Hash&lt;String, AlgorandWalletAddress&gt;**](AlgorandWalletAddress.md) | A dictionary which gives the address of the wallet generated for each Algorand network |
7
+ **ethereum** | [**Hash&lt;String, EthereumWalletAddress&gt;**](EthereumWalletAddress.md) | | [optional]
8
+ **algorand** | [**Hash&lt;String, AlgorandWalletAddress&gt;**](AlgorandWalletAddress.md) | | [optional]
9
+ **rsk** | [**Hash&lt;String, EthereumWalletAddress&gt;**](EthereumWalletAddress.md) | | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'BleumiPay'
15
+
16
+ instance = BleumiPay::PaymentAddresses.new(ethereum: null,
17
+ algorand: null,
18
+ rsk: null)
19
+ ```
9
20
 
10
- ## Example
11
21
 
12
- ```json
13
- {
14
- "ethereum": {
15
- "goerli": {
16
- "addr": "0xbe7b6dd3a81b9ae6b27b9a4690af39690095c791",
17
- "inputs": {
18
- "buyer": "0x713883bf69b786f0a7ab6e2248a70c50577f6b34",
19
- "walletLibrary": "0xb33893fdf59b634653fcbed27b5d38d86710fc40",
20
- "merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
21
- "salt": "0x5fca1a8d4c6e8786f915a57a9bdde2be9d643b93f366ffa713384fe75762e4aa",
22
- "walletProxy": "0xfaac6b338f79cfd8a53dfec95263f12ef046a049"
23
- }
24
- }
25
- },
26
- "algorand": {
27
- "alg_testnet": {
28
- "addr": "BEGKKXKFVAIU2PJK274A6GJDQK7J323RLEPMRRFKSDARTX2LFYR6S6VNLM",
29
- "inputs": {
30
- "merchant": "CQRMTAHZJA3SIEOTEMZXCAIZKUWE2CCLBCFYQI4NINU43IOTEWT4LOT4IY",
31
- "salt": "dbc9d66dca9185c04c8fb6dc201db8f572ICevWSmBwaIL+TZExKWDigc4PDAQwy125SrvxoMHoWHNbS79Dp+w==",
32
- "gas": "CQRMTAHZJA3SIEOTEMZXCAIZKUWE2CCLBCFYQI4NINU43IOTEWT4LOT4IY",
33
- "programBytes": "ASYGIBQiyYD5SDckEdMjM3EBGVUsTQhLCIuII41Dac2h0yWnILdvTiLCnUM8XlhBk4uR9z6d2XovOsvEq11pH4nuIBD5IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3BheQVheGZlciBdtOnkjuxx1Dec/b84B7gMkevLMHGQmt2Q5eDcnAU/KzEHKBIxBykSETEJKhIxCSgSMQkpEhExCSgSEREQMQ8rEhAxFCgSMRQpEhExFSoSMRUoEjEVKRIRERAxDycEEhARMQUBJwUSEDEUMQASEQ==",
34
- "buyer": "W5XU4IWCTVBTYXSYIGJYXEPXH2O5S6RPHLF4JK25NEPYT3RACD4Z3EBS4A"
35
- }
36
- }
37
- }
38
- }
39
- ```
@@ -4,30 +4,18 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **ethereum** <br> (Optional) | [**EthereumBalance**](EthereumBalance.md) | A dictionary which gives the token balances in each Ethereum network |
8
- **algorand** <br> (Optional) | [**AlgorandBalance**](AlgorandBalance.md) | A dictionary which gives the token balances in each Algorand network |
7
+ **ethereum** | [**EthereumBalance**](EthereumBalance.md) | | [optional]
8
+ **algorand** | [**AlgorandBalance**](AlgorandBalance.md) | | [optional]
9
+ **rsk** | [**RskBalance**](RskBalance.md) | | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'BleumiPay'
15
+
16
+ instance = BleumiPay::PaymentBalances.new(ethereum: null,
17
+ algorand: null,
18
+ rsk: null)
19
+ ```
9
20
 
10
- ## Example
11
21
 
12
- ```json
13
- {
14
- "ethereum": {
15
- "goerli": {
16
- "0x84df8548086ec9025e9c93297058bed706e90ddd":
17
- {
18
- "balance": "4",
19
- "token_decimals": 18,
20
- "blockNum": "2313213",
21
- "token_balance": "4000000000000000000"
22
- },
23
- "0x115615dbd0f835344725146fa6343219315f15e5":
24
- {
25
- "balance": "9",
26
- "token_decimals": 6,
27
- "blockNum": "2313213",
28
- "token_balance": "9000000"
29
- }
30
- }
31
- }
32
- }
33
- ```
@@ -6,8 +6,7 @@ Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **addr** | **String** | Address of the wallet |
8
8
  **amount** <br> (Optional) | **String** | Amount (Only for settle operation) |
9
- **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
10
- **token_amount** <br> (Optional) | **String** | Token amount to be settled in network format (Only for settle operation) |
9
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>RBTC</b> - for R-BTC <br/> <b> &lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> &lt;contract address of RSK ERC-20 token&gt;</b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
11
10
  **token_decimals** <br> (Optional) | **Integer** | Token decimal places (Only for settle operation) |
12
11
 
13
12
  ## Settle Operation Example
@@ -4,8 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
8
-
7
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>RBTC</b> - for R-BTC <br/> <b> &lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> &lt;contract address of RSK ERC-20 token&gt;</b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
9
8
  ## Example
10
9
 
11
10
  ```json
@@ -4,7 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>&lt;asset id&gt;</b> - for Algorand Standard Asset payouts <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 payouts; Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; |
7
+ **token** | **String** | <b>ETH</b> - for Ethereum <br/> <b>XDAI</b> - for xDai <br/> <b>XDAIT</b> - for xDai Testnet <br/> <b>ALGO</b> - for Algo <br/> <b>RBTC</b> - for R-BTC <br/> <b> &lt;asset id&gt;</b> - for Algorand Standard Asset <br/> <b> &lt;contract address of ERC-20 token&gt;</b> - for ERC-20 Tokens. Please refer to [ERC-20 Tokens](https://pay.bleumi.com/docs/#erc-20) for contract address; <br/> <b> &lt;contract address of RSK ERC-20 token&gt;</b> - for RSK ERC-20 Tokens. Please refer to [RSK ERC-20 Tokens](https://pay.bugnet.work/docs/#rsk-tokens-erc-20) for contract address;|
8
8
  **amount** | **String** | Amount to be settled |
9
9
 
10
10
  ## Example
@@ -1,70 +1,6 @@
1
1
  # BleumiPay::PaymentsApi
2
2
 
3
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::GOERLI # Chain | 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 = '<BUYER_ADDR>' # Replace <BUYER_ADDR> with the Buyer's Enthereum Network Address
31
- create_payment_request.transfer_address = '<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 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
- inputs | dictionary | A dictionary containing the network specific details used to create the wallet
56
-
57
- **Note:** Bleumi recommends each merchant to keep a copy of the `inputs` map to ensure access to wallet funds at all times.
58
-
59
- ### 400 Errors
60
-
61
- 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.
62
-
63
- errorCode <br> <i>errorMessage</i> | Description
64
- ---- | ----
65
- ValidationError <br> <i>&lt;details&gt;</i> | Details on input which does not conform to the above schema
66
- ValidationError <br> <i>wallet_already_exists&#124;&lt;addr&gt;</i> | A wallet with address &lt;addr&gt; has already been created with the specified payment 'id' for the given network
67
-
68
4
  ## get_payment
69
5
 
70
6
  > Payment get_payment(id)
@@ -222,8 +158,9 @@ begin
222
158
  id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
223
159
  payment_settle_request = BleumiPay::PaymentSettleRequest.new # PaymentSettleRequest | Request body - used to specify the amount to settle.
224
160
  payment_settle_request.amount = '<AMT>' # String | Replace <AMT> with settle amount
225
- payment_settle_request.token = '<TOKEN>' # String | Replace <TOKEN> with "ALGO" or "ETH" or "XDAI" or "XDAIT" or ERC-20 'Token Contract Address' or 'Algorand Standard Asset token'
226
- #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
161
+ payment_settle_request.token = '<TOKEN>' # Replace <TOKEN> by anyone of the following values: 'ETH' or 'XDAI' or 'XDAIT' or ECR-20 Contract Address or 'RBTC' or RSK ECR-20 Contract Address or 'Asset ID' of Algorand Standard Asset.
162
+
163
+ # Settle a specific amount of a token for a given payment to the transferAddress and remaining balance (if any) will be refunded to the buyerAddress
227
164
  result = api_instance.settle_payment(id, payment_settle_request, opts)
228
165
  p result
229
166
  rescue BleumiPay::ApiError => e
@@ -281,7 +218,7 @@ opts = {
281
218
  begin
282
219
  id = '<ID>' # String | Unique identifier of the payment (specified during create payment)
283
220
  payment_refund_request = BleumiPay::PaymentRefundRequest.new # PaymentRefundRequest | Request body - used to specify the token to refund.
284
- payment_refund_request.token = '<TOKEN>' # String | Replace <TOKEN> with "ALGO" or "ETH" or "XDAI" or "XDAIT" or ERC-20 'Token Contract Address' or 'Algorand Standard Asset token'
221
+ payment_refund_request.token = '<TOKEN>' # String | Replace <TOKEN> by anyone of the following values: 'ETH' or 'XDAI' or 'XDAIT' or ECR-20 Contract Address or 'RBTC' or RSK ECR-20 Contract Address or 'Asset ID' of Algorand Standard Asset.
285
222
 
286
223
  #Refund the balance of a token for a given payment to the buyerAddress
287
224
  result = api_instance.refund_payment(id, payment_refund_request, opts)