bleumi_pay_sdk_ruby 1.0.7 → 1.0.8
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 +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
data/docs/RskAddress.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# BleumiPay::RskAddress
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**rsk** <br> (Optional)| [**Hash<String, EthereumWalletAddress>**](EthereumWalletAddress.md) | A dictionary which gives the address of the wallet generated for Rsk MainNet |
|
8
|
+
**rsk_testnet** <br> (Optional)| [**Hash<String, EthereumWalletAddress>**](EthereumWalletAddress.md) | A dictionary which gives the address of the wallet generated for Rsk TestNet |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```json
|
13
|
+
{
|
14
|
+
"rsk": {
|
15
|
+
"rsk_testnet": {
|
16
|
+
"0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41|0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41": {
|
17
|
+
"inputs": {
|
18
|
+
"salt": "0x5d5fe1e5024cb6e9175da30a963919054db612f2f857cbfe3151747e96267f58",
|
19
|
+
"walletProxy": "0xe5f208073c717c076271b695324112779c6f8820",
|
20
|
+
"walletLibrary": "0x8cdf9b11ad8db65f94197d21d25fbff107cd02de",
|
21
|
+
"buyer": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41",
|
22
|
+
"merchant": "0x5db2d6542d55b2aec1f10d0c0df3b0169bf41e41"
|
23
|
+
},
|
24
|
+
"addr": "0xbe17b427aad1a29bff91e1e85d8324bc34b033b0"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
```
|
@@ -13,9 +13,9 @@ Name | Type | Description | Notes
|
|
13
13
|
|
14
14
|
```json
|
15
15
|
{
|
16
|
-
"hmac_input": "
|
16
|
+
"hmac_input": "rsk_testnet|0xbed61c55cc290b55c1c4c327148bdede56a831f4|0xb9f624160bb2755aa25366cc307ed27e39a4f296|10|0|0x16e54beb3ea4b4206b62ca32b1d2cf4ad15d9af2234564c2166ff3ccc817d5c1",
|
17
17
|
"hmac_keyId": "v1",
|
18
18
|
"hmac_alg": "HMAC-SHA256-HEX",
|
19
|
-
"hmac_value": "
|
19
|
+
"hmac_value": "c782cbad4394383599b7cf9f9d62990f289649b35edd82cd1c7d58dd65e9fc03"
|
20
20
|
}
|
21
21
|
```
|
data/lib/bleumi_pay_sdk_ruby.rb
CHANGED
@@ -17,6 +17,7 @@ require 'bleumi_pay_sdk_ruby/version'
|
|
17
17
|
require 'bleumi_pay_sdk_ruby/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
+
require 'bleumi_pay_sdk_ruby/models/algorand_address'
|
20
21
|
require 'bleumi_pay_sdk_ruby/models/algorand_balance'
|
21
22
|
require 'bleumi_pay_sdk_ruby/models/algorand_wallet_address'
|
22
23
|
require 'bleumi_pay_sdk_ruby/models/algorand_wallet_inputs'
|
@@ -25,10 +26,9 @@ require 'bleumi_pay_sdk_ruby/models/chain'
|
|
25
26
|
require 'bleumi_pay_sdk_ruby/models/checkout_token'
|
26
27
|
require 'bleumi_pay_sdk_ruby/models/create_checkout_url_request'
|
27
28
|
require 'bleumi_pay_sdk_ruby/models/create_checkout_url_response'
|
28
|
-
require 'bleumi_pay_sdk_ruby/models/create_payment_request'
|
29
|
-
require 'bleumi_pay_sdk_ruby/models/create_payment_response'
|
30
29
|
require 'bleumi_pay_sdk_ruby/models/create_payout_request'
|
31
30
|
require 'bleumi_pay_sdk_ruby/models/create_payout_response'
|
31
|
+
require 'bleumi_pay_sdk_ruby/models/ethereum_address'
|
32
32
|
require 'bleumi_pay_sdk_ruby/models/ethereum_balance'
|
33
33
|
require 'bleumi_pay_sdk_ruby/models/ethereum_wallet_address'
|
34
34
|
require 'bleumi_pay_sdk_ruby/models/ethereum_wallet_inputs'
|
@@ -46,6 +46,7 @@ require 'bleumi_pay_sdk_ruby/models/payment_settle_request'
|
|
46
46
|
require 'bleumi_pay_sdk_ruby/models/payout'
|
47
47
|
require 'bleumi_pay_sdk_ruby/models/payout_item'
|
48
48
|
require 'bleumi_pay_sdk_ruby/models/payout_item_inputs'
|
49
|
+
require 'bleumi_pay_sdk_ruby/models/rsk_address'
|
49
50
|
require 'bleumi_pay_sdk_ruby/models/rsk_balance'
|
50
51
|
require 'bleumi_pay_sdk_ruby/models/validate_checkout_request'
|
51
52
|
require 'bleumi_pay_sdk_ruby/models/validate_checkout_response'
|
@@ -21,79 +21,6 @@ module BleumiPay
|
|
21
21
|
@api_client = api_client
|
22
22
|
@request_validator = request_validator
|
23
23
|
end
|
24
|
-
# Generate a unique wallet address in the specified network to accept payment
|
25
|
-
# @param create_payment_request [CreatePaymentRequest]
|
26
|
-
# @param [Hash] opts the optional parameters
|
27
|
-
# @option opts [Chain] :chain Network in which payment is to be created. Please refer documentation for Supported Networks
|
28
|
-
# @return [CreatePaymentResponse]
|
29
|
-
def create_payment(create_payment_request, opts = {})
|
30
|
-
data, _status_code, _headers = create_payment_with_http_info(create_payment_request, opts)
|
31
|
-
data
|
32
|
-
end
|
33
|
-
|
34
|
-
# Generate a unique wallet address in the specified network to accept payment
|
35
|
-
# @param create_payment_request [CreatePaymentRequest]
|
36
|
-
# @param [Hash] opts the optional parameters
|
37
|
-
# @option opts [Chain] :chain Network in which payment is to be created. Please refer documentation for Supported Networks
|
38
|
-
# @return [Array<(CreatePaymentResponse, Integer, Hash)>] CreatePaymentResponse data, response status code and response headers
|
39
|
-
def create_payment_with_http_info(create_payment_request, opts = {})
|
40
|
-
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
|
42
|
-
end
|
43
|
-
# verify the required parameter 'create_payment_request' is set
|
44
|
-
if @api_client.config.client_side_validation && create_payment_request.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'create_payment_request' when calling PaymentsApi.create_payment"
|
46
|
-
end
|
47
|
-
|
48
|
-
# verify the values in the request body are valid
|
49
|
-
chain = opts[:'chain'] if !opts[:'chain'].nil?
|
50
|
-
msg = @request_validator.validate_create_payment_request(create_payment_request, chain)
|
51
|
-
if (@request_validator.is_not_empty(msg))
|
52
|
-
fail ArgumentError, "`#{msg}` when calling PaymentsApi.create_payment"
|
53
|
-
end
|
54
|
-
|
55
|
-
# resource path
|
56
|
-
local_var_path = '/v1/payment'
|
57
|
-
|
58
|
-
# query parameters
|
59
|
-
query_params = opts[:query_params] || {}
|
60
|
-
query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
|
61
|
-
|
62
|
-
# header parameters
|
63
|
-
header_params = opts[:header_params] || {}
|
64
|
-
# HTTP header 'Accept' (if needed)
|
65
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
66
|
-
# HTTP header 'Content-Type'
|
67
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
68
|
-
|
69
|
-
# form parameters
|
70
|
-
form_params = opts[:form_params] || {}
|
71
|
-
|
72
|
-
# http body (model)
|
73
|
-
post_body = opts[:body] || @api_client.object_to_http_body(create_payment_request)
|
74
|
-
|
75
|
-
# return_type
|
76
|
-
return_type = opts[:return_type] || 'CreatePaymentResponse'
|
77
|
-
|
78
|
-
# auth_names
|
79
|
-
auth_names = opts[:auth_names] || ['ApiKeyAuth']
|
80
|
-
|
81
|
-
new_options = opts.merge(
|
82
|
-
:header_params => header_params,
|
83
|
-
:query_params => query_params,
|
84
|
-
:form_params => form_params,
|
85
|
-
:body => post_body,
|
86
|
-
:auth_names => auth_names,
|
87
|
-
:return_type => return_type
|
88
|
-
)
|
89
|
-
|
90
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
91
|
-
if @api_client.config.debugging
|
92
|
-
@api_client.config.logger.debug "API called: PaymentsApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
-
end
|
94
|
-
return data, status_code, headers
|
95
|
-
end
|
96
|
-
|
97
24
|
# Retrieve the wallet addresses & token balances for a given payment
|
98
25
|
# @param id [String] Unique identifier of the payment (specified during createPayment) to retrieve
|
99
26
|
# @param [Hash] opts the optional parameters
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay API
|
2
|
+
#Bleumi Pay REST API
|
3
3
|
|
4
|
-
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand 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
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Bleumi Pay API
|
2
|
+
#Bleumi Pay REST API
|
3
3
|
|
4
|
-
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
|
5
5
|
|
6
6
|
Contact: info@bleumi.com
|
7
7
|
|
@@ -100,33 +100,6 @@ module BleumiPay
|
|
100
100
|
return nil
|
101
101
|
end
|
102
102
|
|
103
|
-
def validate_create_payment_request(params, chain)
|
104
|
-
# check if chain is provided
|
105
|
-
msg = check_req_param("Chain", chain)
|
106
|
-
if is_not_empty(msg) then
|
107
|
-
return msg
|
108
|
-
end
|
109
|
-
# check if buyer_address is valid address in the network
|
110
|
-
msg = check_network_addr("BuyerAddress", params.buyer_address, chain, mandatory=true, is_token=false)
|
111
|
-
if is_not_empty(msg) then
|
112
|
-
return msg
|
113
|
-
end
|
114
|
-
# check if transfer_address is valid address in the network
|
115
|
-
msg = check_network_addr("TransferAddress", params.transfer_address, chain, mandatory=true, is_token=false)
|
116
|
-
if is_not_empty(msg) then
|
117
|
-
return msg
|
118
|
-
end
|
119
|
-
|
120
|
-
# check if token is valid address in the network (if provided)
|
121
|
-
if is_not_empty(params.token) then
|
122
|
-
msg = check_network_addr("Token", params.token, chain, mandatory=false, is_token=true)
|
123
|
-
if is_not_empty(msg) then
|
124
|
-
return msg
|
125
|
-
end
|
126
|
-
end
|
127
|
-
return nil
|
128
|
-
end
|
129
|
-
|
130
103
|
def validate_refund_payment_request(params, chain)
|
131
104
|
# check if chain is provided
|
132
105
|
msg = check_req_param("Chain", chain)
|
@@ -206,9 +179,9 @@ module BleumiPay
|
|
206
179
|
return msg
|
207
180
|
end
|
208
181
|
|
209
|
-
# check if
|
210
|
-
if is_not_empty(params.
|
211
|
-
msg = check_network_addr("
|
182
|
+
# check if transfer_address is valid address in the network (if provided)
|
183
|
+
if is_not_empty(params.transfer_address) then
|
184
|
+
msg = check_network_addr("TransferAddress", params.transfer_address, params.chain, mandatory=false, is_token=false)
|
212
185
|
if is_not_empty(msg) then
|
213
186
|
return msg
|
214
187
|
end
|
@@ -0,0 +1,219 @@
|
|
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 'date'
|
14
|
+
|
15
|
+
module BleumiPay
|
16
|
+
class AlgorandAddress
|
17
|
+
attr_accessor :alg_mainnet
|
18
|
+
|
19
|
+
attr_accessor :alg_testnet
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'alg_mainnet' => :'alg_mainnet',
|
25
|
+
:'alg_testnet' => :'alg_testnet'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.openapi_types
|
31
|
+
{
|
32
|
+
:'alg_mainnet' => :'Hash<String, AlgorandWalletAddress>',
|
33
|
+
:'alg_testnet' => :'Hash<String, AlgorandWalletAddress>'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
# Initializes the object
|
44
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
45
|
+
def initialize(attributes = {})
|
46
|
+
if (!attributes.is_a?(Hash))
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::AlgorandAddress` initialize method"
|
48
|
+
end
|
49
|
+
|
50
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::AlgorandAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
h[k.to_sym] = v
|
56
|
+
}
|
57
|
+
|
58
|
+
if attributes.key?(:'alg_mainnet')
|
59
|
+
if (value = attributes[:'alg_mainnet']).is_a?(Hash)
|
60
|
+
self.alg_mainnet = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'alg_testnet')
|
65
|
+
if (value = attributes[:'alg_testnet']).is_a?(Hash)
|
66
|
+
self.alg_testnet = value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
+
# @return Array for valid properties with the reasons
|
73
|
+
def list_invalid_properties
|
74
|
+
invalid_properties = Array.new
|
75
|
+
invalid_properties
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
alg_mainnet == o.alg_mainnet &&
|
90
|
+
alg_testnet == o.alg_testnet
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Integer] Hash code
|
101
|
+
def hash
|
102
|
+
[alg_mainnet, alg_testnet].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def self.build_from_hash(attributes)
|
109
|
+
new.build_from_hash(attributes)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Builds the object from hash
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @return [Object] Returns the model itself
|
115
|
+
def build_from_hash(attributes)
|
116
|
+
return nil unless attributes.is_a?(Hash)
|
117
|
+
self.class.openapi_types.each_pair do |key, type|
|
118
|
+
if type =~ /\AArray<(.*)>/i
|
119
|
+
# check to ensure the input is an array given that the attribute
|
120
|
+
# is documented as an array but the input is not
|
121
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
122
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
123
|
+
end
|
124
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
125
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
126
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
127
|
+
end
|
128
|
+
|
129
|
+
self
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def _deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :DateTime
|
139
|
+
DateTime.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -29,8 +29,8 @@ module BleumiPay
|
|
29
29
|
# Buyer will be redirected to this URL upon successfully completing the payment.
|
30
30
|
attr_accessor :success_url
|
31
31
|
|
32
|
-
#
|
33
|
-
attr_accessor :
|
32
|
+
# Payment transfer address (only used in case of Marketplace payments). Use this field to override the token's settlement address specified in the Bleumi Pay Dashboard for the payment.
|
33
|
+
attr_accessor :transfer_address
|
34
34
|
|
35
35
|
# (Required if specifying 'token') Network in which the hosted checkout is to be created. Please refer to the Supported Networks.
|
36
36
|
attr_accessor :chain
|
@@ -49,7 +49,7 @@ module BleumiPay
|
|
49
49
|
:'amount' => :'amount',
|
50
50
|
:'cancel_url' => :'cancelUrl',
|
51
51
|
:'success_url' => :'successUrl',
|
52
|
-
:'
|
52
|
+
:'transfer_address' => :'transferAddress',
|
53
53
|
:'chain' => :'chain',
|
54
54
|
:'token' => :'token',
|
55
55
|
:'base64_transform' => :'base64Transform'
|
@@ -64,7 +64,7 @@ module BleumiPay
|
|
64
64
|
:'amount' => :'String',
|
65
65
|
:'cancel_url' => :'String',
|
66
66
|
:'success_url' => :'String',
|
67
|
-
:'
|
67
|
+
:'transfer_address' => :'String',
|
68
68
|
:'chain' => :'String',
|
69
69
|
:'token' => :'String',
|
70
70
|
:'base64_transform' => :'Boolean'
|
@@ -112,8 +112,8 @@ module BleumiPay
|
|
112
112
|
self.success_url = attributes[:'success_url']
|
113
113
|
end
|
114
114
|
|
115
|
-
if attributes.key?(:'
|
116
|
-
self.
|
115
|
+
if attributes.key?(:'transfer_address')
|
116
|
+
self.transfer_address = attributes[:'transfer_address']
|
117
117
|
end
|
118
118
|
|
119
119
|
if attributes.key?(:'chain')
|
@@ -177,7 +177,7 @@ module BleumiPay
|
|
177
177
|
amount == o.amount &&
|
178
178
|
cancel_url == o.cancel_url &&
|
179
179
|
success_url == o.success_url &&
|
180
|
-
|
180
|
+
transfer_address == o.transfer_address &&
|
181
181
|
chain == o.chain &&
|
182
182
|
token == o.token &&
|
183
183
|
base64_transform == o.base64_transform
|
@@ -192,7 +192,7 @@ module BleumiPay
|
|
192
192
|
# Calculates hash code according to all attributes.
|
193
193
|
# @return [Integer] Hash code
|
194
194
|
def hash
|
195
|
-
[id, currency, amount, cancel_url, success_url,
|
195
|
+
[id, currency, amount, cancel_url, success_url, transfer_address, chain, token, base64_transform].hash
|
196
196
|
end
|
197
197
|
|
198
198
|
# Builds the object from hash
|