Class: Workarea::Orderbot::Order::Tender::StoreCredit
- Inherits:
-
Object
- Object
- Workarea::Orderbot::Order::Tender::StoreCredit
- Defined in:
- app/services/workarea/orderbot/order/tender/store_credit.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#tender ⇒ Object
readonly
Returns the value of attribute tender.
Instance Method Summary collapse
-
#initialize(tender, options = {}) ⇒ StoreCredit
constructor
A new instance of StoreCredit.
- #to_h ⇒ Object
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, = {}) @tender = tender @option = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/services/workarea/orderbot/order/tender/store_credit.rb', line 6 def @options end |
#tender ⇒ Object (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_h ⇒ Object
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 |