transferzero-sdk 1.18.0 → 1.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +19 -16
- data/README.md +12 -4
- data/docs/Document.md +2 -0
- data/docs/PayinMethod.md +12 -4
- data/docs/PayinMethodDetails.md +7 -5
- data/docs/PayinMethodDetailsMobile.md +5 -3
- data/docs/PayinMethodDetailsNGNBank.md +2 -2
- data/docs/PayinMethodResponse.md +17 -0
- data/docs/PayinMethodState.md +16 -0
- data/docs/PayinMethodUxFlow.md +16 -0
- data/docs/PayinMethodsApi.md +257 -0
- data/docs/PayoutMethodDetails.md +1 -1
- data/docs/PayoutMethodDetailsXOFCash.md +1 -1
- data/docs/RecipientStateReasonDetails.md +3 -3
- data/docs/Sender.md +2 -0
- data/docs/StateReasonDetails.md +23 -0
- data/lib/transferzero-sdk/api/payin_methods_api.rb +247 -0
- data/lib/transferzero-sdk/api_client.rb +1 -1
- data/lib/transferzero-sdk/models/document.rb +11 -1
- data/lib/transferzero-sdk/models/payin_method.rb +47 -9
- data/lib/transferzero-sdk/models/payin_method_details.rb +19 -15
- data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +18 -14
- data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payin_method_response.rb +202 -0
- data/lib/transferzero-sdk/models/payin_method_state.rb +39 -0
- data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +36 -0
- data/lib/transferzero-sdk/models/payout_method_details.rb +5 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +6 -1
- data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +21 -2
- data/lib/transferzero-sdk/models/sender.rb +11 -1
- data/lib/transferzero-sdk/models/state_reason_details.rb +235 -0
- data/lib/transferzero-sdk/version.rb +1 -1
- data/lib/transferzero-sdk.rb +5 -0
- data/spec/api/payin_methods_api_spec.rb +84 -0
- data/spec/models/payin_method_response_spec.rb +41 -0
- data/spec/models/payin_method_state_spec.rb +35 -0
- data/spec/models/payin_method_ux_flow_spec.rb +35 -0
- data/spec/models/state_reason_details_spec.rb +59 -0
- data/transferzero-sdk-1.19.0.gem +0 -0
- metadata +33 -13
- data/transferzero-sdk-1.16.1.gem +0 -0
@@ -0,0 +1,202 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class PayinMethodResponse
|
17
|
+
attr_accessor :object
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'object' => :'object'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'object' => :'PayinMethod'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
if (!attributes.is_a?(Hash))
|
37
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayinMethodResponse` initialize method"
|
38
|
+
end
|
39
|
+
|
40
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
42
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
43
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayinMethodResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
44
|
+
end
|
45
|
+
h[k.to_sym] = v
|
46
|
+
}
|
47
|
+
|
48
|
+
if attributes.key?(:'object')
|
49
|
+
self.object = attributes[:'object']
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
54
|
+
# @return Array for valid properties with the reasons
|
55
|
+
def list_invalid_properties
|
56
|
+
invalid_properties = Array.new
|
57
|
+
invalid_properties
|
58
|
+
end
|
59
|
+
|
60
|
+
# Check to see if the all the properties in the model are valid
|
61
|
+
# @return true if the model is valid
|
62
|
+
def valid?
|
63
|
+
true
|
64
|
+
end
|
65
|
+
|
66
|
+
# Checks equality by comparing each attribute.
|
67
|
+
# @param [Object] Object to be compared
|
68
|
+
def ==(o)
|
69
|
+
return true if self.equal?(o)
|
70
|
+
self.class == o.class &&
|
71
|
+
object == o.object
|
72
|
+
end
|
73
|
+
|
74
|
+
# @see the `==` method
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def eql?(o)
|
77
|
+
self == o
|
78
|
+
end
|
79
|
+
|
80
|
+
# Calculates hash code according to all attributes.
|
81
|
+
# @return [Integer] Hash code
|
82
|
+
def hash
|
83
|
+
[object].hash
|
84
|
+
end
|
85
|
+
|
86
|
+
require 'active_support/core_ext/hash'
|
87
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.openapi_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param string type Data type
|
110
|
+
# @param string value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :Boolean
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = TransferZero.const_get(type).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Returns the string representation of the object
|
151
|
+
# @return [String] String presentation of the object
|
152
|
+
def to_s
|
153
|
+
to_hash.to_s
|
154
|
+
end
|
155
|
+
|
156
|
+
# to_body is an alias to to_hash (backward compatibility)
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_body
|
159
|
+
to_hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_hash
|
165
|
+
hash = {}
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
167
|
+
value = self.send(attr)
|
168
|
+
next if value.nil?
|
169
|
+
hash[param] = _to_hash(value)
|
170
|
+
end
|
171
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
172
|
+
end
|
173
|
+
|
174
|
+
def [](key)
|
175
|
+
to_hash[key]
|
176
|
+
end
|
177
|
+
|
178
|
+
def dig(*args)
|
179
|
+
to_hash.dig(*args)
|
180
|
+
end
|
181
|
+
|
182
|
+
# Outputs non-array value in the form of hash
|
183
|
+
# For object, use to_hash. Otherwise, just return the value
|
184
|
+
# @param [Object] value Any valid value
|
185
|
+
# @return [Hash] Returns the value in the form of hash
|
186
|
+
def _to_hash(value)
|
187
|
+
if value.is_a?(Array)
|
188
|
+
value.compact.map { |v| _to_hash(v) }
|
189
|
+
elsif value.is_a?(Hash)
|
190
|
+
{}.tap do |hash|
|
191
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
192
|
+
end
|
193
|
+
elsif value.respond_to? :to_hash
|
194
|
+
value.to_hash
|
195
|
+
else
|
196
|
+
value
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class PayinMethodState
|
17
|
+
|
18
|
+
INCOMPLETE = "incomplete".freeze
|
19
|
+
INITIAL = "initial".freeze
|
20
|
+
PENDING = "pending".freeze
|
21
|
+
SUCCESS = "success".freeze
|
22
|
+
PROCESSING = "processing".freeze
|
23
|
+
ERROR = "error".freeze
|
24
|
+
MISPAID = "mispaid".freeze
|
25
|
+
CANCELED = "canceled".freeze
|
26
|
+
REFUNDED = "refunded".freeze
|
27
|
+
EXCEPTION = "exception".freeze
|
28
|
+
|
29
|
+
# Builds the enum from string
|
30
|
+
# @param [String] The enum value in the form of the string
|
31
|
+
# @return [String] The enum value
|
32
|
+
def build_from_hash(value)
|
33
|
+
constantValues = PayinMethodState.constants.select { |c| PayinMethodState::const_get(c) == value }
|
34
|
+
raise "Invalid ENUM value #{value} for class #PayinMethodState" if constantValues.empty? && !value.empty?
|
35
|
+
value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class PayinMethodUxFlow
|
17
|
+
|
18
|
+
USSD_POPUP = "ussd_popup".freeze
|
19
|
+
USSD_MENU_APPROVAL = "ussd_menu_approval".freeze
|
20
|
+
OTP_VERIFIED_USSD_POPUP = "otp_verified_ussd_popup".freeze
|
21
|
+
BANK_TRANSFER = "bank_transfer".freeze
|
22
|
+
HTTP_REDIRECT = "http_redirect".freeze
|
23
|
+
BLOCKCHAIN = "blockchain".freeze
|
24
|
+
UNKNOWN = "unknown".freeze
|
25
|
+
|
26
|
+
# Builds the enum from string
|
27
|
+
# @param [String] The enum value in the form of the string
|
28
|
+
# @return [String] The enum value
|
29
|
+
def build_from_hash(value)
|
30
|
+
constantValues = PayinMethodUxFlow.constants.select { |c| PayinMethodUxFlow::const_get(c) == value }
|
31
|
+
raise "Invalid ENUM value #{value} for class #PayinMethodUxFlow" if constantValues.empty? && !value.empty?
|
32
|
+
value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -411,6 +411,10 @@ class PayoutMethodDetails
|
|
411
411
|
invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
|
412
412
|
end
|
413
413
|
|
414
|
+
if @cash_provider.nil?
|
415
|
+
invalid_properties.push('invalid value for "cash_provider", cash_provider cannot be nil.')
|
416
|
+
end
|
417
|
+
|
414
418
|
if @sender_identity_card_type.nil?
|
415
419
|
invalid_properties.push('invalid value for "sender_identity_card_type", sender_identity_card_type cannot be nil.')
|
416
420
|
end
|
@@ -466,6 +470,7 @@ class PayoutMethodDetails
|
|
466
470
|
return false if @country.nil?
|
467
471
|
return false if @iban.nil?
|
468
472
|
return false if @bank_name.nil?
|
473
|
+
return false if @cash_provider.nil?
|
469
474
|
return false if @sender_identity_card_type.nil?
|
470
475
|
return false if @sender_identity_card_id.nil?
|
471
476
|
return false if @identity_card_type.nil?
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.0.0-beta3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TransferZero
|
16
|
-
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"221774044436\", // local or international format \"cash_provider\": \"wizall\" //
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"221774044436\", // local or international format \"cash_provider\": \"wizall\" // Mandatory; Values: \"wizall\"; \"country\": \"SN\" // Optional; Values: \"CI\", \"ML\" or \"SN\"; Default value is \"SN\"; } ``` Please note all senders trying to create Wizall cash pickup requests must have `identity_type` and `identity_number` present. The fields above are generally considered optional for senders for other payment corridors. If you wish to use an existing sender who has some of these fields missing you can provide them alongside the `id` or `external_id` field in the sender details. For example - ```JSON { \"transaction\": { \"sender\": { \"external_id\": \"<id of sender>\", \"identity_type\": \"ID\", \"identity_number\": \"AB12345678\", (...) }, (...) } } ```
|
17
17
|
class PayoutMethodDetailsXOFCash
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -99,6 +99,10 @@ class PayoutMethodDetailsXOFCash
|
|
99
99
|
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
100
100
|
end
|
101
101
|
|
102
|
+
if @cash_provider.nil?
|
103
|
+
invalid_properties.push('invalid value for "cash_provider", cash_provider cannot be nil.')
|
104
|
+
end
|
105
|
+
|
102
106
|
invalid_properties
|
103
107
|
end
|
104
108
|
|
@@ -108,6 +112,7 @@ class PayoutMethodDetailsXOFCash
|
|
108
112
|
return false if @first_name.nil?
|
109
113
|
return false if @last_name.nil?
|
110
114
|
return false if @phone_number.nil?
|
115
|
+
return false if @cash_provider.nil?
|
111
116
|
true
|
112
117
|
end
|
113
118
|
|
@@ -14,10 +14,10 @@ require 'date'
|
|
14
14
|
|
15
15
|
module TransferZero
|
16
16
|
class RecipientStateReasonDetails
|
17
|
-
# Status code of
|
17
|
+
# Status code of transaction
|
18
18
|
attr_accessor :code
|
19
19
|
|
20
|
-
# Main category of
|
20
|
+
# Main category of status code, it could be paid, unknown, pickupable, temporary_error, recipient_error, sender_error, sender_action_required
|
21
21
|
attr_accessor :category
|
22
22
|
|
23
23
|
# Tiered messages
|
@@ -46,6 +46,13 @@ class RecipientStateReasonDetails
|
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
49
|
+
# List of class defined in anyOf (OpenAPI v3)
|
50
|
+
def self.openapi_any_of
|
51
|
+
[
|
52
|
+
:'StateReasonDetails'
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
49
56
|
# Initializes the object
|
50
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
51
58
|
def initialize(attributes = {})
|
@@ -90,6 +97,18 @@ class RecipientStateReasonDetails
|
|
90
97
|
# Check to see if the all the properties in the model are valid
|
91
98
|
# @return true if the model is valid
|
92
99
|
def valid?
|
100
|
+
_any_of_found = false
|
101
|
+
openapi_any_of.each do |_class|
|
102
|
+
_any_of = TransferZero.const_get(_class).build_from_hash(self.to_hash)
|
103
|
+
if _any_of.valid?
|
104
|
+
_any_of_found = true
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
if !_any_of_found?
|
109
|
+
return false
|
110
|
+
end
|
111
|
+
|
93
112
|
true
|
94
113
|
end
|
95
114
|
|
@@ -124,6 +124,9 @@ class Sender
|
|
124
124
|
# The Business trading address (used only with a Business sender)
|
125
125
|
attr_accessor :trading_address
|
126
126
|
|
127
|
+
# The Business trading name (used only with a Business sender)
|
128
|
+
attr_accessor :trading_name
|
129
|
+
|
127
130
|
# The estimated number of monthly transactions (used only with a Business sender)
|
128
131
|
attr_accessor :number_monthly_transactions
|
129
132
|
|
@@ -225,6 +228,7 @@ class Sender
|
|
225
228
|
:'contact_person_email' => :'contact_person_email',
|
226
229
|
:'trading_country' => :'trading_country',
|
227
230
|
:'trading_address' => :'trading_address',
|
231
|
+
:'trading_name' => :'trading_name',
|
228
232
|
:'number_monthly_transactions' => :'number_monthly_transactions',
|
229
233
|
:'amount_monthly_transactions' => :'amount_monthly_transactions',
|
230
234
|
:'documents' => :'documents',
|
@@ -281,6 +285,7 @@ class Sender
|
|
281
285
|
:'contact_person_email' => :'String',
|
282
286
|
:'trading_country' => :'String',
|
283
287
|
:'trading_address' => :'String',
|
288
|
+
:'trading_name' => :'String',
|
284
289
|
:'number_monthly_transactions' => :'String',
|
285
290
|
:'amount_monthly_transactions' => :'String',
|
286
291
|
:'documents' => :'Array<Document>',
|
@@ -460,6 +465,10 @@ class Sender
|
|
460
465
|
self.trading_address = attributes[:'trading_address']
|
461
466
|
end
|
462
467
|
|
468
|
+
if attributes.key?(:'trading_name')
|
469
|
+
self.trading_name = attributes[:'trading_name']
|
470
|
+
end
|
471
|
+
|
463
472
|
if attributes.key?(:'number_monthly_transactions')
|
464
473
|
self.number_monthly_transactions = attributes[:'number_monthly_transactions']
|
465
474
|
end
|
@@ -674,6 +683,7 @@ class Sender
|
|
674
683
|
contact_person_email == o.contact_person_email &&
|
675
684
|
trading_country == o.trading_country &&
|
676
685
|
trading_address == o.trading_address &&
|
686
|
+
trading_name == o.trading_name &&
|
677
687
|
number_monthly_transactions == o.number_monthly_transactions &&
|
678
688
|
amount_monthly_transactions == o.amount_monthly_transactions &&
|
679
689
|
documents == o.documents &&
|
@@ -698,7 +708,7 @@ class Sender
|
|
698
708
|
# Calculates hash code according to all attributes.
|
699
709
|
# @return [Integer] Hash code
|
700
710
|
def hash
|
701
|
-
[id, type, state, country, street, postal_code, city, phone_country, phone_number, email, ip, address_description, identification_number, identification_type, lang, name, first_name, middle_name, last_name, birth_date, occupation, nationality, legal_entity_type, registration_date, registration_number, nature_of_business, source_of_funds, custom_source_of_funds, core_business_activity, purpose_of_opening_account, office_phone, vat_registration_number, financial_regulator, regulatory_licence_number, contact_person_email, trading_country, trading_address, number_monthly_transactions, amount_monthly_transactions, documents, metadata, errors, onboarding_status, politically_exposed_people, external_id, city_of_birth, country_of_birth, gender, sales_lead_id, created_at].hash
|
711
|
+
[id, type, state, country, street, postal_code, city, phone_country, phone_number, email, ip, address_description, identification_number, identification_type, lang, name, first_name, middle_name, last_name, birth_date, occupation, nationality, legal_entity_type, registration_date, registration_number, nature_of_business, source_of_funds, custom_source_of_funds, core_business_activity, purpose_of_opening_account, office_phone, vat_registration_number, financial_regulator, regulatory_licence_number, contact_person_email, trading_country, trading_address, trading_name, number_monthly_transactions, amount_monthly_transactions, documents, metadata, errors, onboarding_status, politically_exposed_people, external_id, city_of_birth, country_of_birth, gender, sales_lead_id, created_at].hash
|
702
712
|
end
|
703
713
|
|
704
714
|
require 'active_support/core_ext/hash'
|
@@ -0,0 +1,235 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class StateReasonDetails
|
17
|
+
# Status code of transaction
|
18
|
+
attr_accessor :code
|
19
|
+
|
20
|
+
# Main category of status code, it could be paid, unknown, pickupable, temporary_error, recipient_error, sender_error, sender_action_required
|
21
|
+
attr_accessor :category
|
22
|
+
|
23
|
+
# Tiered messages
|
24
|
+
attr_accessor :messages
|
25
|
+
|
26
|
+
# Public, human readable, detailed error message
|
27
|
+
attr_accessor :description
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'code' => :'code',
|
33
|
+
:'category' => :'category',
|
34
|
+
:'messages' => :'messages',
|
35
|
+
:'description' => :'description'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'code' => :'String',
|
43
|
+
:'category' => :'String',
|
44
|
+
:'messages' => :'Array<String>',
|
45
|
+
:'description' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::StateReasonDetails` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::StateReasonDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'code')
|
65
|
+
self.code = attributes[:'code']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'category')
|
69
|
+
self.category = attributes[:'category']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'messages')
|
73
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
74
|
+
self.messages = value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'description')
|
79
|
+
self.description = attributes[:'description']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
invalid_properties = Array.new
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
code == o.code &&
|
102
|
+
category == o.category &&
|
103
|
+
messages == o.messages &&
|
104
|
+
description == o.description
|
105
|
+
end
|
106
|
+
|
107
|
+
# @see the `==` method
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def eql?(o)
|
110
|
+
self == o
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculates hash code according to all attributes.
|
114
|
+
# @return [Integer] Hash code
|
115
|
+
def hash
|
116
|
+
[code, category, messages, description].hash
|
117
|
+
end
|
118
|
+
|
119
|
+
require 'active_support/core_ext/hash'
|
120
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
131
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
132
|
+
end
|
133
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
135
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def _deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :DateTime
|
148
|
+
DateTime.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :Boolean
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else # model
|
178
|
+
temp_model = TransferZero.const_get(type).new
|
179
|
+
temp_model.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
next if value.nil?
|
202
|
+
hash[param] = _to_hash(value)
|
203
|
+
end
|
204
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
205
|
+
end
|
206
|
+
|
207
|
+
def [](key)
|
208
|
+
to_hash[key]
|
209
|
+
end
|
210
|
+
|
211
|
+
def dig(*args)
|
212
|
+
to_hash.dig(*args)
|
213
|
+
end
|
214
|
+
|
215
|
+
# Outputs non-array value in the form of hash
|
216
|
+
# For object, use to_hash. Otherwise, just return the value
|
217
|
+
# @param [Object] value Any valid value
|
218
|
+
# @return [Hash] Returns the value in the form of hash
|
219
|
+
def _to_hash(value)
|
220
|
+
if value.is_a?(Array)
|
221
|
+
value.compact.map { |v| _to_hash(v) }
|
222
|
+
elsif value.is_a?(Hash)
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
225
|
+
end
|
226
|
+
elsif value.respond_to? :to_hash
|
227
|
+
value.to_hash
|
228
|
+
else
|
229
|
+
value
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
data/lib/transferzero-sdk.rb
CHANGED
@@ -56,6 +56,9 @@ require 'transferzero-sdk/models/payin_method_details_btc'
|
|
56
56
|
require 'transferzero-sdk/models/payin_method_details_mobile'
|
57
57
|
require 'transferzero-sdk/models/payin_method_details_ngn_bank'
|
58
58
|
require 'transferzero-sdk/models/payin_method_request'
|
59
|
+
require 'transferzero-sdk/models/payin_method_response'
|
60
|
+
require 'transferzero-sdk/models/payin_method_state'
|
61
|
+
require 'transferzero-sdk/models/payin_method_ux_flow'
|
59
62
|
require 'transferzero-sdk/models/payment_method'
|
60
63
|
require 'transferzero-sdk/models/payment_method_list_response'
|
61
64
|
require 'transferzero-sdk/models/payment_method_opposite'
|
@@ -111,6 +114,7 @@ require 'transferzero-sdk/models/sender_response_existing'
|
|
111
114
|
require 'transferzero-sdk/models/sender_response_meta'
|
112
115
|
require 'transferzero-sdk/models/sender_state'
|
113
116
|
require 'transferzero-sdk/models/sender_webhook'
|
117
|
+
require 'transferzero-sdk/models/state_reason_details'
|
114
118
|
require 'transferzero-sdk/models/transaction'
|
115
119
|
require 'transferzero-sdk/models/transaction_list_response'
|
116
120
|
require 'transferzero-sdk/models/transaction_request'
|
@@ -142,6 +146,7 @@ require 'transferzero-sdk/api/accounts_api'
|
|
142
146
|
require 'transferzero-sdk/api/currency_info_api'
|
143
147
|
require 'transferzero-sdk/api/documents_api'
|
144
148
|
require 'transferzero-sdk/api/logs_api'
|
149
|
+
require 'transferzero-sdk/api/payin_methods_api'
|
145
150
|
require 'transferzero-sdk/api/payment_methods_api'
|
146
151
|
require 'transferzero-sdk/api/payout_methods_api'
|
147
152
|
require 'transferzero-sdk/api/recipients_api'
|