Class: Workarea::GlobalE::Merchant::OrderRefund

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ OrderRefund

Returns a new instance of OrderRefund.



7
8
9
# File 'app/services/workarea/global_e/merchant/order_refund.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/order_refund.rb', line 5

def hash
  @hash
end

Instance Method Details

#componentsArray<Workarea::GlobalE::Merchant::RefundComponent>

List of RefundComponent objects for this order refund.

Returns:

  • (Array<Workarea::GlobalE::Merchant::RefundComponent>)


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

def components
end

#merchant_guidString

Unique identifier of the Merchant on Global-e.

Returns:

  • (String)


19
20
21
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 19

def merchant_guid
  hash["MerchantGUID"]
end

#merchant_order_idString

Order unique identifier on the Merchant’s site returned from a previous call to SendOrderToMerchant method for this order.

Returns:

  • (String)


36
37
38
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 36

def merchant_order_id
  hash["MerchantOrderId"]
end

#order_idString

Global-e order unique identifier.

Returns:

  • (String)


27
28
29
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 27

def order_id
  hash["OrderId"]
end

#original_total_refund_amountFloat

Refund amount in original Merchant’s currency including the local Merchant’s VAT (currency is specified in CurrencyCode property of the respective Merchant.Order).

Returns:

  • (Float)


46
47
48
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 46

def original_total_refund_amount
  hash["OriginalTotalRefundAmount"]
end

#productsArray<Workarea::GlobalE::Merchant::RefundProduct>

List of RefundProduct objects for this order refund.



80
81
82
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 80

def products
  @products ||= hash["Products"].map { |refund_product| RefundProduct.new refund_product }
end

#refund_commentsString

Comments for the order refund

Returns:

  • (String)


72
73
74
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 72

def refund_comments
  hash["RefundComponent"]
end

#refund_reasonWorkarea::GlobalE::Merchant::OrderRefundReason

Reason for the order refund

Returns:

  • (Workarea::GlobalE::Merchant::OrderRefundReason)


64
65
66
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 64

def refund_reason
  @refund_reason ||= OrderRefundReason.new hash["RefundReason"]
end

#to_hObject



11
12
13
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 11

def to_h
  hash
end

#total_refund_amountFloat

Total refund amount in end customer’s currency used for this order’s payment (currency is specified in InternationalDetails.CurrencyCode property for the respective Merchant.Order).

Returns:

  • (Float)


56
57
58
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 56

def total_refund_amount
  hash["TotalRefundAmount"]
end

#web_store_codeString

Code used on the merchant’s side to identify the web store, as specified in WebStoreCode argument for SendCart method for the cart converted to this order on Global-e.

Returns:

  • (String)


90
91
92
# File 'app/services/workarea/global_e/merchant/order_refund.rb', line 90

def web_store_code
  hash["WebStoreCode"]
end