bleumi_pay_sdk_ruby 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/assets/images/BleumiPay.png +0 -0
- data/docs/AlgorandAddress.md +28 -0
- data/docs/CreateCheckoutUrlRequest.md +3 -2
- data/docs/EthereumAddress.md +29 -0
- data/docs/HostedCheckoutsApi.md +4 -3
- data/docs/PaginatedPayments.md +59 -55
- data/docs/Payment.md +18 -35
- data/docs/PaymentAddresses.md +35 -12
- data/docs/PaymentBalances.md +28 -13
- data/docs/RskAddress.md +29 -0
- data/docs/ValidateCheckoutRequest.md +2 -2
- data/lib/bleumi_pay_sdk_ruby.rb +3 -2
- data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +0 -73
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +5 -32
- data/lib/bleumi_pay_sdk_ruby/models/algorand_address.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +8 -8
- data/lib/bleumi_pay_sdk_ruby/models/{create_payment_request.rb → ethereum_address.rb} +38 -49
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +6 -12
- data/lib/bleumi_pay_sdk_ruby/models/{create_payment_response.rb → rsk_address.rb} +25 -18
- data/lib/bleumi_pay_sdk_ruby/version.rb +1 -1
- data/spec/api/payments_api_spec.rb +0 -12
- data/spec/models/algorand_address_spec.rb +47 -0
- data/spec/models/create_checkout_url_request_spec.rb +1 -1
- data/spec/models/{create_payment_request_spec.rb → ethereum_address_spec.rb} +10 -10
- data/spec/models/{create_payment_response_spec.rb → rsk_address_spec.rb} +13 -7
- metadata +15 -22
- data/docs/CreatePaymentRequest.md +0 -19
- data/docs/CreatePaymentResponse.md +0 -15
- data/hc_create.rb +0 -40
- data/hc_list.rb +0 -17
- data/hc_validate.rb +0 -22
- data/po_create.rb +0 -39
- data/po_list.rb +0 -23
- data/py_create.rb +0 -48
- data/py_get.rb +0 -18
- data/py_getop.rb +0 -19
- data/py_list.rb +0 -24
- data/py_listops.rb +0 -21
- data/py_refund.rb +0 -43
- data/py_settle.rb +0 -43
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay
|
2
|
+
#Bleumi Pay API
|
3
3
|
|
4
|
-
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: info@bleumi.com
|
@@ -13,36 +13,32 @@ OpenAPI Generator version: 4.2.2
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module BleumiPay
|
16
|
-
class
|
17
|
-
|
18
|
-
attr_accessor :id
|
16
|
+
class EthereumAddress
|
17
|
+
attr_accessor :mainnet
|
19
18
|
|
20
|
-
|
21
|
-
attr_accessor :token
|
19
|
+
attr_accessor :goerli
|
22
20
|
|
23
|
-
|
24
|
-
attr_accessor :buyer_address
|
21
|
+
attr_accessor :xdai
|
25
22
|
|
26
|
-
|
27
|
-
attr_accessor :transfer_address
|
23
|
+
attr_accessor :xdai_testnet
|
28
24
|
|
29
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
26
|
def self.attribute_map
|
31
27
|
{
|
32
|
-
:'
|
33
|
-
:'
|
34
|
-
:'
|
35
|
-
:'
|
28
|
+
:'mainnet' => :'mainnet',
|
29
|
+
:'goerli' => :'goerli',
|
30
|
+
:'xdai' => :'xdai',
|
31
|
+
:'xdai_testnet' => :'xdai_testnet'
|
36
32
|
}
|
37
33
|
end
|
38
34
|
|
39
35
|
# Attribute type mapping.
|
40
36
|
def self.openapi_types
|
41
37
|
{
|
42
|
-
:'
|
43
|
-
:'
|
44
|
-
:'
|
45
|
-
:'
|
38
|
+
:'mainnet' => :'Hash<String, EthereumWalletAddress>',
|
39
|
+
:'goerli' => :'Hash<String, EthereumWalletAddress>',
|
40
|
+
:'xdai' => :'Hash<String, EthereumWalletAddress>',
|
41
|
+
:'xdai_testnet' => :'Hash<String, EthereumWalletAddress>'
|
46
42
|
}
|
47
43
|
end
|
48
44
|
|
@@ -56,31 +52,39 @@ module BleumiPay
|
|
56
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
57
53
|
def initialize(attributes = {})
|
58
54
|
if (!attributes.is_a?(Hash))
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::EthereumAddress` initialize method"
|
60
56
|
end
|
61
57
|
|
62
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
63
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
60
|
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::EthereumAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
62
|
end
|
67
63
|
h[k.to_sym] = v
|
68
64
|
}
|
69
65
|
|
70
|
-
if attributes.key?(:'
|
71
|
-
|
66
|
+
if attributes.key?(:'mainnet')
|
67
|
+
if (value = attributes[:'mainnet']).is_a?(Hash)
|
68
|
+
self.mainnet = value
|
69
|
+
end
|
72
70
|
end
|
73
71
|
|
74
|
-
if attributes.key?(:'
|
75
|
-
|
72
|
+
if attributes.key?(:'goerli')
|
73
|
+
if (value = attributes[:'goerli']).is_a?(Hash)
|
74
|
+
self.goerli = value
|
75
|
+
end
|
76
76
|
end
|
77
77
|
|
78
|
-
if attributes.key?(:'
|
79
|
-
|
78
|
+
if attributes.key?(:'xdai')
|
79
|
+
if (value = attributes[:'xdai']).is_a?(Hash)
|
80
|
+
self.xdai = value
|
81
|
+
end
|
80
82
|
end
|
81
83
|
|
82
|
-
if attributes.key?(:'
|
83
|
-
|
84
|
+
if attributes.key?(:'xdai_testnet')
|
85
|
+
if (value = attributes[:'xdai_testnet']).is_a?(Hash)
|
86
|
+
self.xdai_testnet = value
|
87
|
+
end
|
84
88
|
end
|
85
89
|
end
|
86
90
|
|
@@ -88,27 +92,12 @@ module BleumiPay
|
|
88
92
|
# @return Array for valid properties with the reasons
|
89
93
|
def list_invalid_properties
|
90
94
|
invalid_properties = Array.new
|
91
|
-
if @id.nil?
|
92
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
93
|
-
end
|
94
|
-
|
95
|
-
if @buyer_address.nil?
|
96
|
-
invalid_properties.push('invalid value for "buyer_address", buyer_address cannot be nil.')
|
97
|
-
end
|
98
|
-
|
99
|
-
if @transfer_address.nil?
|
100
|
-
invalid_properties.push('invalid value for "transfer_address", transfer_address cannot be nil.')
|
101
|
-
end
|
102
|
-
|
103
95
|
invalid_properties
|
104
96
|
end
|
105
97
|
|
106
98
|
# Check to see if the all the properties in the model are valid
|
107
99
|
# @return true if the model is valid
|
108
100
|
def valid?
|
109
|
-
return false if @id.nil?
|
110
|
-
return false if @buyer_address.nil?
|
111
|
-
return false if @transfer_address.nil?
|
112
101
|
true
|
113
102
|
end
|
114
103
|
|
@@ -117,10 +106,10 @@ module BleumiPay
|
|
117
106
|
def ==(o)
|
118
107
|
return true if self.equal?(o)
|
119
108
|
self.class == o.class &&
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
109
|
+
mainnet == o.mainnet &&
|
110
|
+
goerli == o.goerli &&
|
111
|
+
xdai == o.xdai &&
|
112
|
+
xdai_testnet == o.xdai_testnet
|
124
113
|
end
|
125
114
|
|
126
115
|
# @see the `==` method
|
@@ -132,7 +121,7 @@ module BleumiPay
|
|
132
121
|
# Calculates hash code according to all attributes.
|
133
122
|
# @return [Integer] Hash code
|
134
123
|
def hash
|
135
|
-
[
|
124
|
+
[mainnet, goerli, xdai, xdai_testnet].hash
|
136
125
|
end
|
137
126
|
|
138
127
|
# Builds the object from hash
|
@@ -33,9 +33,9 @@ module BleumiPay
|
|
33
33
|
# Attribute type mapping.
|
34
34
|
def self.openapi_types
|
35
35
|
{
|
36
|
-
:'ethereum' => :'
|
37
|
-
:'algorand' => :'
|
38
|
-
:'rsk' => :'
|
36
|
+
:'ethereum' => :'EthereumAddress',
|
37
|
+
:'algorand' => :'AlgorandAddress',
|
38
|
+
:'rsk' => :'RskAddress'
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
@@ -61,21 +61,15 @@ module BleumiPay
|
|
61
61
|
}
|
62
62
|
|
63
63
|
if attributes.key?(:'ethereum')
|
64
|
-
|
65
|
-
self.ethereum = value
|
66
|
-
end
|
64
|
+
self.ethereum = attributes[:'ethereum']
|
67
65
|
end
|
68
66
|
|
69
67
|
if attributes.key?(:'algorand')
|
70
|
-
|
71
|
-
self.algorand = value
|
72
|
-
end
|
68
|
+
self.algorand = attributes[:'algorand']
|
73
69
|
end
|
74
70
|
|
75
71
|
if attributes.key?(:'rsk')
|
76
|
-
|
77
|
-
self.rsk = value
|
78
|
-
end
|
72
|
+
self.rsk = attributes[:'rsk']
|
79
73
|
end
|
80
74
|
end
|
81
75
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay
|
2
|
+
#Bleumi Pay API
|
3
3
|
|
4
|
-
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: info@bleumi.com
|
@@ -13,21 +13,24 @@ OpenAPI Generator version: 4.2.2
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module BleumiPay
|
16
|
-
class
|
17
|
-
|
18
|
-
|
16
|
+
class RskAddress
|
17
|
+
attr_accessor :rsk
|
18
|
+
|
19
|
+
attr_accessor :rsk_testnet
|
19
20
|
|
20
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
21
22
|
def self.attribute_map
|
22
23
|
{
|
23
|
-
:'
|
24
|
+
:'rsk' => :'rsk',
|
25
|
+
:'rsk_testnet' => :'rsk_testnet'
|
24
26
|
}
|
25
27
|
end
|
26
28
|
|
27
29
|
# Attribute type mapping.
|
28
30
|
def self.openapi_types
|
29
31
|
{
|
30
|
-
:'
|
32
|
+
:'rsk' => :'Hash<String, EthereumWalletAddress>',
|
33
|
+
:'rsk_testnet' => :'Hash<String, EthereumWalletAddress>'
|
31
34
|
}
|
32
35
|
end
|
33
36
|
|
@@ -41,19 +44,27 @@ module BleumiPay
|
|
41
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
42
45
|
def initialize(attributes = {})
|
43
46
|
if (!attributes.is_a?(Hash))
|
44
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::RskAddress` initialize method"
|
45
48
|
end
|
46
49
|
|
47
50
|
# check to see if the attribute exists and convert string to symbol for hash key
|
48
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::RskAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
54
|
end
|
52
55
|
h[k.to_sym] = v
|
53
56
|
}
|
54
57
|
|
55
|
-
if attributes.key?(:'
|
56
|
-
|
58
|
+
if attributes.key?(:'rsk')
|
59
|
+
if (value = attributes[:'rsk']).is_a?(Hash)
|
60
|
+
self.rsk = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'rsk_testnet')
|
65
|
+
if (value = attributes[:'rsk_testnet']).is_a?(Hash)
|
66
|
+
self.rsk_testnet = value
|
67
|
+
end
|
57
68
|
end
|
58
69
|
end
|
59
70
|
|
@@ -61,17 +72,12 @@ module BleumiPay
|
|
61
72
|
# @return Array for valid properties with the reasons
|
62
73
|
def list_invalid_properties
|
63
74
|
invalid_properties = Array.new
|
64
|
-
if @addr.nil?
|
65
|
-
invalid_properties.push('invalid value for "addr", addr cannot be nil.')
|
66
|
-
end
|
67
|
-
|
68
75
|
invalid_properties
|
69
76
|
end
|
70
77
|
|
71
78
|
# Check to see if the all the properties in the model are valid
|
72
79
|
# @return true if the model is valid
|
73
80
|
def valid?
|
74
|
-
return false if @addr.nil?
|
75
81
|
true
|
76
82
|
end
|
77
83
|
|
@@ -80,7 +86,8 @@ module BleumiPay
|
|
80
86
|
def ==(o)
|
81
87
|
return true if self.equal?(o)
|
82
88
|
self.class == o.class &&
|
83
|
-
|
89
|
+
rsk == o.rsk &&
|
90
|
+
rsk_testnet == o.rsk_testnet
|
84
91
|
end
|
85
92
|
|
86
93
|
# @see the `==` method
|
@@ -92,7 +99,7 @@ module BleumiPay
|
|
92
99
|
# Calculates hash code according to all attributes.
|
93
100
|
# @return [Integer] Hash code
|
94
101
|
def hash
|
95
|
-
[
|
102
|
+
[rsk, rsk_testnet].hash
|
96
103
|
end
|
97
104
|
|
98
105
|
# Builds the object from hash
|
@@ -32,18 +32,6 @@ describe 'PaymentsApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# unit tests for create_payment
|
36
|
-
# Generate a unique wallet address in the specified network to accept payment
|
37
|
-
# @param create_payment_request
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @option opts [Chain] :chain Network in which payment is to be created. Please refer documentation for Supported Networks
|
40
|
-
# @return [CreatePaymentResponse]
|
41
|
-
describe 'create_payment test' 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
35
|
# unit tests for get_payment
|
48
36
|
# Retrieve the wallet addresses & token balances for a given payment
|
49
37
|
# @param id Unique identifier of the payment (specified during createPayment) to retrieve
|
@@ -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::AlgorandAddress
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'AlgorandAddress' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = BleumiPay::AlgorandAddress.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of AlgorandAddress' do
|
31
|
+
it 'should create an instance of AlgorandAddress' do
|
32
|
+
expect(@instance).to be_instance_of(BleumiPay::AlgorandAddress)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "alg_mainnet"' 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 "alg_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
|
@@ -62,7 +62,7 @@ describe 'CreateCheckoutUrlRequest' do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
describe 'test attribute "
|
65
|
+
describe 'test attribute "transfer_address"' do
|
66
66
|
it 'should work' do
|
67
67
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
68
68
|
end
|
@@ -14,43 +14,43 @@ require 'spec_helper'
|
|
14
14
|
require 'json'
|
15
15
|
require 'date'
|
16
16
|
|
17
|
-
# Unit tests for BleumiPay::
|
17
|
+
# Unit tests for BleumiPay::EthereumAddress
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
19
|
# Please update as you see appropriate
|
20
|
-
describe '
|
20
|
+
describe 'EthereumAddress' do
|
21
21
|
before do
|
22
22
|
# run before each test
|
23
|
-
@instance = BleumiPay::
|
23
|
+
@instance = BleumiPay::EthereumAddress.new
|
24
24
|
end
|
25
25
|
|
26
26
|
after do
|
27
27
|
# run after each test
|
28
28
|
end
|
29
29
|
|
30
|
-
describe 'test an instance of
|
31
|
-
it 'should create an instance of
|
32
|
-
expect(@instance).to be_instance_of(BleumiPay::
|
30
|
+
describe 'test an instance of EthereumAddress' do
|
31
|
+
it 'should create an instance of EthereumAddress' do
|
32
|
+
expect(@instance).to be_instance_of(BleumiPay::EthereumAddress)
|
33
33
|
end
|
34
34
|
end
|
35
|
-
describe 'test attribute "
|
35
|
+
describe 'test attribute "mainnet"' do
|
36
36
|
it 'should work' do
|
37
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
describe 'test attribute "
|
41
|
+
describe 'test attribute "goerli"' do
|
42
42
|
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
describe 'test attribute "
|
47
|
+
describe 'test attribute "xdai"' do
|
48
48
|
it 'should work' do
|
49
49
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
describe 'test attribute "
|
53
|
+
describe 'test attribute "xdai_testnet"' do
|
54
54
|
it 'should work' do
|
55
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
56
|
end
|
@@ -14,25 +14,31 @@ require 'spec_helper'
|
|
14
14
|
require 'json'
|
15
15
|
require 'date'
|
16
16
|
|
17
|
-
# Unit tests for BleumiPay::
|
17
|
+
# Unit tests for BleumiPay::RskAddress
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
19
|
# Please update as you see appropriate
|
20
|
-
describe '
|
20
|
+
describe 'RskAddress' do
|
21
21
|
before do
|
22
22
|
# run before each test
|
23
|
-
@instance = BleumiPay::
|
23
|
+
@instance = BleumiPay::RskAddress.new
|
24
24
|
end
|
25
25
|
|
26
26
|
after do
|
27
27
|
# run after each test
|
28
28
|
end
|
29
29
|
|
30
|
-
describe 'test an instance of
|
31
|
-
it 'should create an instance of
|
32
|
-
expect(@instance).to be_instance_of(BleumiPay::
|
30
|
+
describe 'test an instance of RskAddress' do
|
31
|
+
it 'should create an instance of RskAddress' do
|
32
|
+
expect(@instance).to be_instance_of(BleumiPay::RskAddress)
|
33
33
|
end
|
34
34
|
end
|
35
|
-
describe 'test attribute "
|
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
|
36
42
|
it 'should work' do
|
37
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
44
|
end
|