Class: Workarea::Orderbot::Order::Tender::CreditCard
- Inherits:
-
Object
- Object
- Workarea::Orderbot::Order::Tender::CreditCard
- Defined in:
- app/services/workarea/orderbot/order/tender/credit_card.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 = {}) ⇒ CreditCard
constructor
A new instance of CreditCard.
- #to_h ⇒ Object
Constructor Details
#initialize(tender, options = {}) ⇒ CreditCard
Returns a new instance of CreditCard.
8 9 10 11 |
# File 'app/services/workarea/orderbot/order/tender/credit_card.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/credit_card.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/credit_card.rb', line 6 def tender @tender end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/services/workarea/orderbot/order/tender/credit_card.rb', line 13 def to_h { payment_reference_id: tender.id.to_s, payment_type: "credit_card", payment_method_type: tender.issuer.optionize, amount_paid: tender.amount.to_f, payment_date: transaction.created_at.iso8601, auth_code: transaction.response., credit_card: { transaction_id: transaction_id, authorization_code: transaction.response., last_four_digits: tender.display_number.last(4) } } end |