Class: Workarea::GlobalE::Merchant::Product
- Inherits:
-
Object
- Object
- Workarea::GlobalE::Merchant::Product
- Defined in:
- app/services/workarea/global_e/merchant/product.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#attributes ⇒ Array<Workarea::GlobalE::CartProductAttribute>
Custom attributes describe product that customer can personalize according to what the site offers.
-
#back_order_date ⇒ String
Estimated date for the backordered item to be in stock.
-
#brand ⇒ Workarea::GlobalE::MerchantBrand
Product’s brand.
-
#cart_item_id ⇒ String
Identifier of the cart item on the Merchant’s site originally specified in Product.CartItemId property of the respective product in SendCart method for the cart converted to this order on Global-e.
-
#cart_item_option_id ⇒ String
Identifier of the child cart item “option” on the Merchant’s site originally specified in Product.CartItemOptionId property of the respective product in SendCart method for the cart converted to this order on Global-e.
-
#categories ⇒ Array<Workarea::GlobalE::MerchantCategory>
Product’s categories.
-
#discounted_price ⇒ Float
The product value in merchant currency after deducting all product and cart level discounts from the price.
-
#discounted_price_for_customs ⇒ String
Product price exclusive of duties & taxes in base currency.
-
#generic_hs_code ⇒ String
Product HS code.
-
#gift_message ⇒ String
Text originally specified in Product.GiftMessage property of the respective product in SendCart method for the cart converted to this order on Global-e.
-
#handling_code ⇒ String
Code originally specified in Product.HandlingCode property of the respective product in SendCart method for the cart converted to this order on Global-e.
-
#initialize(hash) ⇒ Product
constructor
A new instance of Product.
-
#international_discounted_price ⇒ Float
The product value in customer currency after deducting all product and cart level discounts from the price.
- #international_list_price ⇒ Object
-
#international_price ⇒ Float
Single product price in end customer’s currency (specified in InternationalDetails.CurrencyCode property for the respective Merchant.Order), after applying country coefficient, FX conversion, rounding rule (if applicable) and IncludeVAT handling.
-
#is_back_ordered ⇒ Boolean
Boolean specifying if the product was ordered as a backed ordered item.
-
#line_item_international_price ⇒ Float
Line item (product in ordered quantity) price in end customer’s currency (specified in InternationalDetails.CurrencyCode property for the respective Merchant.Order), after applying country coefficient, FX conversion, rounding rule (if applicable) and IncludeVAT handling.
- #list_price ⇒ Object
-
#parent_cart_item_id ⇒ String
Identifier of the current item’s parent cart item on the Merchant’s site originally specified in Product.ParentCartItemId property of the respective product in SendCart method for the cart converted to this order on Global-e.
-
#price ⇒ Float
Single product price in currency defined in CurrencyCode property of the respective Merchant.Order object for the order being submitted to the Merchant.
-
#quantity ⇒ Integer
Product quantity in the order that is currently being submitted to the Merchant.
-
#rounding_rate ⇒ Float
Conversion rate applied to this product’s price paid by the end customer, when calculating the prices paid by Global-e to the Merchant in the original Merchant’s currency.
-
#sku ⇒ String
SKU code used to identify the product on the Merchant’s site (to be mapped on Global-e side).
-
#vat_rate ⇒ Float
VAT rate applied to this product.
Constructor Details
#initialize(hash) ⇒ Product
Returns a new instance of Product.
7 8 9 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 7 def initialize(hash) @hash = hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
5 6 7 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 5 def hash @hash end |
Instance Method Details
#attributes ⇒ Array<Workarea::GlobalE::CartProductAttribute>
Custom attributes describe product that customer can personalize according to what the site offers. Each Attribute holds Key to specify attribute name and Value properties.
193 194 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 193 def attributes end |
#back_order_date ⇒ String
Estimated date for the backordered item to be in stock
143 144 145 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 143 def back_order_date hash["BackOrderDate"] end |
#brand ⇒ Workarea::GlobalE::MerchantBrand
Product’s brand
177 178 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 177 def brand end |
#cart_item_id ⇒ String
Identifier of the cart item on the Merchant’s site originally specified in Product.CartItemId property of the respective product in SendCart method for the cart converted to this order on Global-e.
86 87 88 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 86 def cart_item_id hash["CartItemId"] end |
#cart_item_option_id ⇒ String
Identifier of the child cart item “option” on the Merchant’s site originally specified in Product.CartItemOptionId property of the respective product in SendCart method for the cart converted to this order on Global-e.
108 109 110 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 108 def cart_item_option_id hash["CartItemOptionId"] end |
#categories ⇒ Array<Workarea::GlobalE::MerchantCategory>
Product’s categories
184 185 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 184 def categories end |
#discounted_price ⇒ Float
The product value in merchant currency after deducting all product and cart level discounts from the price. Product level discounts will be fully deducted from the respective product’s price and cart discounts will be prorated over all products according to the remaining value.
This value can be used as pre-calculated value for returned product’s refund.
156 157 158 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 156 def discounted_price hash["DiscountedPrice"] end |
#discounted_price_for_customs ⇒ String
Product price exclusive of duties & taxes in base currency
208 209 210 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 208 def discounted_price_for_customs hash["DiscountedPriceForCustoms"] end |
#generic_hs_code ⇒ String
Product HS code
216 217 218 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 216 def generic_hs_code hash["GenericHSCode"] end |
#gift_message ⇒ String
Text originally specified in Product.GiftMessage property of the respective product in SendCart method for the cart converted to this order on Global-e.
127 128 129 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 127 def hash["GiftMessage"] end |
#handling_code ⇒ String
Code originally specified in Product.HandlingCode property of the respective product in SendCart method for the cart converted to this order on Global-e.
118 119 120 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 118 def handling_code hash["HandlingCode"] end |
#international_discounted_price ⇒ Float
The product value in customer currency after deducting all product and cart level discounts from the price. Product level discounts will be fully deducted from the respective product’s price and cart discounts will be prorated over all products according to the remaining value.
This value can be used as pre-calculated value for returned product’s refund.
169 170 171 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 169 def international_discounted_price hash["InternationalDiscountedPrice"] end |
#international_list_price ⇒ Object
200 201 202 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 200 def international_list_price hash["InternationalListPrice"] end |
#international_price ⇒ Float
Single product price in end customer’s currency (specified in InternationalDetails.CurrencyCode property for the respective Merchant.Order), after applying country coefficient, FX conversion, rounding rule (if applicable) and IncludeVAT handling.
45 46 47 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 45 def international_price hash["InternationalPrice"] end |
#is_back_ordered ⇒ Boolean
Boolean specifying if the product was ordered as a backed ordered item
135 136 137 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 135 def is_back_ordered hash["IsBackOrdered"] end |
#line_item_international_price ⇒ Float
Line item (product in ordered quantity) price in end customer’s currency (specified in InternationalDetails.CurrencyCode property for the respective Merchant.Order), after applying country coefficient, FX conversion, rounding rule (if applicable) and IncludeVAT handling. If not specified, should be deemed equal to “InternationalPrice * Quantity”. If specified, should take preference over InternationalPrice.
58 59 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 58 def line_item_international_price end |
#list_price ⇒ Object
196 197 198 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 196 def list_price hash["ListPrice"] end |
#parent_cart_item_id ⇒ String
Identifier of the current item’s parent cart item on the Merchant’s site originally specified in Product.ParentCartItemId property of the respective product in SendCart method for the cart converted to this order on Global-e.
97 98 99 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 97 def parent_cart_item_id hash["ParentCartItemId"] end |
#price ⇒ Float
Single product price in currency defined in CurrencyCode property of the respective Merchant.Order object for the order being submitted to the Merchant.
26 27 28 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 26 def price hash["Price"] end |
#quantity ⇒ Integer
Product quantity in the order that is currently being submitted to the Merchant.
76 77 78 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 76 def quantity hash["Quantity"] end |
#rounding_rate ⇒ Float
Conversion rate applied to this product’s price paid by the end customer, when calculating the prices paid by Global-e to the Merchant in the original Merchant’s currency. This rate includes “FX conversion” and “marketing rounding” factors.
68 69 70 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 68 def rounding_rate hash["RoundingRate"] end |
#sku ⇒ String
SKU code used to identify the product on the Merchant’s site (to be mapped on Global-e side).
16 17 18 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 16 def sku hash["Sku"] end |
#vat_rate ⇒ Float
VAT rate applied to this product
34 35 36 |
# File 'app/services/workarea/global_e/merchant/product.rb', line 34 def vat_rate hash["VATRate"] end |