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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +22 -22
- data/bleumi_pay_sdk_ruby.gemspec +1 -1
- data/docs/AlgorandBalance.md +1 -0
- data/docs/Chain.md +2 -0
- data/docs/CreateCheckoutUrlRequest.md +2 -4
- data/docs/CreatePayoutRequest.md +1 -1
- data/docs/EthereumBalance.md +1 -0
- data/docs/HostedCheckoutsApi.md +12 -17
- data/docs/PaginatedPayments.md +4 -0
- data/docs/Payment.md +2 -0
- data/docs/PaymentAddresses.md +13 -31
- data/docs/PaymentBalances.md +13 -25
- data/docs/PaymentOperationInputs.md +1 -2
- data/docs/PaymentRefundRequest.md +1 -2
- data/docs/PaymentSettleRequest.md +1 -1
- data/docs/PaymentsApi.md +4 -67
- data/docs/PayoutsApi.md +2 -2
- data/docs/RskBalance.md +28 -0
- data/docs/WalletBalance.md +14 -10
- 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 +1 -0
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +5 -13
- data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +40 -16
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +7 -5
- data/lib/bleumi_pay_sdk_ruby/models/chain.rb +2 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +15 -4
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +13 -4
- data/lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +19 -4
- data/lib/bleumi_pay_sdk_ruby/version.rb +1 -1
- 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_client_spec.rb +1 -1
- data/spec/models/payment_addresses_spec.rb +6 -0
- data/spec/models/payment_balances_spec.rb +6 -0
- data/spec/models/rsk_balance_spec.rb +47 -0
- data/spec/models/wallet_balance_spec.rb +6 -0
- metadata +22 -4
data/py_get.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
id = '16' # String | Unique ID identifying the wallet in your system
|
11
|
+
|
12
|
+
begin
|
13
|
+
#Return a specific wallet
|
14
|
+
result = api_instance.get_payment(id)
|
15
|
+
p result
|
16
|
+
rescue BleumiPay::ApiError => e
|
17
|
+
puts "Exception when calling PaymentsApi->get_payment: #{e}"
|
18
|
+
end
|
data/py_getop.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
id = '16' # String | Unique ID identifying the wallet in your system
|
11
|
+
txid = '1580382159243' # String | ID of a specific operation of the wallet
|
12
|
+
|
13
|
+
begin
|
14
|
+
#Return a specific operation of the wallet
|
15
|
+
result = api_instance.get_payment_operation(id, txid)
|
16
|
+
p result
|
17
|
+
rescue BleumiPay::ApiError => e
|
18
|
+
puts "Exception when calling PaymentsApi->get_payment_operation: #{e}"
|
19
|
+
end
|
data/py_list.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
opts = {
|
11
|
+
next_token: '', # String | Cursor to start results from. Eg. Cm0KEwoJY3JlYXRlZEF0EgYI/IjA8QUSUmoQc35wYXktZGV2LTIzNTkxMXI+CxIHQWNjb3VudCIkVWxvbTNlaVZaTFhqR3gyYWxCcnhDOG13UWx6MXxzYW5kYm94DAsSBldhbGxldCIBOQwYACAA
|
12
|
+
sort_by: 'createdAt', # String | Sort payments by
|
13
|
+
sort_order: 'ascending', # String | Sort Order for payments
|
14
|
+
start_at: '1577836800', # String | Get payments from this timestamp
|
15
|
+
end_at: nil # String | Get payments till this timestamp
|
16
|
+
}
|
17
|
+
|
18
|
+
begin
|
19
|
+
#Returns a list of wallets
|
20
|
+
result = api_instance.list_payments(opts)
|
21
|
+
p result
|
22
|
+
rescue BleumiPay::ApiError => e
|
23
|
+
puts "Exception when calling list_payments: #{e}"
|
24
|
+
end
|
data/py_listops.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
id = '16' # String | Unique ID identifying the wallet in your system
|
11
|
+
opts = {
|
12
|
+
next_token: '' # String | Cursor to start results from
|
13
|
+
}
|
14
|
+
|
15
|
+
begin
|
16
|
+
#Return the list of operations performed by the mechant on a specific wallet
|
17
|
+
result = api_instance.list_payment_operations(id, opts)
|
18
|
+
p result
|
19
|
+
rescue BleumiPay::ApiError => e
|
20
|
+
puts "Exception when calling list_payment_operations: #{e}"
|
21
|
+
end
|
data/py_refund.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
id = '16' # String | Unique ID identifying this record in your system
|
11
|
+
|
12
|
+
# opts = {
|
13
|
+
# chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
|
14
|
+
# }
|
15
|
+
# refundTokenAddresss = '0x115615DbD0f835344725146Fa6343219315F15E5'
|
16
|
+
|
17
|
+
# opts = {
|
18
|
+
# chain: BleumiPay::Chain::ALG_TESTNET # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
|
19
|
+
# }
|
20
|
+
# refundTokenAddresss = 'ALGO'
|
21
|
+
|
22
|
+
# RSK
|
23
|
+
# USD p18 - 0xB3A4A821434bDFbE55872C240D3888c412c68B9B
|
24
|
+
# USD p6 - 0xb9F624160Bb2755aa25366cc307ED27e39A4f296
|
25
|
+
# USD p2 - 0x1efEaBf46Ca3270A9a41D324350692664f1eA105
|
26
|
+
# EUR p2 - 0xd7a5c209194AC2E8e3E6Ca1dbF3C55484adb06e1
|
27
|
+
# Chain: RSK_TESTNET
|
28
|
+
refundTokenAddresss = '0xb9F624160Bb2755aa25366cc307ED27e39A4f296'
|
29
|
+
opts = {
|
30
|
+
chain: BleumiPay::Chain::RSK_TESTNET # Chain | RSK network in which payment is to be created. Please refer documentation for Supported Networks
|
31
|
+
}
|
32
|
+
|
33
|
+
payment_refund_request = BleumiPay::PaymentRefundRequest.new # PaymentRefundRequest | Request body - used to specify the token to refund.
|
34
|
+
|
35
|
+
payment_refund_request.token = refundTokenAddresss
|
36
|
+
|
37
|
+
begin
|
38
|
+
#Refund wallet
|
39
|
+
result = api_instance.refund_payment(id, payment_refund_request, opts)
|
40
|
+
p result
|
41
|
+
rescue BleumiPay::ApiError => e
|
42
|
+
puts "Exception when calling PaymentsApi->refund_payment: #{e}"
|
43
|
+
end
|
data/py_settle.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# load the gem
|
2
|
+
require 'bleumi_pay_sdk_ruby'
|
3
|
+
# setup authorization
|
4
|
+
BleumiPay.configure do |config|
|
5
|
+
# Configure API key authorization: ApiKeyAuth
|
6
|
+
config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
|
7
|
+
end
|
8
|
+
|
9
|
+
api_instance = BleumiPay::PaymentsApi.new
|
10
|
+
id = '17' # String | Unique ID identifying this record in your system
|
11
|
+
# opts = {
|
12
|
+
# chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
|
13
|
+
# }
|
14
|
+
# settleToken = '0x115615DbD0f835344725146Fa6343219315F15E5'
|
15
|
+
|
16
|
+
# opts = {
|
17
|
+
# chain: BleumiPay::Chain::ALG_TESTNET # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
|
18
|
+
# }
|
19
|
+
# settleToken = 'ALGO'
|
20
|
+
|
21
|
+
# RSK
|
22
|
+
# USD p18 - 0xB3A4A821434bDFbE55872C240D3888c412c68B9B
|
23
|
+
# USD p6 - 0xb9F624160Bb2755aa25366cc307ED27e39A4f296
|
24
|
+
# USD p2 - 0x1efEaBf46Ca3270A9a41D324350692664f1eA105
|
25
|
+
# EUR p2 - 0xd7a5c209194AC2E8e3E6Ca1dbF3C55484adb06e1
|
26
|
+
# Chain: RSK_TESTNET
|
27
|
+
settleToken = '0xb9F624160Bb2755aa25366cc307ED27e39A4f296'
|
28
|
+
opts = {
|
29
|
+
chain: BleumiPay::Chain::RSK_TESTNET # Chain | RSK network in which payment is to be created. Please refer documentation for Supported Networks
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
payment_settle_request = BleumiPay::PaymentSettleRequest.new # WalletSettleOperationInput | Request body - used to specify the amount to settle.
|
34
|
+
payment_settle_request.amount = '10'
|
35
|
+
payment_settle_request.token = settleToken
|
36
|
+
|
37
|
+
begin
|
38
|
+
#Settle a wallet, amount received will be transferred even if less than payment amount
|
39
|
+
result = api_instance.settle_payment(id, payment_settle_request, opts)
|
40
|
+
p result
|
41
|
+
rescue BleumiPay::ApiError => e
|
42
|
+
puts "Exception when calling PaymentsApi->settle_payment: #{e}"
|
43
|
+
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -156,7 +156,7 @@ describe BleumiPay::ApiClient do
|
|
156
156
|
end
|
157
157
|
|
158
158
|
it 'fails for invalid collection format' do
|
159
|
-
expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
159
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: info@bleumi.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for BleumiPay::RskBalance
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'RskBalance' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = BleumiPay::RskBalance.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of RskBalance' do
|
31
|
+
it 'should create an instance of RskBalance' do
|
32
|
+
expect(@instance).to be_instance_of(BleumiPay::RskBalance)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "rsk"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "rsk_testnet"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bleumi_pay_sdk_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bleumi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -70,8 +70,10 @@ dependencies:
|
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '3.6'
|
73
|
-
description: The Bleumi Pay SDK
|
74
|
-
Ethereum, ERC-20
|
73
|
+
description: The Bleumi Pay SDK helps you integrate Algo, Algorand Standard Asset,
|
74
|
+
Ethereum, ERC-20, RSK, RSK ERC-20 & xDai payments and payouts into your business
|
75
|
+
or application. The SDK bundles 'Bleumi Pay API' into one SDK to ease implementation
|
76
|
+
and support.
|
75
77
|
email:
|
76
78
|
- info@bleumi.com
|
77
79
|
executables: []
|
@@ -115,9 +117,13 @@ files:
|
|
115
117
|
- docs/PayoutItem.md
|
116
118
|
- docs/PayoutItemInputs.md
|
117
119
|
- docs/PayoutsApi.md
|
120
|
+
- docs/RskBalance.md
|
118
121
|
- docs/ValidateCheckoutRequest.md
|
119
122
|
- docs/ValidateCheckoutResponse.md
|
120
123
|
- docs/WalletBalance.md
|
124
|
+
- hc_create.rb
|
125
|
+
- hc_list.rb
|
126
|
+
- hc_validate.rb
|
121
127
|
- lib/bleumi_pay_sdk_ruby.rb
|
122
128
|
- lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb
|
123
129
|
- lib/bleumi_pay_sdk_ruby/api/payments_api.rb
|
@@ -155,10 +161,20 @@ files:
|
|
155
161
|
- lib/bleumi_pay_sdk_ruby/models/payout.rb
|
156
162
|
- lib/bleumi_pay_sdk_ruby/models/payout_item.rb
|
157
163
|
- lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb
|
164
|
+
- lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb
|
158
165
|
- lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb
|
159
166
|
- lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb
|
160
167
|
- lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb
|
161
168
|
- lib/bleumi_pay_sdk_ruby/version.rb
|
169
|
+
- po_create.rb
|
170
|
+
- po_list.rb
|
171
|
+
- py_create.rb
|
172
|
+
- py_get.rb
|
173
|
+
- py_getop.rb
|
174
|
+
- py_list.rb
|
175
|
+
- py_listops.rb
|
176
|
+
- py_refund.rb
|
177
|
+
- py_settle.rb
|
162
178
|
- spec/api/hosted_checkouts_api_spec.rb
|
163
179
|
- spec/api/payments_api_spec.rb
|
164
180
|
- spec/api/payouts_api_spec.rb
|
@@ -193,6 +209,7 @@ files:
|
|
193
209
|
- spec/models/payout_item_inputs_spec.rb
|
194
210
|
- spec/models/payout_item_spec.rb
|
195
211
|
- spec/models/payout_spec.rb
|
212
|
+
- spec/models/rsk_balance_spec.rb
|
196
213
|
- spec/models/validate_checkout_request_spec.rb
|
197
214
|
- spec/models/validate_checkout_response_spec.rb
|
198
215
|
- spec/models/wallet_balance_spec.rb
|
@@ -237,6 +254,7 @@ test_files:
|
|
237
254
|
- spec/models/payout_item_inputs_spec.rb
|
238
255
|
- spec/models/payment_operation_spec.rb
|
239
256
|
- spec/models/algorand_balance_spec.rb
|
257
|
+
- spec/models/rsk_balance_spec.rb
|
240
258
|
- spec/models/ethereum_balance_spec.rb
|
241
259
|
- spec/models/ethereum_wallet_inputs_spec.rb
|
242
260
|
- spec/models/wallet_balance_spec.rb
|