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,12 +14,12 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
#
|
|
17
|
+
# Create a new tax line for an existing order.
|
|
18
18
|
class UpdateOrderTaxRequest
|
|
19
19
|
# The amount to be collected for tax in cents
|
|
20
20
|
attr_accessor :amount
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Description or tax name
|
|
23
23
|
attr_accessor :description
|
|
24
24
|
|
|
25
25
|
attr_accessor :metadata
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Femsa API
|
|
3
|
+
|
|
4
|
+
#Femsa sdk
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
|
7
|
+
Contact: engineering@femsa.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.5.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DigitalFemsa
|
|
17
|
+
module UpdatePaymentMethodsAmount
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'Integer',
|
|
23
|
+
:'String'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
+
# - TODO: logging when debugging is set.
|
|
38
|
+
openapi_one_of.each do |klass|
|
|
39
|
+
begin
|
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
42
|
+
return typed_data if typed_data
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.parse(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = DigitalFemsa.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Femsa API
|
|
3
|
+
|
|
4
|
+
#Femsa sdk
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
|
7
|
+
Contact: engineering@femsa.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.5.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DigitalFemsa
|
|
17
|
+
module UpdatePaymentMethodsExpiresAt
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'Integer',
|
|
23
|
+
:'String'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
+
# - TODO: logging when debugging is set.
|
|
38
|
+
openapi_one_of.each do |klass|
|
|
39
|
+
begin
|
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
42
|
+
return typed_data if typed_data
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.parse(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = DigitalFemsa.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -15,35 +15,32 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
17
|
class UpdateProduct
|
|
18
|
-
attr_accessor :antifraud_info
|
|
19
|
-
|
|
20
|
-
attr_accessor :description
|
|
21
|
-
|
|
22
|
-
attr_accessor :sku
|
|
23
|
-
|
|
24
18
|
attr_accessor :name
|
|
25
19
|
|
|
26
20
|
attr_accessor :unit_price
|
|
27
21
|
|
|
28
22
|
attr_accessor :quantity
|
|
29
23
|
|
|
30
|
-
attr_accessor :
|
|
24
|
+
attr_accessor :sku
|
|
31
25
|
|
|
32
26
|
attr_accessor :brand
|
|
33
27
|
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
attr_accessor :tags
|
|
31
|
+
|
|
34
32
|
attr_accessor :metadata
|
|
35
33
|
|
|
36
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
35
|
def self.attribute_map
|
|
38
36
|
{
|
|
39
|
-
:'antifraud_info' => :'antifraud_info',
|
|
40
|
-
:'description' => :'description',
|
|
41
|
-
:'sku' => :'sku',
|
|
42
37
|
:'name' => :'name',
|
|
43
38
|
:'unit_price' => :'unit_price',
|
|
44
39
|
:'quantity' => :'quantity',
|
|
45
|
-
:'
|
|
40
|
+
:'sku' => :'sku',
|
|
46
41
|
:'brand' => :'brand',
|
|
42
|
+
:'description' => :'description',
|
|
43
|
+
:'tags' => :'tags',
|
|
47
44
|
:'metadata' => :'metadata'
|
|
48
45
|
}
|
|
49
46
|
end
|
|
@@ -56,15 +53,14 @@ module DigitalFemsa
|
|
|
56
53
|
# Attribute type mapping.
|
|
57
54
|
def self.openapi_types
|
|
58
55
|
{
|
|
59
|
-
:'antifraud_info' => :'Hash<String, Object>',
|
|
60
|
-
:'description' => :'String',
|
|
61
|
-
:'sku' => :'String',
|
|
62
56
|
:'name' => :'String',
|
|
63
57
|
:'unit_price' => :'Integer',
|
|
64
58
|
:'quantity' => :'Integer',
|
|
65
|
-
:'
|
|
59
|
+
:'sku' => :'String',
|
|
66
60
|
:'brand' => :'String',
|
|
67
|
-
:'
|
|
61
|
+
:'description' => :'String',
|
|
62
|
+
:'tags' => :'Array<String>',
|
|
63
|
+
:'metadata' => :'Hash<String, Object>'
|
|
68
64
|
}
|
|
69
65
|
end
|
|
70
66
|
|
|
@@ -89,20 +85,6 @@ module DigitalFemsa
|
|
|
89
85
|
h[k.to_sym] = v
|
|
90
86
|
}
|
|
91
87
|
|
|
92
|
-
if attributes.key?(:'antifraud_info')
|
|
93
|
-
if (value = attributes[:'antifraud_info']).is_a?(Hash)
|
|
94
|
-
self.antifraud_info = value
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
if attributes.key?(:'description')
|
|
99
|
-
self.description = attributes[:'description']
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
if attributes.key?(:'sku')
|
|
103
|
-
self.sku = attributes[:'sku']
|
|
104
|
-
end
|
|
105
|
-
|
|
106
88
|
if attributes.key?(:'name')
|
|
107
89
|
self.name = attributes[:'name']
|
|
108
90
|
end
|
|
@@ -115,16 +97,24 @@ module DigitalFemsa
|
|
|
115
97
|
self.quantity = attributes[:'quantity']
|
|
116
98
|
end
|
|
117
99
|
|
|
118
|
-
if attributes.key?(:'
|
|
119
|
-
|
|
120
|
-
self.tags = value
|
|
121
|
-
end
|
|
100
|
+
if attributes.key?(:'sku')
|
|
101
|
+
self.sku = attributes[:'sku']
|
|
122
102
|
end
|
|
123
103
|
|
|
124
104
|
if attributes.key?(:'brand')
|
|
125
105
|
self.brand = attributes[:'brand']
|
|
126
106
|
end
|
|
127
107
|
|
|
108
|
+
if attributes.key?(:'description')
|
|
109
|
+
self.description = attributes[:'description']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'tags')
|
|
113
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
|
114
|
+
self.tags = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
128
118
|
if attributes.key?(:'metadata')
|
|
129
119
|
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
130
120
|
self.metadata = value
|
|
@@ -137,10 +127,6 @@ module DigitalFemsa
|
|
|
137
127
|
def list_invalid_properties
|
|
138
128
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
139
129
|
invalid_properties = Array.new
|
|
140
|
-
if !@description.nil? && @description.to_s.length > 250
|
|
141
|
-
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
|
142
|
-
end
|
|
143
|
-
|
|
144
130
|
if !@unit_price.nil? && @unit_price < 0
|
|
145
131
|
invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
|
|
146
132
|
end
|
|
@@ -149,6 +135,18 @@ module DigitalFemsa
|
|
|
149
135
|
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
|
150
136
|
end
|
|
151
137
|
|
|
138
|
+
if !@description.nil? && @description.to_s.length > 250
|
|
139
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if !@tags.nil? && @tags.length < 1
|
|
143
|
+
invalid_properties.push('invalid value for "tags", number of items must be greater than or equal to 1.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if !@metadata.nil? && @metadata.length > 100
|
|
147
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
148
|
+
end
|
|
149
|
+
|
|
152
150
|
invalid_properties
|
|
153
151
|
end
|
|
154
152
|
|
|
@@ -156,26 +154,14 @@ module DigitalFemsa
|
|
|
156
154
|
# @return true if the model is valid
|
|
157
155
|
def valid?
|
|
158
156
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
159
|
-
return false if !@description.nil? && @description.to_s.length > 250
|
|
160
157
|
return false if !@unit_price.nil? && @unit_price < 0
|
|
161
158
|
return false if !@quantity.nil? && @quantity < 1
|
|
159
|
+
return false if !@description.nil? && @description.to_s.length > 250
|
|
160
|
+
return false if !@tags.nil? && @tags.length < 1
|
|
161
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
|
162
162
|
true
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
-
# Custom attribute writer method with validation
|
|
166
|
-
# @param [Object] description Value to be assigned
|
|
167
|
-
def description=(description)
|
|
168
|
-
if description.nil?
|
|
169
|
-
fail ArgumentError, 'description cannot be nil'
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
if description.to_s.length > 250
|
|
173
|
-
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
@description = description
|
|
177
|
-
end
|
|
178
|
-
|
|
179
165
|
# Custom attribute writer method with validation
|
|
180
166
|
# @param [Object] unit_price Value to be assigned
|
|
181
167
|
def unit_price=(unit_price)
|
|
@@ -204,19 +190,60 @@ module DigitalFemsa
|
|
|
204
190
|
@quantity = quantity
|
|
205
191
|
end
|
|
206
192
|
|
|
193
|
+
# Custom attribute writer method with validation
|
|
194
|
+
# @param [Object] description Value to be assigned
|
|
195
|
+
def description=(description)
|
|
196
|
+
if description.nil?
|
|
197
|
+
fail ArgumentError, 'description cannot be nil'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if description.to_s.length > 250
|
|
201
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@description = description
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] tags Value to be assigned
|
|
209
|
+
def tags=(tags)
|
|
210
|
+
if tags.nil?
|
|
211
|
+
fail ArgumentError, 'tags cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if tags.length < 1
|
|
215
|
+
fail ArgumentError, 'invalid value for "tags", number of items must be greater than or equal to 1.'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@tags = tags
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] metadata Value to be assigned
|
|
223
|
+
def metadata=(metadata)
|
|
224
|
+
if metadata.nil?
|
|
225
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if metadata.length > 100
|
|
229
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@metadata = metadata
|
|
233
|
+
end
|
|
234
|
+
|
|
207
235
|
# Checks equality by comparing each attribute.
|
|
208
236
|
# @param [Object] Object to be compared
|
|
209
237
|
def ==(o)
|
|
210
238
|
return true if self.equal?(o)
|
|
211
239
|
self.class == o.class &&
|
|
212
|
-
antifraud_info == o.antifraud_info &&
|
|
213
|
-
description == o.description &&
|
|
214
|
-
sku == o.sku &&
|
|
215
240
|
name == o.name &&
|
|
216
241
|
unit_price == o.unit_price &&
|
|
217
242
|
quantity == o.quantity &&
|
|
218
|
-
|
|
243
|
+
sku == o.sku &&
|
|
219
244
|
brand == o.brand &&
|
|
245
|
+
description == o.description &&
|
|
246
|
+
tags == o.tags &&
|
|
220
247
|
metadata == o.metadata
|
|
221
248
|
end
|
|
222
249
|
|
|
@@ -229,7 +256,7 @@ module DigitalFemsa
|
|
|
229
256
|
# Calculates hash code according to all attributes.
|
|
230
257
|
# @return [Integer] Hash code
|
|
231
258
|
def hash
|
|
232
|
-
[
|
|
259
|
+
[name, unit_price, quantity, sku, brand, description, tags, metadata].hash
|
|
233
260
|
end
|
|
234
261
|
|
|
235
262
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
# a webhook
|
|
17
|
+
# Parameters used to create or update a webhook.
|
|
18
18
|
class WebhookRequest
|
|
19
19
|
# Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.
|
|
20
20
|
attr_accessor :url
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
#
|
|
17
|
+
# Parameters used to update a webhook. All fields are optional; send only the fields you want to change.
|
|
18
18
|
class WebhookUpdateRequest
|
|
19
19
|
# Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.
|
|
20
20
|
attr_accessor :url
|
data/lib/digital_femsa.rb
CHANGED
|
@@ -25,6 +25,7 @@ require 'digital_femsa/models/api_key_update_request'
|
|
|
25
25
|
require 'digital_femsa/models/balance_common_field'
|
|
26
26
|
require 'digital_femsa/models/balance_response'
|
|
27
27
|
require 'digital_femsa/models/charge_order_response'
|
|
28
|
+
require 'digital_femsa/models/charge_order_response_channel'
|
|
28
29
|
require 'digital_femsa/models/charge_order_response_payment_method'
|
|
29
30
|
require 'digital_femsa/models/charge_request'
|
|
30
31
|
require 'digital_femsa/models/charge_request_payment_method'
|
|
@@ -50,8 +51,6 @@ require 'digital_femsa/models/create_customer_payment_methods_request'
|
|
|
50
51
|
require 'digital_femsa/models/create_customer_payment_methods_response'
|
|
51
52
|
require 'digital_femsa/models/customer'
|
|
52
53
|
require 'digital_femsa/models/customer_address'
|
|
53
|
-
require 'digital_femsa/models/customer_antifraud_info'
|
|
54
|
-
require 'digital_femsa/models/customer_antifraud_info_response'
|
|
55
54
|
require 'digital_femsa/models/customer_fiscal_entities_data_response'
|
|
56
55
|
require 'digital_femsa/models/customer_fiscal_entities_request'
|
|
57
56
|
require 'digital_femsa/models/customer_fiscal_entities_response'
|
|
@@ -103,12 +102,11 @@ require 'digital_femsa/models/order_discount_lines_request'
|
|
|
103
102
|
require 'digital_femsa/models/order_fiscal_entity_address_response'
|
|
104
103
|
require 'digital_femsa/models/order_fiscal_entity_request'
|
|
105
104
|
require 'digital_femsa/models/order_fiscal_entity_response'
|
|
106
|
-
require 'digital_femsa/models/order_next_action_response'
|
|
107
|
-
require 'digital_femsa/models/order_next_action_response_redirect_to_url'
|
|
108
105
|
require 'digital_femsa/models/order_refund_request'
|
|
109
106
|
require 'digital_femsa/models/order_request'
|
|
110
107
|
require 'digital_femsa/models/order_request_customer_info'
|
|
111
108
|
require 'digital_femsa/models/order_response'
|
|
109
|
+
require 'digital_femsa/models/order_response_channel'
|
|
112
110
|
require 'digital_femsa/models/order_response_charges'
|
|
113
111
|
require 'digital_femsa/models/order_response_checkout'
|
|
114
112
|
require 'digital_femsa/models/order_response_customer_info'
|
|
@@ -132,14 +130,12 @@ require 'digital_femsa/models/product_data_response'
|
|
|
132
130
|
require 'digital_femsa/models/product_order_response'
|
|
133
131
|
require 'digital_femsa/models/shipping_order_response'
|
|
134
132
|
require 'digital_femsa/models/shipping_request'
|
|
135
|
-
require 'digital_femsa/models/sms_checkout_request'
|
|
136
133
|
require 'digital_femsa/models/transaction_response'
|
|
137
134
|
require 'digital_femsa/models/transfer_destination_response'
|
|
138
135
|
require 'digital_femsa/models/transfer_method_response'
|
|
139
136
|
require 'digital_femsa/models/transfer_response'
|
|
140
137
|
require 'digital_femsa/models/transfers_response'
|
|
141
138
|
require 'digital_femsa/models/update_customer'
|
|
142
|
-
require 'digital_femsa/models/update_customer_antifraud_info'
|
|
143
139
|
require 'digital_femsa/models/update_customer_fiscal_entities_response'
|
|
144
140
|
require 'digital_femsa/models/update_customer_payment_methods_response'
|
|
145
141
|
require 'digital_femsa/models/update_order_discount_lines_request'
|
|
@@ -39,7 +39,7 @@ module {{moduleName}}
|
|
|
39
39
|
@default_headers = {
|
|
40
40
|
'Content-Type' => 'application/json',
|
|
41
41
|
'User-Agent' => @user_agent,
|
|
42
|
-
'
|
|
42
|
+
'Spin-Client-User-Agent' => digitalfemsa_headers_to_string
|
|
43
43
|
}
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -245,13 +245,17 @@ module {{moduleName}}
|
|
|
245
245
|
end
|
|
246
246
|
def digitalfemsa_headers
|
|
247
247
|
params = {
|
|
248
|
-
|
|
248
|
+
sdk_version: DigitalFemsa::VERSION,
|
|
249
249
|
lang: 'ruby',
|
|
250
|
-
lang_version: RUBY_VERSION
|
|
251
|
-
publisher: 'digitalfemsa'
|
|
250
|
+
lang_version: RUBY_VERSION
|
|
252
251
|
}
|
|
253
252
|
|
|
254
253
|
@digitalfemsa_headers ||= params
|
|
255
254
|
end
|
|
255
|
+
|
|
256
|
+
def digitalfemsa_headers_to_string
|
|
257
|
+
headers = digitalfemsa_headers
|
|
258
|
+
headers.map { |k, v| "#{k}=#{v}" }.join(';')
|
|
259
|
+
end
|
|
256
260
|
end
|
|
257
261
|
end
|