Class: PaymentMethod::CashOn

Inherits:
Spree::PaymentMethod
  • Object
show all
Defined in:
app/models/spree/payment_method/cash_on.rb

Instance Method Summary collapse

Instance Method Details

#auto_capture?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/models/spree/payment_method/cash_on.rb', line 11

def auto_capture?
  true
end

#cancel(_response_code, _payment = nil) ⇒ Object

override: Spree::Payment#cancel! calls payment_method.cancel(response_code, payment). Cash has no gateway to void against, so acknowledge success and let the payment transition to void.



18
19
20
# File 'app/models/spree/payment_method/cash_on.rb', line 18

def cancel(_response_code, _payment = nil)
  ActiveMerchant::Billing::Response.new(true, 'Cash On: Payment has been canceled.')
end

#payment_source_classObject



3
4
5
# File 'app/models/spree/payment_method/cash_on.rb', line 3

def payment_source_class
  Spree::VpagoPaymentSource
end

#source_required?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/spree/payment_method/cash_on.rb', line 7

def source_required?
  true
end