splitit-apimatic-sdk 1.0.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.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +154 -0
  4. data/bin/console +15 -0
  5. data/lib/splitit_web_api_v4/api_helper.rb +10 -0
  6. data/lib/splitit_web_api_v4/client.rb +83 -0
  7. data/lib/splitit_web_api_v4/configuration.rb +188 -0
  8. data/lib/splitit_web_api_v4/controllers/base_controller.rb +60 -0
  9. data/lib/splitit_web_api_v4/controllers/installment_plan_controller.rb +242 -0
  10. data/lib/splitit_web_api_v4/controllers/o_auth_authorization_controller.rb +42 -0
  11. data/lib/splitit_web_api_v4/exceptions/api_error_response_exception.rb +51 -0
  12. data/lib/splitit_web_api_v4/exceptions/api_exception.rb +21 -0
  13. data/lib/splitit_web_api_v4/exceptions/o_auth_provider_exception.rb +64 -0
  14. data/lib/splitit_web_api_v4/http/auth/api_key.rb +52 -0
  15. data/lib/splitit_web_api_v4/http/auth/o_auth2.rb +156 -0
  16. data/lib/splitit_web_api_v4/http/http_call_back.rb +10 -0
  17. data/lib/splitit_web_api_v4/http/http_method_enum.rb +10 -0
  18. data/lib/splitit_web_api_v4/http/http_request.rb +10 -0
  19. data/lib/splitit_web_api_v4/http/http_response.rb +10 -0
  20. data/lib/splitit_web_api_v4/http/proxy_settings.rb +22 -0
  21. data/lib/splitit_web_api_v4/models/amount_data.rb +70 -0
  22. data/lib/splitit_web_api_v4/models/api_error_model.rb +93 -0
  23. data/lib/splitit_web_api_v4/models/apr_data.rb +70 -0
  24. data/lib/splitit_web_api_v4/models/authorization_status_enum.rb +40 -0
  25. data/lib/splitit_web_api_v4/models/authorize_authorization_data.rb +154 -0
  26. data/lib/splitit_web_api_v4/models/authorize_request.rb +115 -0
  27. data/lib/splitit_web_api_v4/models/authorize_response.rb +221 -0
  28. data/lib/splitit_web_api_v4/models/base_model.rb +110 -0
  29. data/lib/splitit_web_api_v4/models/billing_address_data.rb +111 -0
  30. data/lib/splitit_web_api_v4/models/card_details.rb +108 -0
  31. data/lib/splitit_web_api_v4/models/card_validity_request.rb +62 -0
  32. data/lib/splitit_web_api_v4/models/card_validity_response.rb +80 -0
  33. data/lib/splitit_web_api_v4/models/checkout_url_data.rb +80 -0
  34. data/lib/splitit_web_api_v4/models/content_segment.rb +90 -0
  35. data/lib/splitit_web_api_v4/models/external_provider_types_enum.rb +48 -0
  36. data/lib/splitit_web_api_v4/models/inline_content.rb +71 -0
  37. data/lib/splitit_web_api_v4/models/installment_item.rb +101 -0
  38. data/lib/splitit_web_api_v4/models/installment_plan_details_response.rb +280 -0
  39. data/lib/splitit_web_api_v4/models/installment_plan_search_details_response.rb +71 -0
  40. data/lib/splitit_web_api_v4/models/installment_plan_search_request.rb +79 -0
  41. data/lib/splitit_web_api_v4/models/installment_plan_status_enum.rb +72 -0
  42. data/lib/splitit_web_api_v4/models/installment_status_enum.rb +60 -0
  43. data/lib/splitit_web_api_v4/models/masked_card_details.rb +82 -0
  44. data/lib/splitit_web_api_v4/models/metadata_item.rb +71 -0
  45. data/lib/splitit_web_api_v4/models/o_auth_provider_error_enum.rb +62 -0
  46. data/lib/splitit_web_api_v4/models/o_auth_scope_o_auth2_enum.rb +26 -0
  47. data/lib/splitit_web_api_v4/models/o_auth_token.rb +96 -0
  48. data/lib/splitit_web_api_v4/models/offer_item.rb +164 -0
  49. data/lib/splitit_web_api_v4/models/offers_billing_address.rb +108 -0
  50. data/lib/splitit_web_api_v4/models/offers_card_details.rb +108 -0
  51. data/lib/splitit_web_api_v4/models/offers_merchant_details.rb +82 -0
  52. data/lib/splitit_web_api_v4/models/offers_payment_method.rb +66 -0
  53. data/lib/splitit_web_api_v4/models/offers_payment_method_response.rb +88 -0
  54. data/lib/splitit_web_api_v4/models/offers_request.rb +145 -0
  55. data/lib/splitit_web_api_v4/models/offers_response.rb +156 -0
  56. data/lib/splitit_web_api_v4/models/offers_shopper_details.rb +112 -0
  57. data/lib/splitit_web_api_v4/models/offers_store_location.rb +108 -0
  58. data/lib/splitit_web_api_v4/models/payment_link_request.rb +195 -0
  59. data/lib/splitit_web_api_v4/models/payment_link_response.rb +107 -0
  60. data/lib/splitit_web_api_v4/models/payment_method.rb +66 -0
  61. data/lib/splitit_web_api_v4/models/payment_method_data.rb +78 -0
  62. data/lib/splitit_web_api_v4/models/payment_method_type_enum.rb +26 -0
  63. data/lib/splitit_web_api_v4/models/pis_error_codes_enum.rb +1021 -0
  64. data/lib/splitit_web_api_v4/models/plan_authorization_data.rb +172 -0
  65. data/lib/splitit_web_api_v4/models/plan_links_data.rb +91 -0
  66. data/lib/splitit_web_api_v4/models/plan_status_enum.rb +48 -0
  67. data/lib/splitit_web_api_v4/models/processing_data.rb +63 -0
  68. data/lib/splitit_web_api_v4/models/purchase_method_enum.rb +52 -0
  69. data/lib/splitit_web_api_v4/models/redirect_urls.rb +81 -0
  70. data/lib/splitit_web_api_v4/models/refund_item.rb +136 -0
  71. data/lib/splitit_web_api_v4/models/refund_request.rb +70 -0
  72. data/lib/splitit_web_api_v4/models/refund_response.rb +105 -0
  73. data/lib/splitit_web_api_v4/models/shipping_status_enum.rb +40 -0
  74. data/lib/splitit_web_api_v4/models/shopper_details_data.rb +113 -0
  75. data/lib/splitit_web_api_v4/models/three_ds_authentication_data.rb +90 -0
  76. data/lib/splitit_web_api_v4/models/three_ds_execute.rb +62 -0
  77. data/lib/splitit_web_api_v4/models/three_ds_redirect_data.rb +93 -0
  78. data/lib/splitit_web_api_v4/models/three_ds_request_data.rb +84 -0
  79. data/lib/splitit_web_api_v4/models/update_offers_payment_method.rb +66 -0
  80. data/lib/splitit_web_api_v4/models/update_offers_request.rb +105 -0
  81. data/lib/splitit_web_api_v4/models/update_order_request.rb +104 -0
  82. data/lib/splitit_web_api_v4/models/update_order_response.rb +126 -0
  83. data/lib/splitit_web_api_v4/models/validation_error.rb +71 -0
  84. data/lib/splitit_web_api_v4/utilities/date_time_helper.rb +11 -0
  85. data/lib/splitit_web_api_v4/utilities/file_wrapper.rb +28 -0
  86. data/lib/splitit_web_api_v4.rb +108 -0
  87. metadata +170 -0
@@ -0,0 +1,221 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module SplititWebApiV4
8
+ # AuthorizeResponse Model.
9
+ class AuthorizeResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [DateTime]
15
+ attr_accessor :date_created
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [InstallmentPlanStatusEnum]
19
+ attr_accessor :plan_status
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :installment_plan_number
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [String]
27
+ attr_accessor :merchant_order_reference
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [PurchaseMethodEnum]
31
+ attr_accessor :purchase_method
32
+
33
+ # TODO: Write general description for this method
34
+ # @return [String]
35
+ attr_accessor :currency
36
+
37
+ # TODO: Write general description for this method
38
+ # @return [Float]
39
+ attr_accessor :purchase_amount
40
+
41
+ # TODO: Write general description for this method
42
+ # @return [Float]
43
+ attr_accessor :total_fees
44
+
45
+ # TODO: Write general description for this method
46
+ # @return [Float]
47
+ attr_accessor :total_amount
48
+
49
+ # TODO: Write general description for this method
50
+ # @return [AprData]
51
+ attr_accessor :apr
52
+
53
+ # TODO: Write general description for this method
54
+ # @return [AuthorizeAuthorizationData]
55
+ attr_accessor :authorization
56
+
57
+ # TODO: Write general description for this method
58
+ # @return [PaymentMethodData]
59
+ attr_accessor :payment_method
60
+
61
+ # TODO: Write general description for this method
62
+ # @return [Array[InstallmentItem]]
63
+ attr_accessor :installments
64
+
65
+ # TODO: Write general description for this method
66
+ # @return [Array[MetadataItem]]
67
+ attr_accessor :metadata
68
+
69
+ # A mapping from model property names to API property names.
70
+ def self.names
71
+ @_hash = {} if @_hash.nil?
72
+ @_hash['date_created'] = 'DateCreated'
73
+ @_hash['plan_status'] = 'PlanStatus'
74
+ @_hash['installment_plan_number'] = 'InstallmentPlanNumber'
75
+ @_hash['merchant_order_reference'] = 'MerchantOrderReference'
76
+ @_hash['purchase_method'] = 'PurchaseMethod'
77
+ @_hash['currency'] = 'Currency'
78
+ @_hash['purchase_amount'] = 'PurchaseAmount'
79
+ @_hash['total_fees'] = 'TotalFees'
80
+ @_hash['total_amount'] = 'TotalAmount'
81
+ @_hash['apr'] = 'Apr'
82
+ @_hash['authorization'] = 'Authorization'
83
+ @_hash['payment_method'] = 'PaymentMethod'
84
+ @_hash['installments'] = 'Installments'
85
+ @_hash['metadata'] = 'Metadata'
86
+ @_hash
87
+ end
88
+
89
+ # An array for optional fields
90
+ def self.optionals
91
+ %w[
92
+ installment_plan_number
93
+ merchant_order_reference
94
+ currency
95
+ apr
96
+ authorization
97
+ payment_method
98
+ installments
99
+ metadata
100
+ ]
101
+ end
102
+
103
+ # An array for nullable fields
104
+ def self.nullables
105
+ []
106
+ end
107
+
108
+ def initialize(date_created = nil, plan_status = nil, purchase_method = nil,
109
+ purchase_amount = nil, total_fees = nil, total_amount = nil,
110
+ installment_plan_number = SKIP,
111
+ merchant_order_reference = SKIP, currency = SKIP, apr = SKIP,
112
+ authorization = SKIP, payment_method = SKIP,
113
+ installments = SKIP, metadata = SKIP)
114
+ @date_created = date_created
115
+ @plan_status = plan_status
116
+ @installment_plan_number = installment_plan_number unless installment_plan_number == SKIP
117
+ @merchant_order_reference = merchant_order_reference unless merchant_order_reference == SKIP
118
+ @purchase_method = purchase_method
119
+ @currency = currency unless currency == SKIP
120
+ @purchase_amount = purchase_amount
121
+ @total_fees = total_fees
122
+ @total_amount = total_amount
123
+ @apr = apr unless apr == SKIP
124
+ @authorization = authorization unless authorization == SKIP
125
+ @payment_method = payment_method unless payment_method == SKIP
126
+ @installments = installments unless installments == SKIP
127
+ @metadata = metadata unless metadata == SKIP
128
+ end
129
+
130
+ # Creates an instance of the object from a hash.
131
+ def self.from_hash(hash)
132
+ return nil unless hash
133
+
134
+ # Extract variables from the hash.
135
+ date_created = if hash.key?('DateCreated')
136
+ (DateTimeHelper.from_rfc3339(hash['DateCreated']) if hash['DateCreated'])
137
+ end
138
+ plan_status = hash.key?('PlanStatus') ? hash['PlanStatus'] : nil
139
+ purchase_method =
140
+ hash.key?('PurchaseMethod') ? hash['PurchaseMethod'] : nil
141
+ purchase_amount =
142
+ hash.key?('PurchaseAmount') ? hash['PurchaseAmount'] : nil
143
+ total_fees = hash.key?('TotalFees') ? hash['TotalFees'] : nil
144
+ total_amount = hash.key?('TotalAmount') ? hash['TotalAmount'] : nil
145
+ installment_plan_number =
146
+ hash.key?('InstallmentPlanNumber') ? hash['InstallmentPlanNumber'] : SKIP
147
+ merchant_order_reference =
148
+ hash.key?('MerchantOrderReference') ? hash['MerchantOrderReference'] : SKIP
149
+ currency = hash.key?('Currency') ? hash['Currency'] : SKIP
150
+ apr = AprData.from_hash(hash['Apr']) if hash['Apr']
151
+ authorization = AuthorizeAuthorizationData.from_hash(hash['Authorization']) if
152
+ hash['Authorization']
153
+ payment_method = PaymentMethodData.from_hash(hash['PaymentMethod']) if hash['PaymentMethod']
154
+ # Parameter is an array, so we need to iterate through it
155
+ installments = nil
156
+ unless hash['Installments'].nil?
157
+ installments = []
158
+ hash['Installments'].each do |structure|
159
+ installments << (InstallmentItem.from_hash(structure) if structure)
160
+ end
161
+ end
162
+
163
+ installments = SKIP unless hash.key?('Installments')
164
+ # Parameter is an array, so we need to iterate through it
165
+ metadata = nil
166
+ unless hash['Metadata'].nil?
167
+ metadata = []
168
+ hash['Metadata'].each do |structure|
169
+ metadata << (MetadataItem.from_hash(structure) if structure)
170
+ end
171
+ end
172
+
173
+ metadata = SKIP unless hash.key?('Metadata')
174
+
175
+ # Create object from extracted values.
176
+ AuthorizeResponse.new(date_created,
177
+ plan_status,
178
+ purchase_method,
179
+ purchase_amount,
180
+ total_fees,
181
+ total_amount,
182
+ installment_plan_number,
183
+ merchant_order_reference,
184
+ currency,
185
+ apr,
186
+ authorization,
187
+ payment_method,
188
+ installments,
189
+ metadata)
190
+ end
191
+
192
+ def to_custom_date_created
193
+ DateTimeHelper.to_rfc3339(date_created)
194
+ end
195
+
196
+ # Provides a human-readable string representation of the object.
197
+ def to_s
198
+ class_name = self.class.name.split('::').last
199
+ "<#{class_name} date_created: #{@date_created}, plan_status: #{@plan_status},"\
200
+ " installment_plan_number: #{@installment_plan_number}, merchant_order_reference:"\
201
+ " #{@merchant_order_reference}, purchase_method: #{@purchase_method}, currency:"\
202
+ " #{@currency}, purchase_amount: #{@purchase_amount}, total_fees: #{@total_fees},"\
203
+ " total_amount: #{@total_amount}, apr: #{@apr}, authorization: #{@authorization},"\
204
+ " payment_method: #{@payment_method}, installments: #{@installments}, metadata:"\
205
+ " #{@metadata}>"
206
+ end
207
+
208
+ # Provides a debugging-friendly string with detailed object information.
209
+ def inspect
210
+ class_name = self.class.name.split('::').last
211
+ "<#{class_name} date_created: #{@date_created.inspect}, plan_status:"\
212
+ " #{@plan_status.inspect}, installment_plan_number: #{@installment_plan_number.inspect},"\
213
+ " merchant_order_reference: #{@merchant_order_reference.inspect}, purchase_method:"\
214
+ " #{@purchase_method.inspect}, currency: #{@currency.inspect}, purchase_amount:"\
215
+ " #{@purchase_amount.inspect}, total_fees: #{@total_fees.inspect}, total_amount:"\
216
+ " #{@total_amount.inspect}, apr: #{@apr.inspect}, authorization: #{@authorization.inspect},"\
217
+ " payment_method: #{@payment_method.inspect}, installments: #{@installments.inspect},"\
218
+ " metadata: #{@metadata.inspect}>"
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,110 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SplititWebApiV4
7
+ # Base model.
8
+ # rubocop:disable all
9
+ class BaseModel < CoreLibrary::BaseModel
10
+ # Returns a Hash representation of the current object.
11
+ def to_hash
12
+ # validating the model being serialized
13
+ self.class.validate(self) if self.class.respond_to?(:validate)
14
+
15
+ hash = {}
16
+ instance_variables.each do |name|
17
+ value = instance_variable_get(name)
18
+ name = name[1..]
19
+ if name == 'additional_properties'
20
+ additional_properties = process_additional_properties(value, self.class.names)
21
+ hash.merge!(additional_properties)
22
+ else
23
+ key = self.class.names.key?(name) ? self.class.names[name] : name
24
+ optional_fields = self.class.optionals
25
+ nullable_fields = self.class.nullables
26
+ if value.nil?
27
+ next unless nullable_fields.include?(name)
28
+
29
+ if !optional_fields.include?(name) && !nullable_fields.include?(name)
30
+ raise ArgumentError,
31
+ "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
32
+ end
33
+ end
34
+
35
+ hash[key] = nil
36
+ unless value.nil?
37
+ if respond_to?("to_custom_#{name}")
38
+ if (value.instance_of? Array) || (value.instance_of? Hash)
39
+ params = [hash, key]
40
+ hash[key] = send("to_custom_#{name}", *params)
41
+ else
42
+ hash[key] = send("to_custom_#{name}")
43
+ end
44
+ elsif respond_to?("to_union_type_#{name}")
45
+ hash[key] = send("to_union_type_#{name}")
46
+ elsif value.instance_of? Array
47
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
48
+ elsif value.instance_of? Hash
49
+ hash[key] = {}
50
+ value.each do |k, v|
51
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
52
+ end
53
+ else
54
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
55
+ end
56
+ end
57
+ end
58
+ end
59
+ hash
60
+ end
61
+
62
+ # Processes additional properties, ensuring no conflicts with existing properties.
63
+ def process_additional_properties(additional_properties, existing_prop_names)
64
+ hash = {}
65
+ additional_properties.each do |name, value|
66
+ check_for_conflict(name, existing_prop_names)
67
+
68
+ hash[name] = if value.is_a?(Array)
69
+ process_array(value)
70
+ elsif value.is_a?(Hash)
71
+ process_hash(value)
72
+ else
73
+ process_basic_value(value)
74
+ end
75
+ end
76
+ hash
77
+ end
78
+
79
+ # Checks if an additional property conflicts with a model's existing property.
80
+ def check_for_conflict(name, existing_prop_names)
81
+ return unless existing_prop_names.key?(name)
82
+
83
+ raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
84
+ end
85
+
86
+ # Processes an array of values, recursively calling `to_hash` on BaseModel objects.
87
+ def process_array(value)
88
+ value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
89
+ end
90
+
91
+ # Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
92
+ def process_hash(value)
93
+ value.transform_values do |v|
94
+ v.is_a?(BaseModel) ? v.to_hash : v
95
+ end
96
+ end
97
+
98
+ # Processes a basic value (non-array, non-hash).
99
+ def process_basic_value(value)
100
+ value.is_a?(BaseModel) ? value.to_hash : value
101
+ end
102
+
103
+ # Returns a JSON representation of the curent object.
104
+ def to_json(options = {})
105
+ hash = to_hash
106
+ hash.to_json(options)
107
+ end
108
+ end
109
+ # rubocop:enable all
110
+ end
@@ -0,0 +1,111 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SplititWebApiV4
7
+ # BillingAddressData Model.
8
+ class BillingAddressData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :line1
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :line2
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :city
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :state
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :postal_code
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :country
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['line1'] = 'Line1'
40
+ @_hash['line2'] = 'Line2'
41
+ @_hash['city'] = 'City'
42
+ @_hash['state'] = 'State'
43
+ @_hash['postal_code'] = 'PostalCode'
44
+ @_hash['country'] = 'Country'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ %w[
51
+ line1
52
+ line2
53
+ city
54
+ state
55
+ postal_code
56
+ country
57
+ ]
58
+ end
59
+
60
+ # An array for nullable fields
61
+ def self.nullables
62
+ []
63
+ end
64
+
65
+ def initialize(line1 = SKIP, line2 = SKIP, city = SKIP, state = SKIP,
66
+ postal_code = SKIP, country = SKIP)
67
+ @line1 = line1 unless line1 == SKIP
68
+ @line2 = line2 unless line2 == SKIP
69
+ @city = city unless city == SKIP
70
+ @state = state unless state == SKIP
71
+ @postal_code = postal_code unless postal_code == SKIP
72
+ @country = country unless country == SKIP
73
+ end
74
+
75
+ # Creates an instance of the object from a hash.
76
+ def self.from_hash(hash)
77
+ return nil unless hash
78
+
79
+ # Extract variables from the hash.
80
+ line1 = hash.key?('Line1') ? hash['Line1'] : SKIP
81
+ line2 = hash.key?('Line2') ? hash['Line2'] : SKIP
82
+ city = hash.key?('City') ? hash['City'] : SKIP
83
+ state = hash.key?('State') ? hash['State'] : SKIP
84
+ postal_code = hash.key?('PostalCode') ? hash['PostalCode'] : SKIP
85
+ country = hash.key?('Country') ? hash['Country'] : SKIP
86
+
87
+ # Create object from extracted values.
88
+ BillingAddressData.new(line1,
89
+ line2,
90
+ city,
91
+ state,
92
+ postal_code,
93
+ country)
94
+ end
95
+
96
+ # Provides a human-readable string representation of the object.
97
+ def to_s
98
+ class_name = self.class.name.split('::').last
99
+ "<#{class_name} line1: #{@line1}, line2: #{@line2}, city: #{@city}, state: #{@state},"\
100
+ " postal_code: #{@postal_code}, country: #{@country}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} line1: #{@line1.inspect}, line2: #{@line2.inspect}, city: #{@city.inspect},"\
107
+ " state: #{@state.inspect}, postal_code: #{@postal_code.inspect}, country:"\
108
+ " #{@country.inspect}>"
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,108 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SplititWebApiV4
7
+ # CardDetails Model.
8
+ class CardDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :first_name
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :last_name
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :card_number
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :exp_year
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :exp_month
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :cvv
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['first_name'] = 'FirstName'
40
+ @_hash['last_name'] = 'LastName'
41
+ @_hash['card_number'] = 'CardNumber'
42
+ @_hash['exp_year'] = 'ExpYear'
43
+ @_hash['exp_month'] = 'ExpMonth'
44
+ @_hash['cvv'] = 'Cvv'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ %w[
51
+ first_name
52
+ last_name
53
+ cvv
54
+ ]
55
+ end
56
+
57
+ # An array for nullable fields
58
+ def self.nullables
59
+ []
60
+ end
61
+
62
+ def initialize(card_number = nil, exp_year = nil, exp_month = nil,
63
+ first_name = SKIP, last_name = SKIP, cvv = SKIP)
64
+ @first_name = first_name unless first_name == SKIP
65
+ @last_name = last_name unless last_name == SKIP
66
+ @card_number = card_number
67
+ @exp_year = exp_year
68
+ @exp_month = exp_month
69
+ @cvv = cvv unless cvv == SKIP
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ card_number = hash.key?('CardNumber') ? hash['CardNumber'] : nil
78
+ exp_year = hash.key?('ExpYear') ? hash['ExpYear'] : nil
79
+ exp_month = hash.key?('ExpMonth') ? hash['ExpMonth'] : nil
80
+ first_name = hash.key?('FirstName') ? hash['FirstName'] : SKIP
81
+ last_name = hash.key?('LastName') ? hash['LastName'] : SKIP
82
+ cvv = hash.key?('Cvv') ? hash['Cvv'] : SKIP
83
+
84
+ # Create object from extracted values.
85
+ CardDetails.new(card_number,
86
+ exp_year,
87
+ exp_month,
88
+ first_name,
89
+ last_name,
90
+ cvv)
91
+ end
92
+
93
+ # Provides a human-readable string representation of the object.
94
+ def to_s
95
+ class_name = self.class.name.split('::').last
96
+ "<#{class_name} first_name: #{@first_name}, last_name: #{@last_name}, card_number:"\
97
+ " #{@card_number}, exp_year: #{@exp_year}, exp_month: #{@exp_month}, cvv: #{@cvv}>"
98
+ end
99
+
100
+ # Provides a debugging-friendly string with detailed object information.
101
+ def inspect
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect},"\
104
+ " card_number: #{@card_number.inspect}, exp_year: #{@exp_year.inspect}, exp_month:"\
105
+ " #{@exp_month.inspect}, cvv: #{@cvv.inspect}>"
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,62 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SplititWebApiV4
7
+ # CardValidityRequest Model.
8
+ class CardValidityRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [PaymentMethod]
14
+ attr_accessor :payment_method
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['payment_method'] = 'PaymentMethod'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ payment_method
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(payment_method = SKIP)
36
+ @payment_method = payment_method unless payment_method == SKIP
37
+ end
38
+
39
+ # Creates an instance of the object from a hash.
40
+ def self.from_hash(hash)
41
+ return nil unless hash
42
+
43
+ # Extract variables from the hash.
44
+ payment_method = PaymentMethod.from_hash(hash['PaymentMethod']) if hash['PaymentMethod']
45
+
46
+ # Create object from extracted values.
47
+ CardValidityRequest.new(payment_method)
48
+ end
49
+
50
+ # Provides a human-readable string representation of the object.
51
+ def to_s
52
+ class_name = self.class.name.split('::').last
53
+ "<#{class_name} payment_method: #{@payment_method}>"
54
+ end
55
+
56
+ # Provides a debugging-friendly string with detailed object information.
57
+ def inspect
58
+ class_name = self.class.name.split('::').last
59
+ "<#{class_name} payment_method: #{@payment_method.inspect}>"
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,80 @@
1
+ # splitit_web_api_v4
2
+ #
3
+ # This file was automatically generated by APIMATIC
4
+ # v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SplititWebApiV4
7
+ # CardValidityResponse Model.
8
+ class CardValidityResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :result
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[ValidationError]]
18
+ attr_accessor :validation_errors
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['result'] = 'Result'
24
+ @_hash['validation_errors'] = 'ValidationErrors'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ validation_errors
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(result = nil, validation_errors = SKIP)
41
+ @result = result
42
+ @validation_errors = validation_errors unless validation_errors == SKIP
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ result = hash.key?('Result') ? hash['Result'] : nil
51
+ # Parameter is an array, so we need to iterate through it
52
+ validation_errors = nil
53
+ unless hash['ValidationErrors'].nil?
54
+ validation_errors = []
55
+ hash['ValidationErrors'].each do |structure|
56
+ validation_errors << (ValidationError.from_hash(structure) if structure)
57
+ end
58
+ end
59
+
60
+ validation_errors = SKIP unless hash.key?('ValidationErrors')
61
+
62
+ # Create object from extracted values.
63
+ CardValidityResponse.new(result,
64
+ validation_errors)
65
+ end
66
+
67
+ # Provides a human-readable string representation of the object.
68
+ def to_s
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} result: #{@result}, validation_errors: #{@validation_errors}>"
71
+ end
72
+
73
+ # Provides a debugging-friendly string with detailed object information.
74
+ def inspect
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} result: #{@result.inspect}, validation_errors:"\
77
+ " #{@validation_errors.inspect}>"
78
+ end
79
+ end
80
+ end