Class: PaymentMethod::BcashMethod
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- PaymentMethod::BcashMethod
- Defined in:
- app/models/spree/payment_method/bcash_method.rb
Instance Attribute Summary collapse
-
#order_id ⇒ Object
Returns the value of attribute order_id.
Instance Method Summary collapse
- #actions ⇒ Object
- #can_capture?(payment) ⇒ Boolean
- #can_void?(payment) ⇒ Boolean
- #capture(*args) ⇒ Object
- #package(payment) ⇒ Object
- #payment_source_class ⇒ Object
- #source_required? ⇒ Boolean
- #void(*args) ⇒ Object
Instance Attribute Details
#order_id ⇒ Object
Returns the value of attribute order_id.
6 7 8 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 6 def order_id @order_id end |
Instance Method Details
#actions ⇒ Object
17 18 19 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 17 def actions %w{capture void} end |
#can_capture?(payment) ⇒ Boolean
21 22 23 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 21 def can_capture?(payment) ['checkout', 'pending'].include?(payment.state) end |
#can_void?(payment) ⇒ Boolean
25 26 27 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 25 def can_void?(payment) payment.state != 'void' end |
#capture(*args) ⇒ Object
29 30 31 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 29 def capture(*args) ActiveMerchant::Billing::Response.new(true, "", {}, {}) end |
#package(payment) ⇒ Object
37 38 39 40 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 37 def package(payment) bcash_payment = Spree::BcashPayment.new bcash_payment.process!(payment) end |
#payment_source_class ⇒ Object
9 10 11 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 9 def payment_source_class self.class end |
#source_required? ⇒ Boolean
13 14 15 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 13 def source_required? false end |
#void(*args) ⇒ Object
33 34 35 |
# File 'app/models/spree/payment_method/bcash_method.rb', line 33 def void(*args) ActiveMerchant::Billing::Response.new(true, "", {}, {}) end |