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.
- checksums.yaml +4 -4
- data/Makefile +14 -0
- data/README.md +28 -33
- data/VERSION +1 -1
- data/config-ruby.json +1 -1
- data/docs/ApiKeyCreateResponse.md +1 -1
- data/docs/ApiKeyRequest.md +2 -2
- data/docs/ApiKeyResponseOnDelete.md +2 -2
- data/docs/ApiKeysApi.md +10 -10
- data/docs/BalanceResponse.md +8 -8
- data/docs/BalancesApi.md +1 -1
- data/docs/ChargeOrderResponse.md +1 -1
- data/docs/ChargeOrderResponseChannel.md +24 -0
- data/docs/ChargeRequest.md +1 -1
- data/docs/ChargeRequestPaymentMethod.md +3 -3
- data/docs/ChargeResponse.md +9 -7
- data/docs/ChargeResponseChannel.md +3 -3
- data/docs/ChargeResponseRefundsData.md +5 -1
- data/docs/ChargesApi.md +16 -12
- data/docs/ChargesDataResponse.md +9 -7
- data/docs/Checkout.md +17 -15
- data/docs/CheckoutOrderTemplate.md +3 -3
- data/docs/CheckoutResponse.md +1 -1
- data/docs/CreateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/Customer.md +13 -19
- data/docs/CustomerAddress.md +2 -2
- data/docs/CustomerFiscalEntitiesDataResponse.md +2 -2
- data/docs/CustomerFiscalEntitiesRequest.md +3 -3
- data/docs/CustomerInfo.md +4 -4
- data/docs/CustomerPaymentMethodRequest.md +1 -1
- data/docs/CustomerResponse.md +17 -21
- data/docs/CustomerShippingContactsResponse.md +5 -5
- data/docs/CustomersApi.md +15 -15
- data/docs/CustomersResponse.md +1 -1
- data/docs/DeleteApiKeysResponse.md +1 -1
- data/docs/DiscountsApi.md +9 -9
- data/docs/EventsApi.md +2 -2
- data/docs/EventsResendResponse.md +1 -1
- data/docs/GetChargesResponse.md +4 -4
- data/docs/GetTransactionsResponse.md +1 -1
- data/docs/LogsApi.md +1 -1
- data/docs/OrderFiscalEntityRequest.md +4 -4
- data/docs/OrderRefundRequest.md +7 -5
- data/docs/OrderRequest.md +17 -19
- data/docs/OrderResponse.md +37 -35
- data/docs/OrderResponseChannel.md +24 -0
- data/docs/OrderResponseShippingContact.md +4 -4
- data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
- data/docs/OrderUpdateRequest.md +19 -15
- data/docs/OrdersApi.md +16 -16
- data/docs/PaymentLinkApi.md +12 -82
- data/docs/PaymentMethodCash.md +4 -4
- data/docs/PaymentMethodCashRequest.md +2 -2
- data/docs/PaymentMethodsApi.md +5 -5
- data/docs/Product.md +10 -12
- data/docs/ProductDataResponse.md +9 -11
- data/docs/ProductOrderResponse.md +9 -11
- data/docs/ProductsApi.md +7 -7
- data/docs/ShippingContactsApi.md +9 -9
- data/docs/ShippingOrderResponse.md +5 -3
- data/docs/ShippingRequest.md +2 -0
- data/docs/ShippingsApi.md +7 -7
- data/docs/TaxesApi.md +7 -7
- data/docs/TransactionResponse.md +20 -14
- data/docs/TransactionsApi.md +6 -6
- data/docs/TransfersApi.md +10 -10
- data/docs/UpdateCustomer.md +17 -21
- data/docs/UpdateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/UpdateOrderTaxRequest.md +2 -2
- data/docs/UpdateProduct.md +7 -9
- data/docs/WebhookKeysApi.md +18 -14
- data/docs/WebhooksApi.md +28 -22
- data/lib/digital_femsa/api/api_keys_api.rb +8 -8
- data/lib/digital_femsa/api/balances_api.rb +2 -2
- data/lib/digital_femsa/api/charges_api.rb +13 -9
- data/lib/digital_femsa/api/customers_api.rb +12 -12
- data/lib/digital_femsa/api/discounts_api.rb +12 -12
- data/lib/digital_femsa/api/events_api.rb +4 -4
- data/lib/digital_femsa/api/logs_api.rb +2 -2
- data/lib/digital_femsa/api/orders_api.rb +20 -20
- data/lib/digital_femsa/api/payment_link_api.rb +10 -86
- data/lib/digital_femsa/api/payment_methods_api.rb +8 -8
- data/lib/digital_femsa/api/products_api.rb +10 -10
- data/lib/digital_femsa/api/shipping_contacts_api.rb +8 -8
- data/lib/digital_femsa/api/shippings_api.rb +10 -10
- data/lib/digital_femsa/api/taxes_api.rb +10 -10
- data/lib/digital_femsa/api/transactions_api.rb +6 -6
- data/lib/digital_femsa/api/transfers_api.rb +8 -8
- data/lib/digital_femsa/api/webhook_keys_api.rb +14 -10
- data/lib/digital_femsa/api/webhooks_api.rb +23 -16
- data/lib/digital_femsa/api_client.rb +9 -5
- data/lib/digital_femsa/models/api_key_create_response.rb +1 -1
- data/lib/digital_femsa/models/api_key_request.rb +36 -1
- data/lib/digital_femsa/models/balance_response.rb +9 -9
- data/lib/digital_femsa/models/charge_order_response.rb +1 -1
- data/lib/digital_femsa/models/{order_next_action_response.rb → charge_order_response_channel.rb} +34 -18
- data/lib/digital_femsa/models/charge_request_payment_method.rb +3 -2
- data/lib/digital_femsa/models/charge_response.rb +15 -4
- data/lib/digital_femsa/models/charge_response_refunds_data.rb +23 -4
- data/lib/digital_femsa/models/charge_update_request.rb +1 -1
- data/lib/digital_femsa/models/charges_data_response.rb +15 -4
- data/lib/digital_femsa/models/checkout.rb +97 -81
- data/lib/digital_femsa/models/checkout_order_template.rb +4 -4
- data/lib/digital_femsa/models/checkout_order_template_customer_info.rb +1 -1
- data/lib/digital_femsa/models/checkout_request.rb +1 -1
- data/lib/digital_femsa/models/checkout_response.rb +1 -1
- data/lib/digital_femsa/models/create_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/customer.rb +57 -95
- data/lib/digital_femsa/models/customer_address.rb +7 -0
- data/lib/digital_femsa/models/customer_fiscal_entities_data_response.rb +10 -10
- data/lib/digital_femsa/models/customer_fiscal_entities_request.rb +13 -13
- data/lib/digital_femsa/models/customer_info.rb +13 -20
- data/lib/digital_femsa/models/customer_payment_method_request.rb +2 -2
- data/lib/digital_femsa/models/customer_payment_sources_inner.rb +104 -0
- data/lib/digital_femsa/models/customer_response.rb +122 -113
- data/lib/digital_femsa/models/customer_shipping_contacts_response.rb +2 -0
- data/lib/digital_femsa/models/customers_response.rb +1 -0
- data/lib/digital_femsa/models/events_resend_response.rb +1 -1
- data/lib/digital_femsa/models/get_charges_response.rb +21 -21
- data/lib/digital_femsa/models/get_transactions_response.rb +1 -1
- data/lib/digital_femsa/models/log_response.rb +1 -1
- data/lib/digital_femsa/models/logs_response.rb +1 -1
- data/lib/digital_femsa/models/order_fiscal_entity_response.rb +1 -1
- data/lib/digital_femsa/models/order_refund_request.rb +59 -11
- data/lib/digital_femsa/models/order_request.rb +69 -79
- data/lib/digital_femsa/models/order_response.rb +187 -119
- data/lib/digital_femsa/models/{order_next_action_response_redirect_to_url.rb → order_response_channel.rb} +35 -19
- data/lib/digital_femsa/models/order_response_charges.rb +1 -1
- data/lib/digital_femsa/models/order_response_checkout.rb +1 -0
- data/lib/digital_femsa/models/order_response_customer_info.rb +1 -0
- data/lib/digital_femsa/models/order_response_shipping_contact.rb +3 -0
- data/lib/digital_femsa/models/order_update_fiscal_entity_request.rb +1 -1
- data/lib/digital_femsa/models/order_update_request.rb +106 -65
- data/lib/digital_femsa/models/payment_method_cash.rb +1 -1
- data/lib/digital_femsa/models/payment_method_cash_request.rb +2 -1
- data/lib/digital_femsa/models/product.rb +103 -95
- data/lib/digital_femsa/models/product_data_response.rb +103 -95
- data/lib/digital_femsa/models/product_order_response.rb +103 -95
- data/lib/digital_femsa/models/shipping_order_response.rb +11 -1
- data/lib/digital_femsa/models/shipping_request.rb +12 -1
- data/lib/digital_femsa/models/transaction_response.rb +172 -99
- data/lib/digital_femsa/models/transfers_response.rb +1 -1
- data/lib/digital_femsa/models/transfers_response_destination.rb +312 -0
- data/lib/digital_femsa/models/update_customer.rb +42 -85
- data/lib/digital_femsa/models/update_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/update_order_discount_lines_request.rb +34 -0
- data/lib/digital_femsa/models/update_order_tax_request.rb +2 -2
- data/lib/digital_femsa/models/update_payment_methods_amount.rb +105 -0
- data/lib/digital_femsa/models/update_payment_methods_expires_at.rb +105 -0
- data/lib/digital_femsa/models/update_product.rb +85 -58
- data/lib/digital_femsa/models/webhook_key_delete_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_key_request.rb +1 -0
- data/lib/digital_femsa/models/webhook_key_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_request.rb +1 -1
- data/lib/digital_femsa/models/webhook_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_update_request.rb +1 -1
- data/lib/digital_femsa/version.rb +1 -1
- data/lib/digital_femsa.rb +2 -6
- data/templates/ruby/api_client.mustache +8 -4
- metadata +26 -26
- data/docs/CustomerAntifraudInfo.md +0 -20
- data/docs/CustomerAntifraudInfoResponse.md +0 -20
- data/docs/OrderNextActionResponse.md +0 -20
- data/docs/OrderNextActionResponseRedirectToUrl.md +0 -20
- data/docs/SmsCheckoutRequest.md +0 -18
- data/docs/UpdateCustomerAntifraudInfo.md +0 -20
|
@@ -14,84 +14,105 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
# order
|
|
17
|
+
# Order model. Some nested resources are returned as list previews (for example: `charges`, `line_items`), and may be `null` depending on the request/context. The `checkout` field is only present when the order is linked to a checkout (`channel.checkout_request_id`).
|
|
18
18
|
class OrderResponse
|
|
19
|
-
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :object
|
|
22
|
+
|
|
23
|
+
attr_accessor :livemode
|
|
24
|
+
|
|
20
25
|
attr_accessor :amount
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
attr_accessor :currency
|
|
28
|
+
|
|
29
|
+
# Current payment status of the order. It can be `null` for orders without payment information yet.
|
|
30
|
+
attr_accessor :payment_status
|
|
31
|
+
|
|
23
32
|
attr_accessor :amount_refunded
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
# Indicates whether the order uses split payments (when available/configured).
|
|
35
|
+
attr_accessor :split_payment
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
# Metadata attached to the order.
|
|
38
|
+
attr_accessor :metadata
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
# Indicates whether the order is currently refundable.
|
|
41
|
+
attr_accessor :is_refundable
|
|
30
42
|
|
|
31
|
-
# The time at which the object was created in seconds since the Unix epoch
|
|
32
43
|
attr_accessor :created_at
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
attr_accessor :currency
|
|
45
|
+
attr_accessor :updated_at
|
|
36
46
|
|
|
37
47
|
attr_accessor :customer_info
|
|
38
48
|
|
|
39
|
-
attr_accessor :
|
|
49
|
+
attr_accessor :shipping_contact
|
|
40
50
|
|
|
41
|
-
attr_accessor :
|
|
51
|
+
attr_accessor :channel
|
|
42
52
|
|
|
43
|
-
attr_accessor :
|
|
53
|
+
attr_accessor :fiscal_entity
|
|
44
54
|
|
|
45
|
-
attr_accessor :
|
|
55
|
+
attr_accessor :checkout
|
|
46
56
|
|
|
47
57
|
attr_accessor :line_items
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
attr_accessor :livemode
|
|
51
|
-
|
|
52
|
-
# Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
|
53
|
-
attr_accessor :metadata
|
|
54
|
-
|
|
55
|
-
attr_accessor :next_action
|
|
56
|
-
|
|
57
|
-
# String representing the object’s type. Objects of the same type share the same value.
|
|
58
|
-
attr_accessor :object
|
|
59
|
-
|
|
60
|
-
# The payment status of the order.
|
|
61
|
-
attr_accessor :payment_status
|
|
59
|
+
attr_accessor :discount_lines
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
attr_accessor :processing_mode
|
|
61
|
+
attr_accessor :charges
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
# Partial reference information (when applicable). Structure may vary depending on the payment flow.
|
|
64
|
+
attr_accessor :partial_reference
|
|
65
|
+
|
|
66
|
+
# Additional payment information (when available). Structure may vary.
|
|
67
|
+
attr_accessor :payments_info
|
|
68
|
+
|
|
69
|
+
class EnumAttributeValidator
|
|
70
|
+
attr_reader :datatype
|
|
71
|
+
attr_reader :allowable_values
|
|
72
|
+
|
|
73
|
+
def initialize(datatype, allowable_values)
|
|
74
|
+
@allowable_values = allowable_values.map do |value|
|
|
75
|
+
case datatype.to_s
|
|
76
|
+
when /Integer/i
|
|
77
|
+
value.to_i
|
|
78
|
+
when /Float/i
|
|
79
|
+
value.to_f
|
|
80
|
+
else
|
|
81
|
+
value
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
67
85
|
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
def valid?(value)
|
|
87
|
+
!value || allowable_values.include?(value)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
70
90
|
|
|
71
91
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
72
92
|
def self.attribute_map
|
|
73
93
|
{
|
|
94
|
+
:'id' => :'id',
|
|
95
|
+
:'object' => :'object',
|
|
96
|
+
:'livemode' => :'livemode',
|
|
74
97
|
:'amount' => :'amount',
|
|
98
|
+
:'currency' => :'currency',
|
|
99
|
+
:'payment_status' => :'payment_status',
|
|
75
100
|
:'amount_refunded' => :'amount_refunded',
|
|
76
|
-
:'
|
|
77
|
-
:'
|
|
78
|
-
:'
|
|
101
|
+
:'split_payment' => :'split_payment',
|
|
102
|
+
:'metadata' => :'metadata',
|
|
103
|
+
:'is_refundable' => :'is_refundable',
|
|
79
104
|
:'created_at' => :'created_at',
|
|
80
|
-
:'
|
|
105
|
+
:'updated_at' => :'updated_at',
|
|
81
106
|
:'customer_info' => :'customer_info',
|
|
82
|
-
:'
|
|
107
|
+
:'shipping_contact' => :'shipping_contact',
|
|
108
|
+
:'channel' => :'channel',
|
|
83
109
|
:'fiscal_entity' => :'fiscal_entity',
|
|
84
|
-
:'
|
|
85
|
-
:'is_refundable' => :'is_refundable',
|
|
110
|
+
:'checkout' => :'checkout',
|
|
86
111
|
:'line_items' => :'line_items',
|
|
87
|
-
:'
|
|
88
|
-
:'
|
|
89
|
-
:'
|
|
90
|
-
:'
|
|
91
|
-
:'payment_status' => :'payment_status',
|
|
92
|
-
:'processing_mode' => :'processing_mode',
|
|
93
|
-
:'shipping_contact' => :'shipping_contact',
|
|
94
|
-
:'updated_at' => :'updated_at'
|
|
112
|
+
:'discount_lines' => :'discount_lines',
|
|
113
|
+
:'charges' => :'charges',
|
|
114
|
+
:'partial_reference' => :'partial_reference',
|
|
115
|
+
:'payments_info' => :'payments_info'
|
|
95
116
|
}
|
|
96
117
|
end
|
|
97
118
|
|
|
@@ -103,34 +124,41 @@ module DigitalFemsa
|
|
|
103
124
|
# Attribute type mapping.
|
|
104
125
|
def self.openapi_types
|
|
105
126
|
{
|
|
127
|
+
:'id' => :'String',
|
|
128
|
+
:'object' => :'String',
|
|
129
|
+
:'livemode' => :'Boolean',
|
|
106
130
|
:'amount' => :'Integer',
|
|
131
|
+
:'currency' => :'String',
|
|
132
|
+
:'payment_status' => :'String',
|
|
107
133
|
:'amount_refunded' => :'Integer',
|
|
108
|
-
:'
|
|
109
|
-
:'
|
|
110
|
-
:'
|
|
134
|
+
:'split_payment' => :'Boolean',
|
|
135
|
+
:'metadata' => :'Hash<String, Object>',
|
|
136
|
+
:'is_refundable' => :'Boolean',
|
|
111
137
|
:'created_at' => :'Integer',
|
|
112
|
-
:'
|
|
138
|
+
:'updated_at' => :'Integer',
|
|
113
139
|
:'customer_info' => :'OrderResponseCustomerInfo',
|
|
114
|
-
:'
|
|
140
|
+
:'shipping_contact' => :'OrderResponseShippingContact',
|
|
141
|
+
:'channel' => :'OrderResponseChannel',
|
|
115
142
|
:'fiscal_entity' => :'OrderFiscalEntityResponse',
|
|
116
|
-
:'
|
|
117
|
-
:'is_refundable' => :'Boolean',
|
|
143
|
+
:'checkout' => :'OrderResponseCheckout',
|
|
118
144
|
:'line_items' => :'OrderResponseProducts',
|
|
119
|
-
:'
|
|
120
|
-
:'
|
|
121
|
-
:'
|
|
122
|
-
:'
|
|
123
|
-
:'payment_status' => :'String',
|
|
124
|
-
:'processing_mode' => :'String',
|
|
125
|
-
:'shipping_contact' => :'OrderResponseShippingContact',
|
|
126
|
-
:'updated_at' => :'Integer'
|
|
145
|
+
:'discount_lines' => :'OrderResponseDiscountLines',
|
|
146
|
+
:'charges' => :'OrderResponseCharges',
|
|
147
|
+
:'partial_reference' => :'Hash<String, Object>',
|
|
148
|
+
:'payments_info' => :'Hash<String, Object>'
|
|
127
149
|
}
|
|
128
150
|
end
|
|
129
151
|
|
|
130
152
|
# List of attributes with nullable: true
|
|
131
153
|
def self.openapi_nullable
|
|
132
154
|
Set.new([
|
|
155
|
+
:'payment_status',
|
|
156
|
+
:'split_payment',
|
|
157
|
+
:'shipping_contact',
|
|
158
|
+
:'channel',
|
|
133
159
|
:'fiscal_entity',
|
|
160
|
+
:'partial_reference',
|
|
161
|
+
:'payments_info'
|
|
134
162
|
])
|
|
135
163
|
end
|
|
136
164
|
|
|
@@ -149,90 +177,98 @@ module DigitalFemsa
|
|
|
149
177
|
h[k.to_sym] = v
|
|
150
178
|
}
|
|
151
179
|
|
|
180
|
+
if attributes.key?(:'id')
|
|
181
|
+
self.id = attributes[:'id']
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'object')
|
|
185
|
+
self.object = attributes[:'object']
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'livemode')
|
|
189
|
+
self.livemode = attributes[:'livemode']
|
|
190
|
+
end
|
|
191
|
+
|
|
152
192
|
if attributes.key?(:'amount')
|
|
153
193
|
self.amount = attributes[:'amount']
|
|
154
194
|
end
|
|
155
195
|
|
|
196
|
+
if attributes.key?(:'currency')
|
|
197
|
+
self.currency = attributes[:'currency']
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'payment_status')
|
|
201
|
+
self.payment_status = attributes[:'payment_status']
|
|
202
|
+
end
|
|
203
|
+
|
|
156
204
|
if attributes.key?(:'amount_refunded')
|
|
157
205
|
self.amount_refunded = attributes[:'amount_refunded']
|
|
158
206
|
end
|
|
159
207
|
|
|
160
|
-
if attributes.key?(:'
|
|
161
|
-
self.
|
|
208
|
+
if attributes.key?(:'split_payment')
|
|
209
|
+
self.split_payment = attributes[:'split_payment']
|
|
162
210
|
end
|
|
163
211
|
|
|
164
|
-
if attributes.key?(:'
|
|
165
|
-
|
|
212
|
+
if attributes.key?(:'metadata')
|
|
213
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
214
|
+
self.metadata = value
|
|
215
|
+
end
|
|
166
216
|
end
|
|
167
217
|
|
|
168
|
-
if attributes.key?(:'
|
|
169
|
-
self.
|
|
218
|
+
if attributes.key?(:'is_refundable')
|
|
219
|
+
self.is_refundable = attributes[:'is_refundable']
|
|
170
220
|
end
|
|
171
221
|
|
|
172
222
|
if attributes.key?(:'created_at')
|
|
173
223
|
self.created_at = attributes[:'created_at']
|
|
174
224
|
end
|
|
175
225
|
|
|
176
|
-
if attributes.key?(:'
|
|
177
|
-
self.
|
|
226
|
+
if attributes.key?(:'updated_at')
|
|
227
|
+
self.updated_at = attributes[:'updated_at']
|
|
178
228
|
end
|
|
179
229
|
|
|
180
230
|
if attributes.key?(:'customer_info')
|
|
181
231
|
self.customer_info = attributes[:'customer_info']
|
|
182
232
|
end
|
|
183
233
|
|
|
184
|
-
if attributes.key?(:'
|
|
185
|
-
self.
|
|
234
|
+
if attributes.key?(:'shipping_contact')
|
|
235
|
+
self.shipping_contact = attributes[:'shipping_contact']
|
|
186
236
|
end
|
|
187
237
|
|
|
188
|
-
if attributes.key?(:'
|
|
189
|
-
self.
|
|
238
|
+
if attributes.key?(:'channel')
|
|
239
|
+
self.channel = attributes[:'channel']
|
|
190
240
|
end
|
|
191
241
|
|
|
192
|
-
if attributes.key?(:'
|
|
193
|
-
self.
|
|
242
|
+
if attributes.key?(:'fiscal_entity')
|
|
243
|
+
self.fiscal_entity = attributes[:'fiscal_entity']
|
|
194
244
|
end
|
|
195
245
|
|
|
196
|
-
if attributes.key?(:'
|
|
197
|
-
self.
|
|
246
|
+
if attributes.key?(:'checkout')
|
|
247
|
+
self.checkout = attributes[:'checkout']
|
|
198
248
|
end
|
|
199
249
|
|
|
200
250
|
if attributes.key?(:'line_items')
|
|
201
251
|
self.line_items = attributes[:'line_items']
|
|
202
252
|
end
|
|
203
253
|
|
|
204
|
-
if attributes.key?(:'
|
|
205
|
-
self.
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
if attributes.key?(:'metadata')
|
|
209
|
-
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
210
|
-
self.metadata = value
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
if attributes.key?(:'next_action')
|
|
215
|
-
self.next_action = attributes[:'next_action']
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
if attributes.key?(:'object')
|
|
219
|
-
self.object = attributes[:'object']
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
if attributes.key?(:'payment_status')
|
|
223
|
-
self.payment_status = attributes[:'payment_status']
|
|
254
|
+
if attributes.key?(:'discount_lines')
|
|
255
|
+
self.discount_lines = attributes[:'discount_lines']
|
|
224
256
|
end
|
|
225
257
|
|
|
226
|
-
if attributes.key?(:'
|
|
227
|
-
self.
|
|
258
|
+
if attributes.key?(:'charges')
|
|
259
|
+
self.charges = attributes[:'charges']
|
|
228
260
|
end
|
|
229
261
|
|
|
230
|
-
if attributes.key?(:'
|
|
231
|
-
|
|
262
|
+
if attributes.key?(:'partial_reference')
|
|
263
|
+
if (value = attributes[:'partial_reference']).is_a?(Hash)
|
|
264
|
+
self.partial_reference = value
|
|
265
|
+
end
|
|
232
266
|
end
|
|
233
267
|
|
|
234
|
-
if attributes.key?(:'
|
|
235
|
-
|
|
268
|
+
if attributes.key?(:'payments_info')
|
|
269
|
+
if (value = attributes[:'payments_info']).is_a?(Hash)
|
|
270
|
+
self.payments_info = value
|
|
271
|
+
end
|
|
236
272
|
end
|
|
237
273
|
end
|
|
238
274
|
|
|
@@ -241,6 +277,10 @@ module DigitalFemsa
|
|
|
241
277
|
def list_invalid_properties
|
|
242
278
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
243
279
|
invalid_properties = Array.new
|
|
280
|
+
if !@currency.nil? && @currency.to_s.length > 3
|
|
281
|
+
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
|
282
|
+
end
|
|
283
|
+
|
|
244
284
|
if !@metadata.nil? && @metadata.length > 100
|
|
245
285
|
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
246
286
|
end
|
|
@@ -252,10 +292,37 @@ module DigitalFemsa
|
|
|
252
292
|
# @return true if the model is valid
|
|
253
293
|
def valid?
|
|
254
294
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
295
|
+
object_validator = EnumAttributeValidator.new('String', ["order"])
|
|
296
|
+
return false unless object_validator.valid?(@object)
|
|
297
|
+
return false if !@currency.nil? && @currency.to_s.length > 3
|
|
255
298
|
return false if !@metadata.nil? && @metadata.length > 100
|
|
256
299
|
true
|
|
257
300
|
end
|
|
258
301
|
|
|
302
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
303
|
+
# @param [Object] object Object to be assigned
|
|
304
|
+
def object=(object)
|
|
305
|
+
validator = EnumAttributeValidator.new('String', ["order"])
|
|
306
|
+
unless validator.valid?(object)
|
|
307
|
+
fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
|
|
308
|
+
end
|
|
309
|
+
@object = object
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Custom attribute writer method with validation
|
|
313
|
+
# @param [Object] currency Value to be assigned
|
|
314
|
+
def currency=(currency)
|
|
315
|
+
if currency.nil?
|
|
316
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if currency.to_s.length > 3
|
|
320
|
+
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
@currency = currency
|
|
324
|
+
end
|
|
325
|
+
|
|
259
326
|
# Custom attribute writer method with validation
|
|
260
327
|
# @param [Object] metadata Value to be assigned
|
|
261
328
|
def metadata=(metadata)
|
|
@@ -275,27 +342,28 @@ module DigitalFemsa
|
|
|
275
342
|
def ==(o)
|
|
276
343
|
return true if self.equal?(o)
|
|
277
344
|
self.class == o.class &&
|
|
345
|
+
id == o.id &&
|
|
346
|
+
object == o.object &&
|
|
347
|
+
livemode == o.livemode &&
|
|
278
348
|
amount == o.amount &&
|
|
349
|
+
currency == o.currency &&
|
|
350
|
+
payment_status == o.payment_status &&
|
|
279
351
|
amount_refunded == o.amount_refunded &&
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
352
|
+
split_payment == o.split_payment &&
|
|
353
|
+
metadata == o.metadata &&
|
|
354
|
+
is_refundable == o.is_refundable &&
|
|
283
355
|
created_at == o.created_at &&
|
|
284
|
-
|
|
356
|
+
updated_at == o.updated_at &&
|
|
285
357
|
customer_info == o.customer_info &&
|
|
286
|
-
|
|
358
|
+
shipping_contact == o.shipping_contact &&
|
|
359
|
+
channel == o.channel &&
|
|
287
360
|
fiscal_entity == o.fiscal_entity &&
|
|
288
|
-
|
|
289
|
-
is_refundable == o.is_refundable &&
|
|
361
|
+
checkout == o.checkout &&
|
|
290
362
|
line_items == o.line_items &&
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
payment_status == o.payment_status &&
|
|
296
|
-
processing_mode == o.processing_mode &&
|
|
297
|
-
shipping_contact == o.shipping_contact &&
|
|
298
|
-
updated_at == o.updated_at
|
|
363
|
+
discount_lines == o.discount_lines &&
|
|
364
|
+
charges == o.charges &&
|
|
365
|
+
partial_reference == o.partial_reference &&
|
|
366
|
+
payments_info == o.payments_info
|
|
299
367
|
end
|
|
300
368
|
|
|
301
369
|
# @see the `==` method
|
|
@@ -307,7 +375,7 @@ module DigitalFemsa
|
|
|
307
375
|
# Calculates hash code according to all attributes.
|
|
308
376
|
# @return [Integer] Hash code
|
|
309
377
|
def hash
|
|
310
|
-
[
|
|
378
|
+
[id, object, livemode, amount, currency, payment_status, amount_refunded, split_payment, metadata, is_refundable, created_at, updated_at, customer_info, shipping_contact, channel, fiscal_entity, checkout, line_items, discount_lines, charges, partial_reference, payments_info].hash
|
|
311
379
|
end
|
|
312
380
|
|
|
313
381
|
# Builds the object from hash
|
|
@@ -14,19 +14,23 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
|
|
20
|
-
attr_accessor :url
|
|
17
|
+
# Channel information for the order (for example Checkout-related metadata). It may be `null`.
|
|
18
|
+
class OrderResponseChannel
|
|
19
|
+
attr_accessor :segment
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
attr_accessor :checkout_request_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :checkout_request_type
|
|
24
|
+
|
|
25
|
+
attr_accessor :id
|
|
24
26
|
|
|
25
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
28
|
def self.attribute_map
|
|
27
29
|
{
|
|
28
|
-
:'
|
|
29
|
-
:'
|
|
30
|
+
:'segment' => :'segment',
|
|
31
|
+
:'checkout_request_id' => :'checkout_request_id',
|
|
32
|
+
:'checkout_request_type' => :'checkout_request_type',
|
|
33
|
+
:'id' => :'id'
|
|
30
34
|
}
|
|
31
35
|
end
|
|
32
36
|
|
|
@@ -38,8 +42,10 @@ module DigitalFemsa
|
|
|
38
42
|
# Attribute type mapping.
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
41
|
-
:'
|
|
42
|
-
:'
|
|
45
|
+
:'segment' => :'String',
|
|
46
|
+
:'checkout_request_id' => :'String',
|
|
47
|
+
:'checkout_request_type' => :'String',
|
|
48
|
+
:'id' => :'String'
|
|
43
49
|
}
|
|
44
50
|
end
|
|
45
51
|
|
|
@@ -53,23 +59,31 @@ module DigitalFemsa
|
|
|
53
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
60
|
def initialize(attributes = {})
|
|
55
61
|
if (!attributes.is_a?(Hash))
|
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DigitalFemsa::
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DigitalFemsa::OrderResponseChannel` initialize method"
|
|
57
63
|
end
|
|
58
64
|
|
|
59
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DigitalFemsa::
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DigitalFemsa::OrderResponseChannel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
63
69
|
end
|
|
64
70
|
h[k.to_sym] = v
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
if attributes.key?(:'
|
|
68
|
-
self.
|
|
73
|
+
if attributes.key?(:'segment')
|
|
74
|
+
self.segment = attributes[:'segment']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'checkout_request_id')
|
|
78
|
+
self.checkout_request_id = attributes[:'checkout_request_id']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'checkout_request_type')
|
|
82
|
+
self.checkout_request_type = attributes[:'checkout_request_type']
|
|
69
83
|
end
|
|
70
84
|
|
|
71
|
-
if attributes.key?(:'
|
|
72
|
-
self.
|
|
85
|
+
if attributes.key?(:'id')
|
|
86
|
+
self.id = attributes[:'id']
|
|
73
87
|
end
|
|
74
88
|
end
|
|
75
89
|
|
|
@@ -93,8 +107,10 @@ module DigitalFemsa
|
|
|
93
107
|
def ==(o)
|
|
94
108
|
return true if self.equal?(o)
|
|
95
109
|
self.class == o.class &&
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
segment == o.segment &&
|
|
111
|
+
checkout_request_id == o.checkout_request_id &&
|
|
112
|
+
checkout_request_type == o.checkout_request_type &&
|
|
113
|
+
id == o.id
|
|
98
114
|
end
|
|
99
115
|
|
|
100
116
|
# @see the `==` method
|
|
@@ -106,7 +122,7 @@ module DigitalFemsa
|
|
|
106
122
|
# Calculates hash code according to all attributes.
|
|
107
123
|
# @return [Integer] Hash code
|
|
108
124
|
def hash
|
|
109
|
-
[
|
|
125
|
+
[segment, checkout_request_id, checkout_request_type, id].hash
|
|
110
126
|
end
|
|
111
127
|
|
|
112
128
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
#
|
|
17
|
+
# List preview of charges created for the order. Charges are only created when included in the request or created later through payment flows. This field can be `null` depending on the response context.
|
|
18
18
|
class OrderResponseCharges
|
|
19
19
|
# Indicates if there are more pages to be requested
|
|
20
20
|
attr_accessor :has_more
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
+
# Checkout resource linked to the order. Present only when the order is linked to a checkout (`channel.checkout_request_id`).
|
|
17
18
|
class OrderResponseCheckout
|
|
18
19
|
attr_accessor :allowed_payment_methods
|
|
19
20
|
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
+
# Shipping contact associated with the order. It may be `null` when not provided/required.
|
|
17
18
|
class OrderResponseShippingContact
|
|
18
19
|
attr_accessor :phone
|
|
19
20
|
|
|
@@ -23,6 +24,7 @@ module DigitalFemsa
|
|
|
23
24
|
|
|
24
25
|
attr_accessor :address
|
|
25
26
|
|
|
27
|
+
# Customer ID that owns this shipping contact.
|
|
26
28
|
attr_accessor :parent_id
|
|
27
29
|
|
|
28
30
|
attr_accessor :default
|
|
@@ -36,6 +38,7 @@ module DigitalFemsa
|
|
|
36
38
|
|
|
37
39
|
attr_accessor :object
|
|
38
40
|
|
|
41
|
+
# Present only when the shipping contact was deleted.
|
|
39
42
|
attr_accessor :deleted
|
|
40
43
|
|
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -24,7 +24,7 @@ module DigitalFemsa
|
|
|
24
24
|
# Name of the fiscal entity
|
|
25
25
|
attr_accessor :name
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# Arbitrary key-value data associated with the fiscal entity for your internal use. Keys should be strings; values can be any JSON value.
|
|
28
28
|
attr_accessor :metadata
|
|
29
29
|
|
|
30
30
|
# Phone of the fiscal entity
|