Class: Workarea::Orderbot::Order::Tender::StoreCredit

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/orderbot/order/tender/store_credit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tender, options = {}) ⇒ StoreCredit

Returns a new instance of StoreCredit.



8
9
10
11
# File 'app/services/workarea/orderbot/order/tender/store_credit.rb', line 8

def initialize(tender, options = {})
  @tender = tender
  @option = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'app/services/workarea/orderbot/order/tender/store_credit.rb', line 6

def options
  @options
end

#tenderObject (readonly)

Returns the value of attribute tender.



6
7
8
# File 'app/services/workarea/orderbot/order/tender/store_credit.rb', line 6

def tender
  @tender
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
20
21
# File 'app/services/workarea/orderbot/order/tender/store_credit.rb', line 13

def to_h
  {
    payment_reference_id: tender.id.to_s,
    payment_type: "cheque",
    payment_method_type:  "paid_from_web",
    amount_paid: tender.amount.to_f,
    payment_date: transaction.created_at.iso8601
  }
end