Class: Spree::SixSaferpayPayment
- Inherits:
-
PaymentSource
- Object
- PaymentSource
- Spree::SixSaferpayPayment
- Defined in:
- app/models/spree/six_saferpay_payment.rb
Overview
attributes
-
:token
-
:expiration
-
:redirect_url
-
:transaction_id
-
:transaction_status
-
:transaction_date
-
:six_transaction_reference
-
:display_text
-
:masked_number
-
:expiration_year
-
:expiration_month
-
:response_hash
Instance Method Summary collapse
- #address ⇒ Object
- #brand_name ⇒ Object
- #card ⇒ Object
- #create_solidus_payment! ⇒ Object
- #icon_name ⇒ Object
- #liability ⇒ Object
- #month ⇒ Object
- #name ⇒ Object
-
#payment_means ⇒ Object
This memoization only works if response_payment_means is not nil.
- #transaction ⇒ Object
- #year ⇒ Object
Instance Method Details
#address ⇒ Object
29 30 31 |
# File 'app/models/spree/six_saferpay_payment.rb', line 29 def address @address ||= order.bill_address end |
#brand_name ⇒ Object
66 67 68 |
# File 'app/models/spree/six_saferpay_payment.rb', line 66 def brand_name payment_means&.brand&.name end |
#card ⇒ Object
58 59 60 |
# File 'app/models/spree/six_saferpay_payment.rb', line 58 def card payment_means&.card end |
#create_solidus_payment! ⇒ Object
25 26 27 |
# File 'app/models/spree/six_saferpay_payment.rb', line 25 def create_solidus_payment! payments.create!(order: order, response_code: transaction_id, payment_method: payment_method, amount: order.total, source: self) end |
#icon_name ⇒ Object
78 79 80 |
# File 'app/models/spree/six_saferpay_payment.rb', line 78 def icon_name payment_means&.brand&.payment_method&.downcase end |
#liability ⇒ Object
50 51 52 53 54 55 56 |
# File 'app/models/spree/six_saferpay_payment.rb', line 50 def liability @liability ||= begin if liability_response = response_hash[:liability] ::SixSaferpay::Liability.new(liability_response) end end end |
#month ⇒ Object
70 71 72 |
# File 'app/models/spree/six_saferpay_payment.rb', line 70 def month card&.exp_month end |
#name ⇒ Object
62 63 64 |
# File 'app/models/spree/six_saferpay_payment.rb', line 62 def name card&.holder_name end |
#payment_means ⇒ Object
This memoization only works if response_payment_means is not nil.
34 35 36 37 38 39 40 |
# File 'app/models/spree/six_saferpay_payment.rb', line 34 def payment_means @payment_means ||= begin if payment_means_response = response_hash[:payment_means] ::SixSaferpay::ResponsePaymentMeans.new(payment_means_response) end end end |
#transaction ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/models/spree/six_saferpay_payment.rb', line 42 def transaction @transaction ||= begin if transaction_response = response_hash[:transaction] ::SixSaferpay::Transaction.new(transaction_response) end end end |
#year ⇒ Object
74 75 76 |
# File 'app/models/spree/six_saferpay_payment.rb', line 74 def year card&.exp_year end |