Class: PaymentMethod::Omnikassa
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- PaymentMethod::Omnikassa
- Defined in:
- app/models/spree/payment_method/omnikassa.rb
Class Method Summary collapse
Instance Method Summary collapse
- #actions ⇒ Object
- #can_capture?(payment) ⇒ Boolean
- #capture(payment) ⇒ Object
- #source_required? ⇒ Boolean
- #url ⇒ Object
Class Method Details
.fetch_payment_method ⇒ Object
34 35 36 37 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 34 def self.fetch_payment_method name = "Omnikassa" Spree::PaymentMethod.find(:first, :conditions => [ "lower(name) = ?", name.downcase ]) || raise(ActiveRecord::RecordNotFound) end |
Instance Method Details
#actions ⇒ Object
7 8 9 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 7 def actions %w{capture} end |
#can_capture?(payment) ⇒ Boolean
11 12 13 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 11 def can_capture?(payment) ['checkout', 'pending'].include?(payment.state) end |
#capture(payment) ⇒ Object
15 16 17 18 19 20 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 15 def capture(payment) #payments with state "checkout" must be moved into state "pending" first: payment.update_attribute(:state, "pending") if payment.state == "checkout" payment.complete true end |
#source_required? ⇒ Boolean
22 23 24 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 22 def source_required? false end |
#url ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/models/spree/payment_method/omnikassa.rb', line 26 def url if self.environment == "production" "https://payment-webinit.omnikassa.rabobank.nl/paymentServlet" else "https://payment-webinit.simu.omnikassa.rabobank.nl/paymentServlet" end end |