Class: Workarea::GlobalE::Merchant::Product

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/global_e/merchant/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (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

#attributesArray<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.

Returns:

  • (Array<Workarea::GlobalE::CartProductAttribute>)


193
194
# File 'app/services/workarea/global_e/merchant/product.rb', line 193

def attributes
end

#back_order_dateString

Estimated date for the backordered item to be in stock

Returns:

  • (String)


143
144
145
# File 'app/services/workarea/global_e/merchant/product.rb', line 143

def back_order_date
  hash["BackOrderDate"]
end

#brandWorkarea::GlobalE::MerchantBrand

Product’s brand

Returns:

  • (Workarea::GlobalE::MerchantBrand)


177
178
# File 'app/services/workarea/global_e/merchant/product.rb', line 177

def brand
end

#cart_item_idString

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.

Returns:

  • (String)


86
87
88
# File 'app/services/workarea/global_e/merchant/product.rb', line 86

def cart_item_id
  hash["CartItemId"]
end

#cart_item_option_idString

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.

Returns:

  • (String)


108
109
110
# File 'app/services/workarea/global_e/merchant/product.rb', line 108

def cart_item_option_id
  hash["CartItemOptionId"]
end

#categoriesArray<Workarea::GlobalE::MerchantCategory>

Product’s categories

Returns:

  • (Array<Workarea::GlobalE::MerchantCategory>)


184
185
# File 'app/services/workarea/global_e/merchant/product.rb', line 184

def categories
end

#discounted_priceFloat

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.

Returns:

  • (Float)


156
157
158
# File 'app/services/workarea/global_e/merchant/product.rb', line 156

def discounted_price
  hash["DiscountedPrice"]
end

#discounted_price_for_customsString

Product price exclusive of duties & taxes in base currency

Returns:

  • (String)


208
209
210
# File 'app/services/workarea/global_e/merchant/product.rb', line 208

def discounted_price_for_customs
  hash["DiscountedPriceForCustoms"]
end

#generic_hs_codeString

Product HS code

Returns:

  • (String)


216
217
218
# File 'app/services/workarea/global_e/merchant/product.rb', line 216

def generic_hs_code
  hash["GenericHSCode"]
end

#gift_messageString

Text originally specified in Product.GiftMessage property of the respective product in SendCart method for the cart converted to this order on Global-e.

Returns:

  • (String)


127
128
129
# File 'app/services/workarea/global_e/merchant/product.rb', line 127

def gift_message
  hash["GiftMessage"]
end

#handling_codeString

Code originally specified in Product.HandlingCode property of the respective product in SendCart method for the cart converted to this order on Global-e.

Returns:

  • (String)


118
119
120
# File 'app/services/workarea/global_e/merchant/product.rb', line 118

def handling_code
  hash["HandlingCode"]
end

#international_discounted_priceFloat

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.

Returns:

  • (Float)


169
170
171
# File 'app/services/workarea/global_e/merchant/product.rb', line 169

def international_discounted_price
  hash["InternationalDiscountedPrice"]
end

#international_list_priceObject



200
201
202
# File 'app/services/workarea/global_e/merchant/product.rb', line 200

def international_list_price
  hash["InternationalListPrice"]
end

#international_priceFloat

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.

Returns:

  • (Float)


45
46
47
# File 'app/services/workarea/global_e/merchant/product.rb', line 45

def international_price
  hash["InternationalPrice"]
end

#is_back_orderedBoolean

Boolean specifying if the product was ordered as a backed ordered item

Returns:

  • (Boolean)


135
136
137
# File 'app/services/workarea/global_e/merchant/product.rb', line 135

def is_back_ordered
  hash["IsBackOrdered"]
end

#line_item_international_priceFloat

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.

Returns:

  • (Float)


58
59
# File 'app/services/workarea/global_e/merchant/product.rb', line 58

def line_item_international_price
end

#list_priceObject



196
197
198
# File 'app/services/workarea/global_e/merchant/product.rb', line 196

def list_price
  hash["ListPrice"]
end

#parent_cart_item_idString

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.

Returns:

  • (String)


97
98
99
# File 'app/services/workarea/global_e/merchant/product.rb', line 97

def parent_cart_item_id
  hash["ParentCartItemId"]
end

#priceFloat

Single product price in currency defined in CurrencyCode property of the respective Merchant.Order object for the order being submitted to the Merchant.

Returns:

  • (Float)


26
27
28
# File 'app/services/workarea/global_e/merchant/product.rb', line 26

def price
  hash["Price"]
end

#quantityInteger

Product quantity in the order that is currently being submitted to the Merchant.

Returns:

  • (Integer)


76
77
78
# File 'app/services/workarea/global_e/merchant/product.rb', line 76

def quantity
  hash["Quantity"]
end

#rounding_rateFloat

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.

Returns:

  • (Float)


68
69
70
# File 'app/services/workarea/global_e/merchant/product.rb', line 68

def rounding_rate
  hash["RoundingRate"]
end

#skuString

SKU code used to identify the product on the Merchant’s site (to be mapped on Global-e side).

Returns:

  • (String)


16
17
18
# File 'app/services/workarea/global_e/merchant/product.rb', line 16

def sku
  hash["Sku"]
end

#vat_rateFloat

VAT rate applied to this product

Returns:

  • (Float)


34
35
36
# File 'app/services/workarea/global_e/merchant/product.rb', line 34

def vat_rate
  hash["VATRate"]
end