Class: PaymentMethod::BankTransfer
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- PaymentMethod::BankTransfer
- Defined in:
- app/models/spree/payment_method/bank_transfer.rb
Instance Method Summary collapse
- #actions ⇒ Object
-
#can_capture?(payment) ⇒ Boolean
Indicates whether its possible to capture the payment.
-
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
- #cancel ⇒ Object
- #capture ⇒ Object
- #credit ⇒ Object
- #public_preferences ⇒ Object
- #source_required? ⇒ Boolean
- #void ⇒ Object
Instance Method Details
#actions ⇒ Object
3 4 5 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 3 def actions %w[capture void] end |
#can_capture?(payment) ⇒ Boolean
Indicates whether its possible to capture the payment
8 9 10 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 8 def can_capture?(payment) [ 'checkout', 'pending' ].include?(payment.state) end |
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
13 14 15 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 13 def can_void?(payment) payment.state != 'void' end |
#cancel ⇒ Object
25 26 27 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 25 def cancel(*) simulated_successful_billing_response end |
#capture ⇒ Object
17 18 19 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 17 def capture(*) simulated_successful_billing_response end |
#credit ⇒ Object
33 34 35 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 33 def credit(*) simulated_successful_billing_response end |
#public_preferences ⇒ Object
37 38 39 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 37 def public_preferences super.merge(bank_accounts: Spree::Bank.active) end |
#source_required? ⇒ Boolean
29 30 31 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 29 def source_required? false end |
#void ⇒ Object
21 22 23 |
# File 'app/models/spree/payment_method/bank_transfer.rb', line 21 def void(*) simulated_successful_billing_response end |