Class: Spree::Adyen::HppSource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::Adyen::HppSource
- Defined in:
- app/models/spree/adyen/hpp_source.rb
Constant Summary collapse
- MANUALLY_REFUNDABLE =
[ "directEbanking" ].freeze
- PENDING =
"PENDING".freeze
- AUTHORISED =
"AUTHORISED".freeze
- REFUSED =
"REFUSED".freeze
- CANCELLED =
"CANCELLED".freeze
Instance Method Summary collapse
- #actions ⇒ Object
- #authorised? ⇒ Boolean
- #can_cancel?(payment) ⇒ Boolean
- #can_capture?(payment) ⇒ Boolean
- #requires_manual_refund? ⇒ Boolean
Instance Method Details
#actions ⇒ Object
49 50 51 52 53 54 55 |
# File 'app/models/spree/adyen/hpp_source.rb', line 49 def actions if mutable? else [] end end |
#authorised? ⇒ Boolean
65 66 67 68 69 |
# File 'app/models/spree/adyen/hpp_source.rb', line 65 def # Many banks return pending, this is considered a valid response and # the order should proceed. [PENDING, AUTHORISED].include? auth_result end |
#can_cancel?(payment) ⇒ Boolean
57 58 59 |
# File 'app/models/spree/adyen/hpp_source.rb', line 57 def can_cancel? payment payment.refunds.empty? end |
#can_capture?(payment) ⇒ Boolean
45 46 47 |
# File 'app/models/spree/adyen/hpp_source.rb', line 45 def can_capture? payment payment.uncaptured_amount != 0.0 end |
#requires_manual_refund? ⇒ Boolean
61 62 63 |
# File 'app/models/spree/adyen/hpp_source.rb', line 61 def requires_manual_refund? MANUALLY_REFUNDABLE.include?(payment_method) end |