Class: Io::Flow::V0::Models::OrderPriceDetailComponentKey

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OrderPriceDetailComponentKey

Returns a new instance of OrderPriceDetailComponentKey.



8443
8444
8445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8443

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8441
8442
8443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8441

def value
  @value
end

Class Method Details

.adjustmentObject

A general purpose adjustment applied to the order.



8468
8469
8470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8468

def OrderPriceDetailComponentKey.adjustment
  @@_adjustment ||= OrderPriceDetailComponentKey.new('adjustment')
end

.apply(value) ⇒ Object

Returns the instance of OrderPriceDetailComponentKey for this value, creating a new instance for an unknown value



8448
8449
8450
8451
8452
8453
8454
8455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8448

def OrderPriceDetailComponentKey.apply(value)
  if value.instance_of?(OrderPriceDetailComponentKey)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderPriceDetailComponentKey.new(value))
  end
end

.duties_freightObject

The duty owed on the freight cost of the order.



8489
8490
8491
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8489

def OrderPriceDetailComponentKey.duties_freight
  @@_duties_freight ||= OrderPriceDetailComponentKey.new('duties_freight')
end

.duties_insuranceObject

The duty owed on the insurance cost of the order.



8494
8495
8496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8494

def OrderPriceDetailComponentKey.duties_insurance
  @@_duties_insurance ||= OrderPriceDetailComponentKey.new('duties_insurance')
end

.duties_item_priceObject

The VAT owed on the price of the order’s items, including any added margins and rounding.



8484
8485
8486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8484

def OrderPriceDetailComponentKey.duties_item_price
  @@_duties_item_price ||= OrderPriceDetailComponentKey.new('duties_item_price')
end

.duty_deminimisObject

An adjustment based on whether the duty de minimis applies to the order.



8478
8479
8480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8478

def OrderPriceDetailComponentKey.duty_deminimis
  @@_duty_deminimis ||= OrderPriceDetailComponentKey.new('duty_deminimis')
end

.duty_subsidyObject

An offset to account for any duty subsidized by the organization. For example, if duty is included in an item price and changes at the order level (due to passing de minimis threshold, or the destination having a more specific duty rate), the difference will be represented here.



8584
8585
8586
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8584

def OrderPriceDetailComponentKey.duty_subsidy
  @@_duty_subsidy ||= OrderPriceDetailComponentKey.new('duty_subsidy')
end

.from_string(value) ⇒ Object

Returns the instance of OrderPriceDetailComponentKey for this value, or nil if not found



8458
8459
8460
8461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8458

def OrderPriceDetailComponentKey.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OrderPriceDetailComponentKey.ALL.find { |v| v.value == value }
end

.insuranceObject

The insurance cost for the order.



8542
8543
8544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8542

def OrderPriceDetailComponentKey.insurance
  @@_insurance ||= OrderPriceDetailComponentKey.new('insurance')
end

.item_priceObject

The sum of the price of the order’s items with their currency margins, percent margins, and fixed margins included.



8532
8533
8534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8532

def OrderPriceDetailComponentKey.item_price
  @@_item_price ||= OrderPriceDetailComponentKey.new('item_price')
end

.order_discountObject

A discount applied to the entire order.



8552
8553
8554
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8552

def OrderPriceDetailComponentKey.order_discount
  @@_order_discount ||= OrderPriceDetailComponentKey.new('order_discount')
end

.roundingObject

The sum of any rounding applied to the order’s items.



8537
8538
8539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8537

def OrderPriceDetailComponentKey.rounding
  @@_rounding ||= OrderPriceDetailComponentKey.new('rounding')
end

.shippingObject

The shipping cost for the order.



8547
8548
8549
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8547

def OrderPriceDetailComponentKey.shipping
  @@_shipping ||= OrderPriceDetailComponentKey.new('shipping')
end

.subtotal_duty_percent_sales_marginObject

The sum of adjustments to duty owed made due to percentage sales margins.



8568
8569
8570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8568

def OrderPriceDetailComponentKey.subtotal_duty_percent_sales_margin
  @@_subtotal_duty_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_duty_percent_sales_margin')
end

.subtotal_percent_sales_marginObject

The sum of adjustments to item price, margin and rounding made due to percentage sales margins.



8558
8559
8560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8558

def OrderPriceDetailComponentKey.subtotal_percent_sales_margin
  @@_subtotal_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_percent_sales_margin')
end

.subtotal_vat_percent_sales_marginObject

The sum of adjustments to VAT owed made due to percentage sales margins.



8563
8564
8565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8563

def OrderPriceDetailComponentKey.subtotal_vat_percent_sales_margin
  @@_subtotal_vat_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_vat_percent_sales_margin')
end

.vat_deminimisObject

An adjustment based on whether the VAT de minimis applies to the order.



8473
8474
8475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8473

def OrderPriceDetailComponentKey.vat_deminimis
  @@_vat_deminimis ||= OrderPriceDetailComponentKey.new('vat_deminimis')
end

.vat_duties_freightObject

The VAT owed on the duties on the freight cost of the order.



8521
8522
8523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8521

def OrderPriceDetailComponentKey.vat_duties_freight
  @@_vat_duties_freight ||= OrderPriceDetailComponentKey.new('vat_duties_freight')
end

.vat_duties_insuranceObject

The VAT owed on the duties on the insurance cost of the order.



8526
8527
8528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8526

def OrderPriceDetailComponentKey.vat_duties_insurance
  @@_vat_duties_insurance ||= OrderPriceDetailComponentKey.new('vat_duties_insurance')
end

.vat_duties_item_priceObject

The VAT owed on the duties on the price of the order’s items, including any added margins and rounding.



8516
8517
8518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8516

def OrderPriceDetailComponentKey.vat_duties_item_price
  @@_vat_duties_item_price ||= OrderPriceDetailComponentKey.new('vat_duties_item_price')
end

.vat_freightObject

The VAT owed on the freight cost of the order.



8505
8506
8507
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8505

def OrderPriceDetailComponentKey.vat_freight
  @@_vat_freight ||= OrderPriceDetailComponentKey.new('vat_freight')
end

.vat_insuranceObject

The VAT owed on the insurance cost of the order.



8510
8511
8512
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8510

def OrderPriceDetailComponentKey.vat_insurance
  @@_vat_insurance ||= OrderPriceDetailComponentKey.new('vat_insurance')
end

.vat_item_priceObject

The VAT owed on the price of the order’s items, including any added margins and rounding.



8500
8501
8502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8500

def OrderPriceDetailComponentKey.vat_item_price
  @@_vat_item_price ||= OrderPriceDetailComponentKey.new('vat_item_price')
end

.vat_subsidyObject

An offset to account for any VAT subsidized by the organization. For example, if VAT is included in an item price and changes at the order level (due to passing de minimis threshold, or the destination having a more specific VAT rate), the difference will be represented here.



8576
8577
8578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8576

def OrderPriceDetailComponentKey.vat_subsidy
  @@_vat_subsidy ||= OrderPriceDetailComponentKey.new('vat_subsidy')
end

Instance Method Details

#to_hashObject



8588
8589
8590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8588

def to_hash
  value
end