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
@@ -27,6 +27,9 @@ module DigitalFemsa
27
27
  # Method of shipment
28
28
  attr_accessor :method
29
29
 
30
+ # Shipping line description
31
+ attr_accessor :description
32
+
30
33
  # Hash where the user can send additional information for each 'shipping'.
31
34
  attr_accessor :metadata
32
35
 
@@ -43,6 +46,7 @@ module DigitalFemsa
43
46
  :'carrier' => :'carrier',
44
47
  :'tracking_number' => :'tracking_number',
45
48
  :'method' => :'method',
49
+ :'description' => :'description',
46
50
  :'metadata' => :'metadata',
47
51
  :'id' => :'id',
48
52
  :'object' => :'object',
@@ -62,6 +66,7 @@ module DigitalFemsa
62
66
  :'carrier' => :'String',
63
67
  :'tracking_number' => :'String',
64
68
  :'method' => :'String',
69
+ :'description' => :'String',
65
70
  :'metadata' => :'Hash<String, Object>',
66
71
  :'id' => :'String',
67
72
  :'object' => :'String',
@@ -115,6 +120,10 @@ module DigitalFemsa
115
120
  self.method = attributes[:'method']
116
121
  end
117
122
 
123
+ if attributes.key?(:'description')
124
+ self.description = attributes[:'description']
125
+ end
126
+
118
127
  if attributes.key?(:'metadata')
119
128
  if (value = attributes[:'metadata']).is_a?(Hash)
120
129
  self.metadata = value
@@ -201,6 +210,7 @@ module DigitalFemsa
201
210
  carrier == o.carrier &&
202
211
  tracking_number == o.tracking_number &&
203
212
  method == o.method &&
213
+ description == o.description &&
204
214
  metadata == o.metadata &&
205
215
  id == o.id &&
206
216
  object == o.object &&
@@ -216,7 +226,7 @@ module DigitalFemsa
216
226
  # Calculates hash code according to all attributes.
217
227
  # @return [Integer] Hash code
218
228
  def hash
219
- [amount, carrier, tracking_number, method, metadata, id, object, parent_id].hash
229
+ [amount, carrier, tracking_number, method, description, metadata, id, object, parent_id].hash
220
230
  end
221
231
 
222
232
  # Builds the object from hash
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
+ # Shipping line request payload.
17
18
  class ShippingRequest
18
19
  # Shipping amount in cents
19
20
  attr_accessor :amount
@@ -27,6 +28,9 @@ module DigitalFemsa
27
28
  # Method of shipment
28
29
  attr_accessor :method
29
30
 
31
+ # Shipping line description
32
+ attr_accessor :description
33
+
30
34
  # Hash where the user can send additional information for each 'shipping'.
31
35
  attr_accessor :metadata
32
36
 
@@ -37,6 +41,7 @@ module DigitalFemsa
37
41
  :'carrier' => :'carrier',
38
42
  :'tracking_number' => :'tracking_number',
39
43
  :'method' => :'method',
44
+ :'description' => :'description',
40
45
  :'metadata' => :'metadata'
41
46
  }
42
47
  end
@@ -53,6 +58,7 @@ module DigitalFemsa
53
58
  :'carrier' => :'String',
54
59
  :'tracking_number' => :'String',
55
60
  :'method' => :'String',
61
+ :'description' => :'String',
56
62
  :'metadata' => :'Hash<String, Object>'
57
63
  }
58
64
  end
@@ -96,6 +102,10 @@ module DigitalFemsa
96
102
  self.method = attributes[:'method']
97
103
  end
98
104
 
105
+ if attributes.key?(:'description')
106
+ self.description = attributes[:'description']
107
+ end
108
+
99
109
  if attributes.key?(:'metadata')
100
110
  if (value = attributes[:'metadata']).is_a?(Hash)
101
111
  self.metadata = value
@@ -170,6 +180,7 @@ module DigitalFemsa
170
180
  carrier == o.carrier &&
171
181
  tracking_number == o.tracking_number &&
172
182
  method == o.method &&
183
+ description == o.description &&
173
184
  metadata == o.metadata
174
185
  end
175
186
 
@@ -182,7 +193,7 @@ module DigitalFemsa
182
193
  # Calculates hash code according to all attributes.
183
194
  # @return [Integer] Hash code
184
195
  def hash
185
- [amount, carrier, tracking_number, method, metadata].hash
196
+ [amount, carrier, tracking_number, method, description, metadata].hash
186
197
  end
187
198
 
188
199
  # Builds the object from hash
@@ -14,55 +14,89 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # The Transaction object represents the actions or steps of an order. Statuses can be: unprocessed, pending, available, owen, paid_out, voided, capture, capture_reversal, liquidation, liquidation_reversal, payout, payout_reversal, refund, refund_reversal, chargeback, chargeback_reversal, rounding_adjustment, won_chargeback, transferred, and transferred.
17
+ # Transaction object.
18
18
  class TransactionResponse
19
+ # Unique identifier of the transaction.
20
+ attr_accessor :id
21
+
22
+ # Object name, which is transaction.
23
+ attr_accessor :object
24
+
19
25
  # The amount of the transaction.
20
26
  attr_accessor :amount
21
27
 
22
- # Randomly assigned unique order identifier associated with the charge.
23
- attr_accessor :charge
28
+ # The amount to be deducted for taxes and commissions.
29
+ attr_accessor :fee
24
30
 
25
- # Date and time of creation of the transaction in Unix format.
26
- attr_accessor :created_at
31
+ # The net amount after deducting commissions and taxes.
32
+ attr_accessor :net
27
33
 
28
- # The currency of the transaction. It uses the 3-letter code of the [International Standard ISO 4217.](https://es.wikipedia.org/wiki/ISO_4217)
34
+ # The currency of the transaction. It uses the 3-letter code of ISO 4217.
29
35
  attr_accessor :currency
30
36
 
31
- # The amount to be deducted for taxes and commissions.
32
- attr_accessor :fee
37
+ # Code indicating transaction status.
38
+ attr_accessor :status
33
39
 
34
- # Unique identifier of the transaction.
35
- attr_accessor :id
40
+ # Transaction type.
41
+ attr_accessor :type
42
+
43
+ # Date and time of creation of the transaction in Unix format.
44
+ attr_accessor :created_at
36
45
 
37
46
  # Indicates whether the transaction was created in live mode or test mode.
38
47
  attr_accessor :livemode
39
48
 
40
- # The net amount after deducting commissions and taxes.
41
- attr_accessor :net
49
+ # Charge ID associated with the transaction (present only if the transaction belongs to a charge).
50
+ attr_accessor :charge
42
51
 
43
- # Object name, which is transaction.
44
- attr_accessor :object
52
+ # Transfer ID associated with the transaction (present only if the transaction belongs to a transfer).
53
+ attr_accessor :transfer
45
54
 
46
- # Code indicating transaction status.
47
- attr_accessor :status
55
+ # Date and time when the transaction was transferred, in Unix format.
56
+ attr_accessor :transferred_at
48
57
 
49
- # Transaction Type
50
- attr_accessor :type
58
+ # Transaction fee formula identifier (if available).
59
+ attr_accessor :formula
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
51
82
 
52
83
  # Attribute mapping from ruby-style variable name to JSON key.
53
84
  def self.attribute_map
54
85
  {
86
+ :'id' => :'id',
87
+ :'object' => :'object',
55
88
  :'amount' => :'amount',
56
- :'charge' => :'charge',
57
- :'created_at' => :'created_at',
58
- :'currency' => :'currency',
59
89
  :'fee' => :'fee',
60
- :'id' => :'id',
61
- :'livemode' => :'livemode',
62
90
  :'net' => :'net',
63
- :'object' => :'object',
91
+ :'currency' => :'currency',
64
92
  :'status' => :'status',
65
- :'type' => :'type'
93
+ :'type' => :'type',
94
+ :'created_at' => :'created_at',
95
+ :'livemode' => :'livemode',
96
+ :'charge' => :'charge',
97
+ :'transfer' => :'transfer',
98
+ :'transferred_at' => :'transferred_at',
99
+ :'formula' => :'formula'
66
100
  }
67
101
  end
68
102
 
@@ -74,23 +108,30 @@ module DigitalFemsa
74
108
  # Attribute type mapping.
75
109
  def self.openapi_types
76
110
  {
111
+ :'id' => :'String',
112
+ :'object' => :'String',
77
113
  :'amount' => :'Integer',
78
- :'charge' => :'String',
79
- :'created_at' => :'Integer',
80
- :'currency' => :'String',
81
114
  :'fee' => :'Integer',
82
- :'id' => :'String',
83
- :'livemode' => :'Boolean',
84
115
  :'net' => :'Integer',
85
- :'object' => :'String',
116
+ :'currency' => :'String',
86
117
  :'status' => :'String',
87
- :'type' => :'String'
118
+ :'type' => :'String',
119
+ :'created_at' => :'Integer',
120
+ :'livemode' => :'Boolean',
121
+ :'charge' => :'String',
122
+ :'transfer' => :'String',
123
+ :'transferred_at' => :'Integer',
124
+ :'formula' => :'String'
88
125
  }
89
126
  end
90
127
 
91
128
  # List of attributes with nullable: true
92
129
  def self.openapi_nullable
93
130
  Set.new([
131
+ :'charge',
132
+ :'transfer',
133
+ :'transferred_at',
134
+ :'formula'
94
135
  ])
95
136
  end
96
137
 
@@ -109,28 +150,22 @@ module DigitalFemsa
109
150
  h[k.to_sym] = v
110
151
  }
111
152
 
112
- if attributes.key?(:'amount')
113
- self.amount = attributes[:'amount']
114
- else
115
- self.amount = nil
116
- end
117
-
118
- if attributes.key?(:'charge')
119
- self.charge = attributes[:'charge']
153
+ if attributes.key?(:'id')
154
+ self.id = attributes[:'id']
120
155
  else
121
- self.charge = nil
156
+ self.id = nil
122
157
  end
123
158
 
124
- if attributes.key?(:'created_at')
125
- self.created_at = attributes[:'created_at']
159
+ if attributes.key?(:'object')
160
+ self.object = attributes[:'object']
126
161
  else
127
- self.created_at = nil
162
+ self.object = nil
128
163
  end
129
164
 
130
- if attributes.key?(:'currency')
131
- self.currency = attributes[:'currency']
165
+ if attributes.key?(:'amount')
166
+ self.amount = attributes[:'amount']
132
167
  else
133
- self.currency = nil
168
+ self.amount = nil
134
169
  end
135
170
 
136
171
  if attributes.key?(:'fee')
@@ -139,28 +174,16 @@ module DigitalFemsa
139
174
  self.fee = nil
140
175
  end
141
176
 
142
- if attributes.key?(:'id')
143
- self.id = attributes[:'id']
144
- else
145
- self.id = nil
146
- end
147
-
148
- if attributes.key?(:'livemode')
149
- self.livemode = attributes[:'livemode']
150
- else
151
- self.livemode = nil
152
- end
153
-
154
177
  if attributes.key?(:'net')
155
178
  self.net = attributes[:'net']
156
179
  else
157
180
  self.net = nil
158
181
  end
159
182
 
160
- if attributes.key?(:'object')
161
- self.object = attributes[:'object']
183
+ if attributes.key?(:'currency')
184
+ self.currency = attributes[:'currency']
162
185
  else
163
- self.object = nil
186
+ self.currency = nil
164
187
  end
165
188
 
166
189
  if attributes.key?(:'status')
@@ -174,51 +197,67 @@ module DigitalFemsa
174
197
  else
175
198
  self.type = nil
176
199
  end
177
- end
178
200
 
179
- # Show invalid properties with the reasons. Usually used together with valid?
180
- # @return Array for valid properties with the reasons
181
- def list_invalid_properties
182
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
- invalid_properties = Array.new
184
- if @amount.nil?
185
- invalid_properties.push('invalid value for "amount", amount cannot be nil.')
201
+ if attributes.key?(:'created_at')
202
+ self.created_at = attributes[:'created_at']
203
+ else
204
+ self.created_at = nil
186
205
  end
187
206
 
188
- if @charge.nil?
189
- invalid_properties.push('invalid value for "charge", charge cannot be nil.')
207
+ if attributes.key?(:'livemode')
208
+ self.livemode = attributes[:'livemode']
209
+ else
210
+ self.livemode = nil
190
211
  end
191
212
 
192
- if @created_at.nil?
193
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
213
+ if attributes.key?(:'charge')
214
+ self.charge = attributes[:'charge']
194
215
  end
195
216
 
196
- if @currency.nil?
197
- invalid_properties.push('invalid value for "currency", currency cannot be nil.')
217
+ if attributes.key?(:'transfer')
218
+ self.transfer = attributes[:'transfer']
198
219
  end
199
220
 
200
- if @currency.to_s.length > 3
201
- invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
221
+ if attributes.key?(:'transferred_at')
222
+ self.transferred_at = attributes[:'transferred_at']
202
223
  end
203
224
 
204
- if @fee.nil?
205
- invalid_properties.push('invalid value for "fee", fee cannot be nil.')
225
+ if attributes.key?(:'formula')
226
+ self.formula = attributes[:'formula']
206
227
  end
228
+ end
207
229
 
230
+ # Show invalid properties with the reasons. Usually used together with valid?
231
+ # @return Array for valid properties with the reasons
232
+ def list_invalid_properties
233
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
234
+ invalid_properties = Array.new
208
235
  if @id.nil?
209
236
  invalid_properties.push('invalid value for "id", id cannot be nil.')
210
237
  end
211
238
 
212
- if @livemode.nil?
213
- invalid_properties.push('invalid value for "livemode", livemode cannot be nil.')
239
+ if @object.nil?
240
+ invalid_properties.push('invalid value for "object", object cannot be nil.')
241
+ end
242
+
243
+ if @amount.nil?
244
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
245
+ end
246
+
247
+ if @fee.nil?
248
+ invalid_properties.push('invalid value for "fee", fee cannot be nil.')
214
249
  end
215
250
 
216
251
  if @net.nil?
217
252
  invalid_properties.push('invalid value for "net", net cannot be nil.')
218
253
  end
219
254
 
220
- if @object.nil?
221
- invalid_properties.push('invalid value for "object", object cannot be nil.')
255
+ if @currency.nil?
256
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
257
+ end
258
+
259
+ if @currency.to_s.length > 3
260
+ invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
222
261
  end
223
262
 
224
263
  if @status.nil?
@@ -229,6 +268,14 @@ module DigitalFemsa
229
268
  invalid_properties.push('invalid value for "type", type cannot be nil.')
230
269
  end
231
270
 
271
+ if @created_at.nil?
272
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
273
+ end
274
+
275
+ if @livemode.nil?
276
+ invalid_properties.push('invalid value for "livemode", livemode cannot be nil.')
277
+ end
278
+
232
279
  invalid_properties
233
280
  end
234
281
 
@@ -236,18 +283,21 @@ module DigitalFemsa
236
283
  # @return true if the model is valid
237
284
  def valid?
238
285
  warn '[DEPRECATED] the `valid?` method is obsolete'
286
+ return false if @id.nil?
287
+ return false if @object.nil?
239
288
  return false if @amount.nil?
240
- return false if @charge.nil?
241
- return false if @created_at.nil?
242
- return false if @currency.nil?
243
- return false if @currency.to_s.length > 3
244
289
  return false if @fee.nil?
245
- return false if @id.nil?
246
- return false if @livemode.nil?
247
290
  return false if @net.nil?
248
- return false if @object.nil?
291
+ return false if @currency.nil?
292
+ return false if @currency.to_s.length > 3
249
293
  return false if @status.nil?
294
+ status_validator = EnumAttributeValidator.new('String', ["unprocessed", "pending", "available", "owing", "paid_out", "on_hold", "retained", "voided"])
295
+ return false unless status_validator.valid?(@status)
250
296
  return false if @type.nil?
297
+ type_validator = EnumAttributeValidator.new('String', ["capture", "capture_reversal", "liquidation", "liquidation_reversal", "payout", "payout_reversal", "refund", "refund_reversal", "rounding_adjustment", "transfer", "transferred", "retention", "temporary_retention", "cashout_retention", "cashout_confirmation", "cashout_cancelation", "autofund_capture"])
298
+ return false unless type_validator.valid?(@type)
299
+ return false if @created_at.nil?
300
+ return false if @livemode.nil?
251
301
  true
252
302
  end
253
303
 
@@ -265,22 +315,45 @@ module DigitalFemsa
265
315
  @currency = currency
266
316
  end
267
317
 
318
+ # Custom attribute writer method checking allowed values (enum).
319
+ # @param [Object] status Object to be assigned
320
+ def status=(status)
321
+ validator = EnumAttributeValidator.new('String', ["unprocessed", "pending", "available", "owing", "paid_out", "on_hold", "retained", "voided"])
322
+ unless validator.valid?(status)
323
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
324
+ end
325
+ @status = status
326
+ end
327
+
328
+ # Custom attribute writer method checking allowed values (enum).
329
+ # @param [Object] type Object to be assigned
330
+ def type=(type)
331
+ validator = EnumAttributeValidator.new('String', ["capture", "capture_reversal", "liquidation", "liquidation_reversal", "payout", "payout_reversal", "refund", "refund_reversal", "rounding_adjustment", "transfer", "transferred", "retention", "temporary_retention", "cashout_retention", "cashout_confirmation", "cashout_cancelation", "autofund_capture"])
332
+ unless validator.valid?(type)
333
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
334
+ end
335
+ @type = type
336
+ end
337
+
268
338
  # Checks equality by comparing each attribute.
269
339
  # @param [Object] Object to be compared
270
340
  def ==(o)
271
341
  return true if self.equal?(o)
272
342
  self.class == o.class &&
343
+ id == o.id &&
344
+ object == o.object &&
273
345
  amount == o.amount &&
274
- charge == o.charge &&
275
- created_at == o.created_at &&
276
- currency == o.currency &&
277
346
  fee == o.fee &&
278
- id == o.id &&
279
- livemode == o.livemode &&
280
347
  net == o.net &&
281
- object == o.object &&
348
+ currency == o.currency &&
282
349
  status == o.status &&
283
- type == o.type
350
+ type == o.type &&
351
+ created_at == o.created_at &&
352
+ livemode == o.livemode &&
353
+ charge == o.charge &&
354
+ transfer == o.transfer &&
355
+ transferred_at == o.transferred_at &&
356
+ formula == o.formula
284
357
  end
285
358
 
286
359
  # @see the `==` method
@@ -292,7 +365,7 @@ module DigitalFemsa
292
365
  # Calculates hash code according to all attributes.
293
366
  # @return [Integer] Hash code
294
367
  def hash
295
- [amount, charge, created_at, currency, fee, id, livemode, net, object, status, type].hash
368
+ [id, object, amount, fee, net, currency, status, type, created_at, livemode, charge, transfer, transferred_at, formula].hash
296
369
  end
297
370
 
298
371
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # A transfer represents the action of sending an amount to a business bank account including the status, amount and method used to make the transfer.
17
+ # A transfer represents the action of sending an amount to a business bank account including the status, amount and destination used to make the transfer.
18
18
  class TransfersResponse
19
19
  # Amount in cents of the transfer.
20
20
  attr_accessor :amount