Class: Io::Flow::V0::Models::TaxDutyCalculatorValidationErrorCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxDutyCalculatorValidationErrorCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, creating a new instance for an unknown value.
-
.destination_address_iso3166_unrecognized ⇒ Object
Destination address country is not recognized as a destination country in ISO 3166.
-
.destination_country_not_defined ⇒ Object
Destination address including at minimum a country must be included to properly generate a tax quote.
-
.from_string(value) ⇒ Object
Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, or nil if not found.
- .generic_error ⇒ Object
-
.line_item_country_of_origin_iso3166_unrecognized ⇒ Object
Line item country of origin is not recognized as a country of origin in ISO 3166.
-
.line_item_currency_iso4217_unrecognized ⇒ Object
Line item provided currency is not recognized as a calculation currency in ISO 4217.
-
.line_item_discount_amount_positive ⇒ Object
Line item Unit discount must be less than or equal to 0.
-
.line_item_discount_amount_precision_invalid ⇒ Object
Line item Unit discount amount is more precise than the maximum allowed for this currency.
-
.line_item_duty_provider_invalid ⇒ Object
Line item country of origin and shipto country resulted in inability to calculate duty.
-
.line_item_hs_code_invalid ⇒ Object
Line item does not appear to contain a properly formed hs code.
-
.line_item_quantity_invalid ⇒ Object
Line item quantity must be greater than 0.
-
.line_item_ship_from_invalid ⇒ Object
Every line’s ship from address must include a country to properly generate a tax quote.
-
.line_item_shipfrom_shipto_country_invalid ⇒ Object
This is a cross-border calculator.
-
.line_item_unit_price_negative ⇒ Object
Line Item Unit amount must be greater than or equal to 0.
-
.line_item_unit_price_precision_invalid ⇒ Object
Provided value for unit amount is more precise than the maximum allowed for this currency.
-
.line_quantity_invalid ⇒ Object
Order must contain at least one line of ordered goods.
-
.merchant_of_record_invalid ⇒ Object
Only ‘Flow’ is supported as Merchant of Record.
-
.shipping_discount_amount_invalid ⇒ Object
Shipping discount must be less than or equal to 0.
-
.shipping_discount_amount_precision_invalid ⇒ Object
Shipping discount amount is more precise than the maximum allowed for this currency.
-
.shipping_unit_price_negative ⇒ Object
Shipping amount must be greater than or equal to 0.
-
.shipping_unit_price_precision_invalid ⇒ Object
Shipping amount is more precise than the maximum allowed for this currency.
-
.wrong_unit_specified ⇒ Object
Only weight units may be specified for a unit weight.
Instance Method Summary collapse
-
#initialize(value) ⇒ TaxDutyCalculatorValidationErrorCode
constructor
A new instance of TaxDutyCalculatorValidationErrorCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TaxDutyCalculatorValidationErrorCode
Returns a new instance of TaxDutyCalculatorValidationErrorCode.
25079 25080 25081 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25079 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
25077 25078 25079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25077 def value @value end |
Class Method Details
.ALL ⇒ Object
25099 25100 25101 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25099 def TaxDutyCalculatorValidationErrorCode.ALL @@all ||= [TaxDutyCalculatorValidationErrorCode.generic_error, TaxDutyCalculatorValidationErrorCode.destination_country_not_defined, TaxDutyCalculatorValidationErrorCode.destination_address_iso3166_unrecognized, TaxDutyCalculatorValidationErrorCode.line_item_shipfrom_shipto_country_invalid, TaxDutyCalculatorValidationErrorCode.line_item_ship_from_invalid, TaxDutyCalculatorValidationErrorCode.line_item_currency_iso4217_unrecognized, TaxDutyCalculatorValidationErrorCode.line_quantity_invalid, TaxDutyCalculatorValidationErrorCode.line_item_quantity_invalid, TaxDutyCalculatorValidationErrorCode.line_item_unit_price_precision_invalid, TaxDutyCalculatorValidationErrorCode.line_item_unit_price_negative, TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_precision_invalid, TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_positive, TaxDutyCalculatorValidationErrorCode.line_item_country_of_origin_iso3166_unrecognized, TaxDutyCalculatorValidationErrorCode.line_item_hs_code_invalid, TaxDutyCalculatorValidationErrorCode.line_item_duty_provider_invalid, TaxDutyCalculatorValidationErrorCode.shipping_unit_price_precision_invalid, TaxDutyCalculatorValidationErrorCode.shipping_unit_price_negative, TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_precision_invalid, TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_invalid, TaxDutyCalculatorValidationErrorCode.merchant_of_record_invalid, TaxDutyCalculatorValidationErrorCode.wrong_unit_specified] end |
.apply(value) ⇒ Object
Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, creating a new instance for an unknown value
25084 25085 25086 25087 25088 25089 25090 25091 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25084 def TaxDutyCalculatorValidationErrorCode.apply(value) if value.instance_of?(TaxDutyCalculatorValidationErrorCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TaxDutyCalculatorValidationErrorCode.new(value)) end end |
.destination_address_iso3166_unrecognized ⇒ Object
Destination address country is not recognized as a destination country in ISO 3166
25115 25116 25117 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25115 def TaxDutyCalculatorValidationErrorCode.destination_address_iso3166_unrecognized @@_destination_address_iso3166_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('destination_address_iso3166_unrecognized') end |
.destination_country_not_defined ⇒ Object
Destination address including at minimum a country must be included to properly generate a tax quote
25109 25110 25111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25109 def TaxDutyCalculatorValidationErrorCode.destination_country_not_defined @@_destination_country_not_defined ||= TaxDutyCalculatorValidationErrorCode.new('destination_country_not_defined') end |
.from_string(value) ⇒ Object
Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, or nil if not found
25094 25095 25096 25097 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25094 def TaxDutyCalculatorValidationErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TaxDutyCalculatorValidationErrorCode.ALL.find { |v| v.value == value } end |
.generic_error ⇒ Object
25103 25104 25105 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25103 def TaxDutyCalculatorValidationErrorCode.generic_error @@_generic_error ||= TaxDutyCalculatorValidationErrorCode.new('generic_error') end |
.line_item_country_of_origin_iso3166_unrecognized ⇒ Object
Line item country of origin is not recognized as a country of origin in ISO 3166
25171 25172 25173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25171 def TaxDutyCalculatorValidationErrorCode.line_item_country_of_origin_iso3166_unrecognized @@_line_item_country_of_origin_iso3166_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('line_item_country_of_origin_iso3166_unrecognized') end |
.line_item_currency_iso4217_unrecognized ⇒ Object
Line item provided currency is not recognized as a calculation currency in ISO 4217
25133 25134 25135 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25133 def TaxDutyCalculatorValidationErrorCode.line_item_currency_iso4217_unrecognized @@_line_item_currency_iso4217_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('line_item_currency_iso4217_unrecognized') end |
.line_item_discount_amount_positive ⇒ Object
Line item Unit discount must be less than or equal to 0
25165 25166 25167 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25165 def TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_positive @@_line_item_discount_amount_positive ||= TaxDutyCalculatorValidationErrorCode.new('line_item_discount_amount_positive') end |
.line_item_discount_amount_precision_invalid ⇒ Object
Line item Unit discount amount is more precise than the maximum allowed for this currency
25160 25161 25162 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25160 def TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_precision_invalid @@_line_item_discount_amount_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_discount_amount_precision_invalid') end |
.line_item_duty_provider_invalid ⇒ Object
Line item country of origin and shipto country resulted in inability to calculate duty.
25183 25184 25185 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25183 def TaxDutyCalculatorValidationErrorCode.line_item_duty_provider_invalid @@_line_item_duty_provider_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_duty_provider_invalid') end |
.line_item_hs_code_invalid ⇒ Object
Line item does not appear to contain a properly formed hs code. Please provide a 6 digit code or a 4-14 digit code specific to the destination country
25177 25178 25179 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25177 def TaxDutyCalculatorValidationErrorCode.line_item_hs_code_invalid @@_line_item_hs_code_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_hs_code_invalid') end |
.line_item_quantity_invalid ⇒ Object
Line item quantity must be greater than 0
25143 25144 25145 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25143 def TaxDutyCalculatorValidationErrorCode.line_item_quantity_invalid @@_line_item_quantity_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_quantity_invalid') end |
.line_item_ship_from_invalid ⇒ Object
Every line’s ship from address must include a country to properly generate a tax quote
25127 25128 25129 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25127 def TaxDutyCalculatorValidationErrorCode.line_item_ship_from_invalid @@_line_item_ship_from_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_ship_from_invalid') end |
.line_item_shipfrom_shipto_country_invalid ⇒ Object
This is a cross-border calculator. No line’s ship from country can be the same as the destination country
25121 25122 25123 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25121 def TaxDutyCalculatorValidationErrorCode.line_item_shipfrom_shipto_country_invalid @@_line_item_shipfrom_shipto_country_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_shipfrom_shipto_country_invalid') end |
.line_item_unit_price_negative ⇒ Object
Line Item Unit amount must be greater than or equal to 0
25154 25155 25156 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25154 def TaxDutyCalculatorValidationErrorCode.line_item_unit_price_negative @@_line_item_unit_price_negative ||= TaxDutyCalculatorValidationErrorCode.new('line_item_unit_price_negative') end |
.line_item_unit_price_precision_invalid ⇒ Object
Provided value for unit amount is more precise than the maximum allowed for this currency
25149 25150 25151 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25149 def TaxDutyCalculatorValidationErrorCode.line_item_unit_price_precision_invalid @@_line_item_unit_price_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_unit_price_precision_invalid') end |
.line_quantity_invalid ⇒ Object
Order must contain at least one line of ordered goods
25138 25139 25140 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25138 def TaxDutyCalculatorValidationErrorCode.line_quantity_invalid @@_line_quantity_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_quantity_invalid') end |
.merchant_of_record_invalid ⇒ Object
Only ‘Flow’ is supported as Merchant of Record
25209 25210 25211 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25209 def TaxDutyCalculatorValidationErrorCode.merchant_of_record_invalid @@_merchant_of_record_invalid ||= TaxDutyCalculatorValidationErrorCode.new('merchant_of_record_invalid') end |
.shipping_discount_amount_invalid ⇒ Object
Shipping discount must be less than or equal to 0
25204 25205 25206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25204 def TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_invalid @@_shipping_discount_amount_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_discount_amount_invalid') end |
.shipping_discount_amount_precision_invalid ⇒ Object
Shipping discount amount is more precise than the maximum allowed for this currency
25199 25200 25201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25199 def TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_precision_invalid @@_shipping_discount_amount_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_discount_amount_precision_invalid') end |
.shipping_unit_price_negative ⇒ Object
Shipping amount must be greater than or equal to 0
25193 25194 25195 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25193 def TaxDutyCalculatorValidationErrorCode.shipping_unit_price_negative @@_shipping_unit_price_negative ||= TaxDutyCalculatorValidationErrorCode.new('shipping_unit_price_negative') end |
.shipping_unit_price_precision_invalid ⇒ Object
Shipping amount is more precise than the maximum allowed for this currency
25188 25189 25190 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25188 def TaxDutyCalculatorValidationErrorCode.shipping_unit_price_precision_invalid @@_shipping_unit_price_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_unit_price_precision_invalid') end |
.wrong_unit_specified ⇒ Object
Only weight units may be specified for a unit weight.
25214 25215 25216 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25214 def TaxDutyCalculatorValidationErrorCode.wrong_unit_specified @@_wrong_unit_specified ||= TaxDutyCalculatorValidationErrorCode.new('wrong_unit_specified') end |
Instance Method Details
#to_hash ⇒ Object
25218 25219 25220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25218 def to_hash value end |