jamm 1.2.2 → 1.4.0
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/Gemfile.lock +1 -1
- data/lib/jamm/api/api/customer_api.rb +82 -52
- data/lib/jamm/api/api/healthcheck_api.rb +18 -15
- data/lib/jamm/api/api/payment_api.rb +113 -62
- data/lib/jamm/api/api/webhook_service_api.rb +91 -19
- data/lib/jamm/api/api_client.rb +74 -66
- data/lib/jamm/api/api_error.rb +16 -16
- data/lib/jamm/api/configuration.rb +42 -34
- data/lib/jamm/api/models/apiv1_error.rb +238 -0
- data/lib/jamm/api/models/apiv1_status.rb +57 -47
- data/lib/jamm/api/models/customer_service_update_customer_body.rb +107 -69
- data/lib/jamm/api/models/googlerpc_status.rb +61 -45
- data/lib/jamm/api/models/protobuf_any.rb +42 -35
- data/lib/jamm/api/models/v1_add_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_add_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_bank.rb +350 -0
- data/lib/jamm/api/models/v1_bank_assets.rb +244 -0
- data/lib/jamm/api/models/v1_bank_branch.rb +259 -0
- data/lib/jamm/api/models/v1_bank_information.rb +71 -51
- data/lib/jamm/api/models/v1_bank_quota.rb +278 -0
- data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +250 -0
- data/lib/jamm/api/models/v1_buyer.rb +104 -76
- data/lib/jamm/api/models/v1_charge.rb +67 -52
- data/lib/jamm/api/models/v1_charge_message.rb +151 -93
- data/lib/jamm/api/models/v1_charge_message_status.rb +17 -18
- data/lib/jamm/api/models/v1_charge_result.rb +152 -93
- data/lib/jamm/api/models/v1_contract.rb +64 -52
- data/lib/jamm/api/models/v1_contract_message.rb +67 -48
- data/lib/jamm/api/models/v1_contract_status.rb +20 -21
- data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +67 -48
- data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +51 -40
- data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_create_customer_request.rb +42 -35
- data/lib/jamm/api/models/v1_create_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_customer.rb +91 -60
- data/lib/jamm/api/models/v1_delete_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_deposit_type.rb +14 -15
- data/lib/jamm/api/models/v1_error_detail.rb +233 -0
- data/lib/jamm/api/models/v1_error_response.rb +238 -0
- data/lib/jamm/api/models/v1_error_type.rb +57 -0
- data/lib/jamm/api/models/v1_event_type.rb +20 -21
- data/lib/jamm/api/models/{v1_error.rb → v1_get_bank_response.rb} +45 -48
- data/lib/jamm/api/models/v1_get_branch_response.rb +214 -0
- data/lib/jamm/api/models/v1_get_branches_response.rb +216 -0
- data/lib/jamm/api/models/v1_get_charge_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_charges_response.rb +60 -45
- data/lib/jamm/api/models/v1_get_contract_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_major_banks_response.rb +232 -0
- data/lib/jamm/api/models/v1_initial_charge.rb +61 -48
- data/lib/jamm/api/models/v1_kyc_status.rb +16 -17
- data/lib/jamm/api/models/v1_merchant.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_customer.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_webhook_message.rb +75 -57
- data/lib/jamm/api/models/v1_message_response.rb +67 -48
- data/lib/jamm/api/models/v1_off_session_payment_request.rb +51 -40
- data/lib/jamm/api/models/v1_off_session_payment_response.rb +51 -40
- data/lib/jamm/api/models/v1_on_session_payment_data.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_error.rb +55 -45
- data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +21 -22
- data/lib/jamm/api/models/v1_on_session_payment_request.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_response.rb +59 -44
- data/lib/jamm/api/models/v1_pagination.rb +51 -40
- data/lib/jamm/api/models/v1_payment_authorization_status.rb +14 -15
- data/lib/jamm/api/models/v1_payment_link.rb +57 -44
- data/lib/jamm/api/models/v1_ping_response.rb +42 -35
- data/lib/jamm/api/models/v1_search_banks_response.rb +216 -0
- data/lib/jamm/api/models/v1_search_branches_response.rb +216 -0
- data/lib/jamm/api/models/v1_update_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_url.rb +48 -39
- data/lib/jamm/api/models/v1_user_account_message.rb +67 -48
- data/lib/jamm/api/models/v1_withdraw_request.rb +51 -40
- data/lib/jamm/api/models/v1_withdraw_response.rb +51 -40
- data/lib/jamm/api/version.rb +11 -11
- data/lib/jamm/api.rb +25 -11
- data/lib/jamm/charge.rb +12 -0
- data/lib/jamm/deprecation.rb +13 -0
- data/lib/jamm/errors.rb +27 -1
- data/lib/jamm/payment.rb +61 -0
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm.rb +2 -0
- metadata +19 -3
@@ -0,0 +1,238 @@
|
|
1
|
+
=begin
|
2
|
+
#Jamm API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.9.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Api
|
17
|
+
# Generic error type.
|
18
|
+
class Apiv1Error
|
19
|
+
# Jamm defined error code.
|
20
|
+
attr_accessor :code
|
21
|
+
|
22
|
+
# Human readable error message.
|
23
|
+
attr_accessor :message
|
24
|
+
|
25
|
+
# ConnectRPC error details.
|
26
|
+
attr_accessor :details
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'code' => :'code',
|
32
|
+
:'message' => :'message',
|
33
|
+
:'details' => :'details'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'code' => :'String',
|
46
|
+
:'message' => :'String',
|
47
|
+
:'details' => :'Array<ErrorDetail>'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::Apiv1Error` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::Apiv1Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'code')
|
73
|
+
self.code = attributes[:'code']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'message')
|
77
|
+
self.message = attributes[:'message']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'details')
|
81
|
+
if (value = attributes[:'details']).is_a?(Array)
|
82
|
+
self.details = value
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
91
|
+
invalid_properties = Array.new
|
92
|
+
invalid_properties
|
93
|
+
end
|
94
|
+
|
95
|
+
# Check to see if the all the properties in the model are valid
|
96
|
+
# @return true if the model is valid
|
97
|
+
def valid?
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
code == o.code &&
|
108
|
+
message == o.message &&
|
109
|
+
details == o.details
|
110
|
+
end
|
111
|
+
|
112
|
+
# @see the `==` method
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def eql?(o)
|
115
|
+
self == o
|
116
|
+
end
|
117
|
+
|
118
|
+
# Calculates hash code according to all attributes.
|
119
|
+
# @return [Integer] Hash code
|
120
|
+
def hash
|
121
|
+
[code, message, details].hash
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def self.build_from_hash(attributes)
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
130
|
+
transformed_hash = {}
|
131
|
+
openapi_types.each_pair do |key, type|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
133
|
+
transformed_hash["#{key}"] = nil
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
135
|
+
# check to ensure the input is an array given that the attribute
|
136
|
+
# is documented as an array but the input is not
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
139
|
+
end
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
142
|
+
end
|
143
|
+
end
|
144
|
+
new(transformed_hash)
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def self._deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :Time
|
154
|
+
Time.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
# models (e.g. Pet) or oneOf
|
185
|
+
klass = Api.const_get(type)
|
186
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
@@ -1,24 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
=begin
|
2
|
+
#Jamm API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.9.0
|
10
|
+
|
11
|
+
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Api
|
17
17
|
class Apiv1Status
|
18
|
-
attr_accessor :payment
|
18
|
+
attr_accessor :payment
|
19
|
+
|
20
|
+
attr_accessor :kyc
|
19
21
|
|
20
22
|
class EnumAttributeValidator
|
21
|
-
attr_reader :datatype
|
23
|
+
attr_reader :datatype
|
24
|
+
attr_reader :allowable_values
|
22
25
|
|
23
26
|
def initialize(datatype, allowable_values)
|
24
27
|
@allowable_values = allowable_values.map do |value|
|
@@ -41,8 +44,8 @@ module Api
|
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
45
|
def self.attribute_map
|
43
46
|
{
|
44
|
-
:payment => :payment,
|
45
|
-
:kyc => :kyc
|
47
|
+
:'payment' => :'payment',
|
48
|
+
:'kyc' => :'kyc'
|
46
49
|
}
|
47
50
|
end
|
48
51
|
|
@@ -54,46 +57,51 @@ module Api
|
|
54
57
|
# Attribute type mapping.
|
55
58
|
def self.openapi_types
|
56
59
|
{
|
57
|
-
:payment => :PaymentAuthorizationStatus,
|
58
|
-
:kyc => :KycStatus
|
60
|
+
:'payment' => :'PaymentAuthorizationStatus',
|
61
|
+
:'kyc' => :'KycStatus'
|
59
62
|
}
|
60
63
|
end
|
61
64
|
|
62
65
|
# List of attributes with nullable: true
|
63
66
|
def self.openapi_nullable
|
64
|
-
Set.new([
|
67
|
+
Set.new([
|
68
|
+
])
|
65
69
|
end
|
66
70
|
|
67
71
|
# Initializes the object
|
68
72
|
# @param [Hash] attributes Model attributes in the form of hash
|
69
73
|
def initialize(attributes = {})
|
70
|
-
|
74
|
+
if (!attributes.is_a?(Hash))
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::Apiv1Status` initialize method"
|
76
|
+
end
|
71
77
|
|
72
78
|
# check to see if the attribute exists and convert string to symbol for hash key
|
73
|
-
attributes = attributes.each_with_object({})
|
74
|
-
|
75
|
-
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::Apiv1Status`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
82
|
+
end
|
76
83
|
h[k.to_sym] = v
|
77
|
-
|
84
|
+
}
|
78
85
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
86
|
+
if attributes.key?(:'payment')
|
87
|
+
self.payment = attributes[:'payment']
|
88
|
+
else
|
89
|
+
self.payment = 'PAYMENT_AUTHORIZATION_STATUS_UNSPECIFIED'
|
90
|
+
end
|
84
91
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
92
|
+
if attributes.key?(:'kyc')
|
93
|
+
self.kyc = attributes[:'kyc']
|
94
|
+
else
|
95
|
+
self.kyc = 'KYC_STATUS_UNSPECIFIED'
|
96
|
+
end
|
90
97
|
end
|
91
98
|
|
92
99
|
# Show invalid properties with the reasons. Usually used together with valid?
|
93
100
|
# @return Array for valid properties with the reasons
|
94
101
|
def list_invalid_properties
|
95
102
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
96
|
-
|
103
|
+
invalid_properties = Array.new
|
104
|
+
invalid_properties
|
97
105
|
end
|
98
106
|
|
99
107
|
# Check to see if the all the properties in the model are valid
|
@@ -105,18 +113,17 @@ module Api
|
|
105
113
|
|
106
114
|
# Checks equality by comparing each attribute.
|
107
115
|
# @param [Object] Object to be compared
|
108
|
-
def ==(
|
109
|
-
return true if equal?(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
kyc == other.kyc
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
payment == o.payment &&
|
120
|
+
kyc == o.kyc
|
114
121
|
end
|
115
122
|
|
116
123
|
# @see the `==` method
|
117
124
|
# @param [Object] Object to be compared
|
118
|
-
def eql?(
|
119
|
-
self ==
|
125
|
+
def eql?(o)
|
126
|
+
self == o
|
120
127
|
end
|
121
128
|
|
122
129
|
# Calculates hash code according to all attributes.
|
@@ -130,18 +137,19 @@ module Api
|
|
130
137
|
# @return [Object] Returns the model itself
|
131
138
|
def self.build_from_hash(attributes)
|
132
139
|
return nil unless attributes.is_a?(Hash)
|
133
|
-
|
134
140
|
attributes = attributes.transform_keys(&:to_sym)
|
135
141
|
transformed_hash = {}
|
136
142
|
openapi_types.each_pair do |key, type|
|
137
143
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
138
|
-
transformed_hash[key
|
144
|
+
transformed_hash["#{key}"] = nil
|
139
145
|
elsif type =~ /\AArray<(.*)>/i
|
140
146
|
# check to ensure the input is an array given that the attribute
|
141
147
|
# is documented as an array but the input is not
|
142
|
-
|
148
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
149
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
150
|
+
end
|
143
151
|
elsif !attributes[attribute_map[key]].nil?
|
144
|
-
transformed_hash[key
|
152
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
145
153
|
end
|
146
154
|
end
|
147
155
|
new(transformed_hash)
|
@@ -207,7 +215,7 @@ module Api
|
|
207
215
|
def to_hash
|
208
216
|
hash = {}
|
209
217
|
self.class.attribute_map.each_pair do |attr, param|
|
210
|
-
value = send(attr)
|
218
|
+
value = self.send(attr)
|
211
219
|
if value.nil?
|
212
220
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
221
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
@@ -235,5 +243,7 @@ module Api
|
|
235
243
|
value
|
236
244
|
end
|
237
245
|
end
|
246
|
+
|
238
247
|
end
|
248
|
+
|
239
249
|
end
|