digital_femsa 1.0.0 → 1.1.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 (166) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +14 -0
  3. data/README.md +28 -33
  4. data/VERSION +1 -1
  5. data/config-ruby.json +1 -1
  6. data/docs/ApiKeyCreateResponse.md +1 -1
  7. data/docs/ApiKeyRequest.md +2 -2
  8. data/docs/ApiKeyResponseOnDelete.md +2 -2
  9. data/docs/ApiKeysApi.md +10 -10
  10. data/docs/BalanceResponse.md +8 -8
  11. data/docs/BalancesApi.md +1 -1
  12. data/docs/ChargeOrderResponse.md +1 -1
  13. data/docs/ChargeOrderResponseChannel.md +24 -0
  14. data/docs/ChargeRequest.md +1 -1
  15. data/docs/ChargeRequestPaymentMethod.md +3 -3
  16. data/docs/ChargeResponse.md +9 -7
  17. data/docs/ChargeResponseChannel.md +3 -3
  18. data/docs/ChargeResponseRefundsData.md +5 -1
  19. data/docs/ChargesApi.md +16 -12
  20. data/docs/ChargesDataResponse.md +9 -7
  21. data/docs/Checkout.md +17 -15
  22. data/docs/CheckoutOrderTemplate.md +3 -3
  23. data/docs/CheckoutResponse.md +1 -1
  24. data/docs/CreateCustomerFiscalEntitiesResponse.md +2 -2
  25. data/docs/Customer.md +13 -19
  26. data/docs/CustomerAddress.md +2 -2
  27. data/docs/CustomerFiscalEntitiesDataResponse.md +2 -2
  28. data/docs/CustomerFiscalEntitiesRequest.md +3 -3
  29. data/docs/CustomerInfo.md +4 -4
  30. data/docs/CustomerPaymentMethodRequest.md +1 -1
  31. data/docs/CustomerResponse.md +17 -21
  32. data/docs/CustomerShippingContactsResponse.md +5 -5
  33. data/docs/CustomersApi.md +15 -15
  34. data/docs/CustomersResponse.md +1 -1
  35. data/docs/DeleteApiKeysResponse.md +1 -1
  36. data/docs/DiscountsApi.md +9 -9
  37. data/docs/EventsApi.md +2 -2
  38. data/docs/EventsResendResponse.md +1 -1
  39. data/docs/GetChargesResponse.md +4 -4
  40. data/docs/GetTransactionsResponse.md +1 -1
  41. data/docs/LogsApi.md +1 -1
  42. data/docs/OrderFiscalEntityRequest.md +4 -4
  43. data/docs/OrderRefundRequest.md +7 -5
  44. data/docs/OrderRequest.md +17 -19
  45. data/docs/OrderResponse.md +37 -35
  46. data/docs/OrderResponseChannel.md +24 -0
  47. data/docs/OrderResponseShippingContact.md +4 -4
  48. data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
  49. data/docs/OrderUpdateRequest.md +19 -15
  50. data/docs/OrdersApi.md +16 -16
  51. data/docs/PaymentLinkApi.md +12 -82
  52. data/docs/PaymentMethodCash.md +4 -4
  53. data/docs/PaymentMethodCashRequest.md +2 -2
  54. data/docs/PaymentMethodsApi.md +5 -5
  55. data/docs/Product.md +10 -12
  56. data/docs/ProductDataResponse.md +9 -11
  57. data/docs/ProductOrderResponse.md +9 -11
  58. data/docs/ProductsApi.md +7 -7
  59. data/docs/ShippingContactsApi.md +9 -9
  60. data/docs/ShippingOrderResponse.md +5 -3
  61. data/docs/ShippingRequest.md +2 -0
  62. data/docs/ShippingsApi.md +7 -7
  63. data/docs/TaxesApi.md +7 -7
  64. data/docs/TransactionResponse.md +20 -14
  65. data/docs/TransactionsApi.md +6 -6
  66. data/docs/TransfersApi.md +10 -10
  67. data/docs/UpdateCustomer.md +17 -21
  68. data/docs/UpdateCustomerFiscalEntitiesResponse.md +2 -2
  69. data/docs/UpdateOrderTaxRequest.md +2 -2
  70. data/docs/UpdateProduct.md +7 -9
  71. data/docs/WebhookKeysApi.md +18 -14
  72. data/docs/WebhooksApi.md +28 -22
  73. data/lib/digital_femsa/api/api_keys_api.rb +8 -8
  74. data/lib/digital_femsa/api/balances_api.rb +2 -2
  75. data/lib/digital_femsa/api/charges_api.rb +13 -9
  76. data/lib/digital_femsa/api/customers_api.rb +12 -12
  77. data/lib/digital_femsa/api/discounts_api.rb +12 -12
  78. data/lib/digital_femsa/api/events_api.rb +4 -4
  79. data/lib/digital_femsa/api/logs_api.rb +2 -2
  80. data/lib/digital_femsa/api/orders_api.rb +20 -20
  81. data/lib/digital_femsa/api/payment_link_api.rb +10 -86
  82. data/lib/digital_femsa/api/payment_methods_api.rb +8 -8
  83. data/lib/digital_femsa/api/products_api.rb +10 -10
  84. data/lib/digital_femsa/api/shipping_contacts_api.rb +8 -8
  85. data/lib/digital_femsa/api/shippings_api.rb +10 -10
  86. data/lib/digital_femsa/api/taxes_api.rb +10 -10
  87. data/lib/digital_femsa/api/transactions_api.rb +6 -6
  88. data/lib/digital_femsa/api/transfers_api.rb +8 -8
  89. data/lib/digital_femsa/api/webhook_keys_api.rb +14 -10
  90. data/lib/digital_femsa/api/webhooks_api.rb +23 -16
  91. data/lib/digital_femsa/api_client.rb +9 -5
  92. data/lib/digital_femsa/models/api_key_create_response.rb +1 -1
  93. data/lib/digital_femsa/models/api_key_request.rb +36 -1
  94. data/lib/digital_femsa/models/balance_response.rb +9 -9
  95. data/lib/digital_femsa/models/charge_order_response.rb +1 -1
  96. data/lib/digital_femsa/models/{order_next_action_response.rb → charge_order_response_channel.rb} +34 -18
  97. data/lib/digital_femsa/models/charge_request_payment_method.rb +3 -2
  98. data/lib/digital_femsa/models/charge_response.rb +15 -4
  99. data/lib/digital_femsa/models/charge_response_refunds_data.rb +23 -4
  100. data/lib/digital_femsa/models/charge_update_request.rb +1 -1
  101. data/lib/digital_femsa/models/charges_data_response.rb +15 -4
  102. data/lib/digital_femsa/models/checkout.rb +97 -81
  103. data/lib/digital_femsa/models/checkout_order_template.rb +4 -4
  104. data/lib/digital_femsa/models/checkout_order_template_customer_info.rb +1 -1
  105. data/lib/digital_femsa/models/checkout_request.rb +1 -1
  106. data/lib/digital_femsa/models/checkout_response.rb +1 -1
  107. data/lib/digital_femsa/models/create_customer_fiscal_entities_response.rb +10 -10
  108. data/lib/digital_femsa/models/customer.rb +57 -95
  109. data/lib/digital_femsa/models/customer_address.rb +7 -0
  110. data/lib/digital_femsa/models/customer_fiscal_entities_data_response.rb +10 -10
  111. data/lib/digital_femsa/models/customer_fiscal_entities_request.rb +13 -13
  112. data/lib/digital_femsa/models/customer_info.rb +13 -20
  113. data/lib/digital_femsa/models/customer_payment_method_request.rb +2 -2
  114. data/lib/digital_femsa/models/customer_payment_sources_inner.rb +104 -0
  115. data/lib/digital_femsa/models/customer_response.rb +122 -113
  116. data/lib/digital_femsa/models/customer_shipping_contacts_response.rb +2 -0
  117. data/lib/digital_femsa/models/customers_response.rb +1 -0
  118. data/lib/digital_femsa/models/events_resend_response.rb +1 -1
  119. data/lib/digital_femsa/models/get_charges_response.rb +21 -21
  120. data/lib/digital_femsa/models/get_transactions_response.rb +1 -1
  121. data/lib/digital_femsa/models/log_response.rb +1 -1
  122. data/lib/digital_femsa/models/logs_response.rb +1 -1
  123. data/lib/digital_femsa/models/order_fiscal_entity_response.rb +1 -1
  124. data/lib/digital_femsa/models/order_refund_request.rb +59 -11
  125. data/lib/digital_femsa/models/order_request.rb +69 -79
  126. data/lib/digital_femsa/models/order_response.rb +187 -119
  127. data/lib/digital_femsa/models/{order_next_action_response_redirect_to_url.rb → order_response_channel.rb} +35 -19
  128. data/lib/digital_femsa/models/order_response_charges.rb +1 -1
  129. data/lib/digital_femsa/models/order_response_checkout.rb +1 -0
  130. data/lib/digital_femsa/models/order_response_customer_info.rb +1 -0
  131. data/lib/digital_femsa/models/order_response_shipping_contact.rb +3 -0
  132. data/lib/digital_femsa/models/order_update_fiscal_entity_request.rb +1 -1
  133. data/lib/digital_femsa/models/order_update_request.rb +106 -65
  134. data/lib/digital_femsa/models/payment_method_cash.rb +1 -1
  135. data/lib/digital_femsa/models/payment_method_cash_request.rb +2 -1
  136. data/lib/digital_femsa/models/product.rb +103 -95
  137. data/lib/digital_femsa/models/product_data_response.rb +103 -95
  138. data/lib/digital_femsa/models/product_order_response.rb +103 -95
  139. data/lib/digital_femsa/models/shipping_order_response.rb +11 -1
  140. data/lib/digital_femsa/models/shipping_request.rb +12 -1
  141. data/lib/digital_femsa/models/transaction_response.rb +172 -99
  142. data/lib/digital_femsa/models/transfers_response.rb +1 -1
  143. data/lib/digital_femsa/models/transfers_response_destination.rb +312 -0
  144. data/lib/digital_femsa/models/update_customer.rb +42 -85
  145. data/lib/digital_femsa/models/update_customer_fiscal_entities_response.rb +10 -10
  146. data/lib/digital_femsa/models/update_order_discount_lines_request.rb +34 -0
  147. data/lib/digital_femsa/models/update_order_tax_request.rb +2 -2
  148. data/lib/digital_femsa/models/update_payment_methods_amount.rb +105 -0
  149. data/lib/digital_femsa/models/update_payment_methods_expires_at.rb +105 -0
  150. data/lib/digital_femsa/models/update_product.rb +85 -58
  151. data/lib/digital_femsa/models/webhook_key_delete_response.rb +1 -1
  152. data/lib/digital_femsa/models/webhook_key_request.rb +1 -0
  153. data/lib/digital_femsa/models/webhook_key_response.rb +1 -1
  154. data/lib/digital_femsa/models/webhook_request.rb +1 -1
  155. data/lib/digital_femsa/models/webhook_response.rb +1 -1
  156. data/lib/digital_femsa/models/webhook_update_request.rb +1 -1
  157. data/lib/digital_femsa/version.rb +1 -1
  158. data/lib/digital_femsa.rb +2 -6
  159. data/templates/ruby/api_client.mustache +8 -4
  160. metadata +26 -26
  161. data/docs/CustomerAntifraudInfo.md +0 -20
  162. data/docs/CustomerAntifraudInfoResponse.md +0 -20
  163. data/docs/OrderNextActionResponse.md +0 -20
  164. data/docs/OrderNextActionResponseRedirectToUrl.md +0 -20
  165. data/docs/SmsCheckoutRequest.md +0 -18
  166. data/docs/UpdateCustomerAntifraudInfo.md +0 -20
@@ -21,7 +21,7 @@ module DigitalFemsa
21
21
  end
22
22
  # Create Webhook
23
23
  # What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc.
24
- # @param webhook_request [WebhookRequest] requested field for webhook
24
+ # @param webhook_request [WebhookRequest] Webhook creation/update request payload.
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
27
27
  # @return [WebhookResponse]
@@ -32,7 +32,7 @@ module DigitalFemsa
32
32
 
33
33
  # Create Webhook
34
34
  # What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc.
35
- # @param webhook_request [WebhookRequest] requested field for webhook
35
+ # @param webhook_request [WebhookRequest] Webhook creation/update request payload.
36
36
  # @param [Hash] opts the optional parameters
37
37
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
38
38
  # @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers
@@ -94,7 +94,8 @@ module DigitalFemsa
94
94
  return data, status_code, headers
95
95
  end
96
96
 
97
- # Delete Webhook
97
+ # Delete webhook
98
+ # Deletes a webhook.
98
99
  # @param id [String] Identifier of the resource
99
100
  # @param [Hash] opts the optional parameters
100
101
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -104,7 +105,8 @@ module DigitalFemsa
104
105
  data
105
106
  end
106
107
 
107
- # Delete Webhook
108
+ # Delete webhook
109
+ # Deletes a webhook.
108
110
  # @param id [String] Identifier of the resource
109
111
  # @param [Hash] opts the optional parameters
110
112
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -162,7 +164,8 @@ module DigitalFemsa
162
164
  return data, status_code, headers
163
165
  end
164
166
 
165
- # Get Webhook
167
+ # Get webhook
168
+ # Retrieves the details of a webhook by its ID.
166
169
  # @param id [String] Identifier of the resource
167
170
  # @param [Hash] opts the optional parameters
168
171
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -173,7 +176,8 @@ module DigitalFemsa
173
176
  data
174
177
  end
175
178
 
176
- # Get Webhook
179
+ # Get webhook
180
+ # Retrieves the details of a webhook by its ID.
177
181
  # @param id [String] Identifier of the resource
178
182
  # @param [Hash] opts the optional parameters
179
183
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -240,6 +244,7 @@ module DigitalFemsa
240
244
  # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
241
245
  # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
242
246
  # @option opts [String] :search General order search, e.g. by mail, reference etc.
247
+ # @option opts [String] :url url for webhook filter
243
248
  # @option opts [String] :_next next page
244
249
  # @option opts [String] :previous previous page
245
250
  # @return [GetWebhooksResponse]
@@ -255,6 +260,7 @@ module DigitalFemsa
255
260
  # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
256
261
  # @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20)
257
262
  # @option opts [String] :search General order search, e.g. by mail, reference etc.
263
+ # @option opts [String] :url url for webhook filter
258
264
  # @option opts [String] :_next next page
259
265
  # @option opts [String] :previous previous page
260
266
  # @return [Array<(GetWebhooksResponse, Integer, Hash)>] GetWebhooksResponse data, response status code and response headers
@@ -281,6 +287,7 @@ module DigitalFemsa
281
287
  query_params = opts[:query_params] || {}
282
288
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
283
289
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
290
+ query_params[:'url'] = opts[:'url'] if !opts[:'url'].nil?
284
291
  query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
285
292
  query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
286
293
 
@@ -320,8 +327,8 @@ module DigitalFemsa
320
327
  return data, status_code, headers
321
328
  end
322
329
 
323
- # Test Webhook
324
- # Send a webhook.ping event
330
+ # Test webhook
331
+ # Sends a test event to the specified webhook to verify it can receive events.
325
332
  # @param id [String] Identifier of the resource
326
333
  # @param [Hash] opts the optional parameters
327
334
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -331,8 +338,8 @@ module DigitalFemsa
331
338
  data
332
339
  end
333
340
 
334
- # Test Webhook
335
- # Send a webhook.ping event
341
+ # Test webhook
342
+ # Sends a test event to the specified webhook to verify it can receive events.
336
343
  # @param id [String] Identifier of the resource
337
344
  # @param [Hash] opts the optional parameters
338
345
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
@@ -390,10 +397,10 @@ module DigitalFemsa
390
397
  return data, status_code, headers
391
398
  end
392
399
 
393
- # Update Webhook
394
- # updates an existing webhook
400
+ # Update webhook
401
+ # Updates an existing webhook.
395
402
  # @param id [String] Identifier of the resource
396
- # @param webhook_update_request [WebhookUpdateRequest] requested fields in order to update a webhook
403
+ # @param webhook_update_request [WebhookUpdateRequest] Webhook update request payload.
397
404
  # @param [Hash] opts the optional parameters
398
405
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
399
406
  # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
@@ -403,10 +410,10 @@ module DigitalFemsa
403
410
  data
404
411
  end
405
412
 
406
- # Update Webhook
407
- # updates an existing webhook
413
+ # Update webhook
414
+ # Updates an existing webhook.
408
415
  # @param id [String] Identifier of the resource
409
- # @param webhook_update_request [WebhookUpdateRequest] requested fields in order to update a webhook
416
+ # @param webhook_update_request [WebhookUpdateRequest] Webhook update request payload.
410
417
  # @param [Hash] opts the optional parameters
411
418
  # @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
412
419
  # @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request.
@@ -34,11 +34,11 @@ module DigitalFemsa
34
34
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
35
  def initialize(config = Configuration.default)
36
36
  @config = config
37
- @user_agent = "DigitalFemsa/v2 RubyBindings/#{DigitalFemsa::VERSION}"
37
+ @user_agent = "App/v2 RubyBindings/#{DigitalFemsa::VERSION}"
38
38
  @default_headers = {
39
39
  'Content-Type' => 'application/json',
40
40
  'User-Agent' => @user_agent,
41
- 'X-DigitalFemsa-Client-User-Agent' => digitalfemsa_headers.to_json
41
+ 'Spin-Client-User-Agent' => digitalfemsa_headers_to_string
42
42
  }
43
43
  end
44
44
 
@@ -430,13 +430,17 @@ module DigitalFemsa
430
430
  end
431
431
  def digitalfemsa_headers
432
432
  params = {
433
- bindings_version: DigitalFemsa::VERSION,
433
+ sdk_version: DigitalFemsa::VERSION,
434
434
  lang: 'ruby',
435
- lang_version: RUBY_VERSION,
436
- publisher: 'digitalfemsa'
435
+ lang_version: RUBY_VERSION
437
436
  }
438
437
 
439
438
  @digitalfemsa_headers ||= params
440
439
  end
440
+
441
+ def digitalfemsa_headers_to_string
442
+ headers = digitalfemsa_headers
443
+ headers.map { |k, v| "#{k}=#{v}" }.join(';')
444
+ end
441
445
  end
442
446
  end
@@ -48,7 +48,7 @@ module DigitalFemsa
48
48
  # Indicates if the api key is private or public
49
49
  attr_accessor :role
50
50
 
51
- # It is occupied as a user when authenticated with basic authentication, with a blank password. This value will only appear once, in the request to create a new key. Copy and save it in a safe place.
51
+ # Used as the username for Basic Authentication, with a blank password. This value is shown only once (when the key is created). Copy and store it securely.
52
52
  attr_accessor :authentication_token
53
53
 
54
54
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -15,11 +15,34 @@ require 'time'
15
15
 
16
16
  module DigitalFemsa
17
17
  class ApiKeyRequest
18
- # A name or brief explanation of what this api key is used for
18
+ # A name or brief explanation of what this API key is used for.
19
19
  attr_accessor :description
20
20
 
21
+ # Defines the type of API key to create. Only \"private\" is supported for creation. A \"public\" API key already exists by default per company/environment.
21
22
  attr_accessor :role
22
23
 
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
23
46
  # Attribute mapping from ruby-style variable name to JSON key.
24
47
  def self.attribute_map
25
48
  {
@@ -90,9 +113,21 @@ module DigitalFemsa
90
113
  def valid?
91
114
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
115
  return false if @role.nil?
116
+ role_validator = EnumAttributeValidator.new('String', ["private"])
117
+ return false unless role_validator.valid?(@role)
93
118
  true
94
119
  end
95
120
 
121
+ # Custom attribute writer method checking allowed values (enum).
122
+ # @param [Object] role Object to be assigned
123
+ def role=(role)
124
+ validator = EnumAttributeValidator.new('String', ["private"])
125
+ unless validator.valid?(role)
126
+ fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
127
+ end
128
+ @role = role
129
+ end
130
+
96
131
  # Checks equality by comparing each attribute.
97
132
  # @param [Object] Object to be compared
98
133
  def ==(o)
@@ -14,9 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # balance model
17
+ # Company balance summary. Monetary fields are returned as arrays of amounts grouped by currency (see `balance_common_field` items).
18
18
  class BalanceResponse
19
- # The balance's available
19
+ # Amounts currently available, grouped by currency.
20
20
  attr_accessor :available
21
21
 
22
22
  # The balance's cashout retention amount
@@ -25,25 +25,25 @@ module DigitalFemsa
25
25
  # The balance's Femsa retention
26
26
  attr_accessor :conekta_retention
27
27
 
28
- # The balance's gateway
28
+ # Gateway balance amounts, grouped by currency.
29
29
  attr_accessor :gateway
30
30
 
31
- # The balance's pending
31
+ # Amounts pending settlement, grouped by currency.
32
32
  attr_accessor :pending
33
33
 
34
- # The balance's retained
34
+ # Amounts currently retained, grouped by currency.
35
35
  attr_accessor :retained
36
36
 
37
- # The balance's retention amount
37
+ # Retention amount applied, grouped by currency.
38
38
  attr_accessor :retention_amount
39
39
 
40
- # The balance's target collateral amount
40
+ # Target collateral amount, grouped by currency.
41
41
  attr_accessor :target_collateral_amount
42
42
 
43
- # The balance's target retention amount
43
+ # Target retention amount, grouped by currency.
44
44
  attr_accessor :target_retention_amount
45
45
 
46
- # The balance's temporarily retained
46
+ # Amounts temporarily retained
47
47
  attr_accessor :temporarily_retained
48
48
 
49
49
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -85,7 +85,7 @@ module DigitalFemsa
85
85
  def self.openapi_types
86
86
  {
87
87
  :'amount' => :'Integer',
88
- :'channel' => :'ChargeResponseChannel',
88
+ :'channel' => :'ChargeOrderResponseChannel',
89
89
  :'created_at' => :'Integer',
90
90
  :'currency' => :'String',
91
91
  :'customer_id' => :'String',
@@ -14,18 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # contains the following attributes that will guide to continue the flow
18
- class OrderNextActionResponse
19
- attr_accessor :redirect_to_url
17
+ class ChargeOrderResponseChannel
18
+ attr_accessor :segment
20
19
 
21
- # Indicates the type of action to be taken
22
- attr_accessor :type
20
+ attr_accessor :checkout_request_id
21
+
22
+ attr_accessor :checkout_request_type
23
+
24
+ attr_accessor :id
23
25
 
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
- :'redirect_to_url' => :'redirect_to_url',
28
- :'type' => :'type'
29
+ :'segment' => :'segment',
30
+ :'checkout_request_id' => :'checkout_request_id',
31
+ :'checkout_request_type' => :'checkout_request_type',
32
+ :'id' => :'id'
29
33
  }
30
34
  end
31
35
 
@@ -37,8 +41,10 @@ module DigitalFemsa
37
41
  # Attribute type mapping.
38
42
  def self.openapi_types
39
43
  {
40
- :'redirect_to_url' => :'OrderNextActionResponseRedirectToUrl',
41
- :'type' => :'String'
44
+ :'segment' => :'String',
45
+ :'checkout_request_id' => :'String',
46
+ :'checkout_request_type' => :'String',
47
+ :'id' => :'String'
42
48
  }
43
49
  end
44
50
 
@@ -52,23 +58,31 @@ module DigitalFemsa
52
58
  # @param [Hash] attributes Model attributes in the form of hash
53
59
  def initialize(attributes = {})
54
60
  if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `DigitalFemsa::OrderNextActionResponse` initialize method"
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DigitalFemsa::ChargeOrderResponseChannel` initialize method"
56
62
  end
57
63
 
58
64
  # check to see if the attribute exists and convert string to symbol for hash key
59
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
66
  if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `DigitalFemsa::OrderNextActionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DigitalFemsa::ChargeOrderResponseChannel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
68
  end
63
69
  h[k.to_sym] = v
64
70
  }
65
71
 
66
- if attributes.key?(:'redirect_to_url')
67
- self.redirect_to_url = attributes[:'redirect_to_url']
72
+ if attributes.key?(:'segment')
73
+ self.segment = attributes[:'segment']
74
+ end
75
+
76
+ if attributes.key?(:'checkout_request_id')
77
+ self.checkout_request_id = attributes[:'checkout_request_id']
78
+ end
79
+
80
+ if attributes.key?(:'checkout_request_type')
81
+ self.checkout_request_type = attributes[:'checkout_request_type']
68
82
  end
69
83
 
70
- if attributes.key?(:'type')
71
- self.type = attributes[:'type']
84
+ if attributes.key?(:'id')
85
+ self.id = attributes[:'id']
72
86
  end
73
87
  end
74
88
 
@@ -92,8 +106,10 @@ module DigitalFemsa
92
106
  def ==(o)
93
107
  return true if self.equal?(o)
94
108
  self.class == o.class &&
95
- redirect_to_url == o.redirect_to_url &&
96
- type == o.type
109
+ segment == o.segment &&
110
+ checkout_request_id == o.checkout_request_id &&
111
+ checkout_request_type == o.checkout_request_type &&
112
+ id == o.id
97
113
  end
98
114
 
99
115
  # @see the `==` method
@@ -105,7 +121,7 @@ module DigitalFemsa
105
121
  # Calculates hash code according to all attributes.
106
122
  # @return [Integer] Hash code
107
123
  def hash
108
- [redirect_to_url, type].hash
124
+ [segment, checkout_request_id, checkout_request_type, id].hash
109
125
  end
110
126
 
111
127
  # Builds the object from hash
@@ -14,13 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # Payment method used in the charge. Go to the [payment methods](https://developers.femsa.com/reference/m%C3%A9todos-de-pago) section for more details
17
+ # Payment method used in the charge.
18
18
  class ChargeRequestPaymentMethod
19
- # Method expiration date as unix timestamp
19
+ # Method expiration date as unix timestamp (applies to some payment methods, e.g. cash).
20
20
  attr_accessor :expires_at
21
21
 
22
22
  attr_accessor :type
23
23
 
24
+ # Identifier of a saved payment source to be used for this charge (if applicable).
24
25
  attr_accessor :payment_source_id
25
26
 
26
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -52,6 +52,8 @@ module DigitalFemsa
52
52
 
53
53
  attr_accessor :status
54
54
 
55
+ attr_accessor :is_refundable
56
+
55
57
  # Attribute mapping from ruby-style variable name to JSON key.
56
58
  def self.attribute_map
57
59
  {
@@ -72,7 +74,8 @@ module DigitalFemsa
72
74
  :'payment_method' => :'payment_method',
73
75
  :'reference_id' => :'reference_id',
74
76
  :'refunds' => :'refunds',
75
- :'status' => :'status'
77
+ :'status' => :'status',
78
+ :'is_refundable' => :'is_refundable'
76
79
  }
77
80
  end
78
81
 
@@ -101,13 +104,16 @@ module DigitalFemsa
101
104
  :'payment_method' => :'ChargeResponsePaymentMethod',
102
105
  :'reference_id' => :'String',
103
106
  :'refunds' => :'ChargeResponseRefunds',
104
- :'status' => :'String'
107
+ :'status' => :'String',
108
+ :'is_refundable' => :'Boolean'
105
109
  }
106
110
  end
107
111
 
108
112
  # List of attributes with nullable: true
109
113
  def self.openapi_nullable
110
114
  Set.new([
115
+ :'failure_code',
116
+ :'failure_message',
111
117
  :'paid_at',
112
118
  :'reference_id',
113
119
  :'refunds',
@@ -200,6 +206,10 @@ module DigitalFemsa
200
206
  if attributes.key?(:'status')
201
207
  self.status = attributes[:'status']
202
208
  end
209
+
210
+ if attributes.key?(:'is_refundable')
211
+ self.is_refundable = attributes[:'is_refundable']
212
+ end
203
213
  end
204
214
 
205
215
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -239,7 +249,8 @@ module DigitalFemsa
239
249
  payment_method == o.payment_method &&
240
250
  reference_id == o.reference_id &&
241
251
  refunds == o.refunds &&
242
- status == o.status
252
+ status == o.status &&
253
+ is_refundable == o.is_refundable
243
254
  end
244
255
 
245
256
  # @see the `==` method
@@ -251,7 +262,7 @@ module DigitalFemsa
251
262
  # Calculates hash code according to all attributes.
252
263
  # @return [Integer] Hash code
253
264
  def hash
254
- [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status].hash
265
+ [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status, is_refundable].hash
255
266
  end
256
267
 
257
268
  # Builds the object from hash
@@ -31,6 +31,11 @@ module DigitalFemsa
31
31
  # refund status
32
32
  attr_accessor :status
33
33
 
34
+ attr_accessor :payout_id
35
+
36
+ # payout reference for oxxo stores
37
+ attr_accessor :reference
38
+
34
39
  # Attribute mapping from ruby-style variable name to JSON key.
35
40
  def self.attribute_map
36
41
  {
@@ -40,7 +45,9 @@ module DigitalFemsa
40
45
  :'expires_at' => :'expires_at',
41
46
  :'id' => :'id',
42
47
  :'object' => :'object',
43
- :'status' => :'status'
48
+ :'status' => :'status',
49
+ :'payout_id' => :'payout_id',
50
+ :'reference' => :'reference'
44
51
  }
45
52
  end
46
53
 
@@ -58,7 +65,9 @@ module DigitalFemsa
58
65
  :'expires_at' => :'Integer',
59
66
  :'id' => :'String',
60
67
  :'object' => :'String',
61
- :'status' => :'String'
68
+ :'status' => :'String',
69
+ :'payout_id' => :'String',
70
+ :'reference' => :'String'
62
71
  }
63
72
  end
64
73
 
@@ -118,6 +127,14 @@ module DigitalFemsa
118
127
  if attributes.key?(:'status')
119
128
  self.status = attributes[:'status']
120
129
  end
130
+
131
+ if attributes.key?(:'payout_id')
132
+ self.payout_id = attributes[:'payout_id']
133
+ end
134
+
135
+ if attributes.key?(:'reference')
136
+ self.reference = attributes[:'reference']
137
+ end
121
138
  end
122
139
 
123
140
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -166,7 +183,9 @@ module DigitalFemsa
166
183
  expires_at == o.expires_at &&
167
184
  id == o.id &&
168
185
  object == o.object &&
169
- status == o.status
186
+ status == o.status &&
187
+ payout_id == o.payout_id &&
188
+ reference == o.reference
170
189
  end
171
190
 
172
191
  # @see the `==` method
@@ -178,7 +197,7 @@ module DigitalFemsa
178
197
  # Calculates hash code according to all attributes.
179
198
  # @return [Integer] Hash code
180
199
  def hash
181
- [amount, auth_code, created_at, expires_at, id, object, status].hash
200
+ [amount, auth_code, created_at, expires_at, id, object, status, payout_id, reference].hash
182
201
  end
183
202
 
184
203
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # requested field for update a charge
17
+ # Request body to update a charge. Only `reference_id` can be updated.
18
18
  class ChargeUpdateRequest
19
19
  # custom reference id
20
20
  attr_accessor :reference_id
@@ -52,6 +52,8 @@ module DigitalFemsa
52
52
 
53
53
  attr_accessor :status
54
54
 
55
+ attr_accessor :is_refundable
56
+
55
57
  # Attribute mapping from ruby-style variable name to JSON key.
56
58
  def self.attribute_map
57
59
  {
@@ -72,7 +74,8 @@ module DigitalFemsa
72
74
  :'payment_method' => :'payment_method',
73
75
  :'reference_id' => :'reference_id',
74
76
  :'refunds' => :'refunds',
75
- :'status' => :'status'
77
+ :'status' => :'status',
78
+ :'is_refundable' => :'is_refundable'
76
79
  }
77
80
  end
78
81
 
@@ -101,13 +104,16 @@ module DigitalFemsa
101
104
  :'payment_method' => :'ChargeResponsePaymentMethod',
102
105
  :'reference_id' => :'String',
103
106
  :'refunds' => :'ChargeResponseRefunds',
104
- :'status' => :'String'
107
+ :'status' => :'String',
108
+ :'is_refundable' => :'Boolean'
105
109
  }
106
110
  end
107
111
 
108
112
  # List of attributes with nullable: true
109
113
  def self.openapi_nullable
110
114
  Set.new([
115
+ :'failure_code',
116
+ :'failure_message',
111
117
  :'paid_at',
112
118
  :'reference_id',
113
119
  :'refunds',
@@ -207,6 +213,10 @@ module DigitalFemsa
207
213
  if attributes.key?(:'status')
208
214
  self.status = attributes[:'status']
209
215
  end
216
+
217
+ if attributes.key?(:'is_refundable')
218
+ self.is_refundable = attributes[:'is_refundable']
219
+ end
210
220
  end
211
221
 
212
222
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -246,7 +256,8 @@ module DigitalFemsa
246
256
  payment_method == o.payment_method &&
247
257
  reference_id == o.reference_id &&
248
258
  refunds == o.refunds &&
249
- status == o.status
259
+ status == o.status &&
260
+ is_refundable == o.is_refundable
250
261
  end
251
262
 
252
263
  # @see the `==` method
@@ -258,7 +269,7 @@ module DigitalFemsa
258
269
  # Calculates hash code according to all attributes.
259
270
  # @return [Integer] Hash code
260
271
  def hash
261
- [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status].hash
272
+ [amount, channel, created_at, currency, customer_id, description, device_fingerprint, failure_code, failure_message, id, livemode, object, order_id, paid_at, payment_method, reference_id, refunds, status, is_refundable].hash
262
273
  end
263
274
 
264
275
  # Builds the object from hash