Class: PaymentMethod::DelhiveryCod
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- PaymentMethod::DelhiveryCod
- Defined in:
- app/models/spree/payment_method/delhivery_cod.rb
Instance Method Summary collapse
- #actions ⇒ Object
-
#authorize(*args) ⇒ Object
Satisfies the Spree API and Rails Checkout authorization step.
- #auto_capture? ⇒ Boolean
- #can_capture?(payment) ⇒ Boolean
- #can_void?(payment) ⇒ Boolean
- #capture(*args) ⇒ Object
- #configuration_guide_partial_name ⇒ Object
- #description_partial_name ⇒ Object
- #method_type ⇒ Object
- #payment_icon_name ⇒ Object
-
#purchase(*args) ⇒ Object
Satisfies checkout engines that try to purchase immediately.
- #source_required? ⇒ Boolean
- #void(*args) ⇒ Object
Instance Method Details
#actions ⇒ Object
27 28 29 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 27 def actions %w{authorize capture void purchase} end |
#authorize(*args) ⇒ Object
Satisfies the Spree API and Rails Checkout authorization step
40 41 42 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 40 def (*args) ActiveMerchant::Billing::Response.new(true, "Delhivery COD Authorized", {}, {}) end |
#auto_capture? ⇒ Boolean
23 24 25 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 23 def auto_capture? false end |
#can_capture?(payment) ⇒ Boolean
31 32 33 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 31 def can_capture?(payment) ['checkout', 'pending'].include?(payment.state) end |
#can_void?(payment) ⇒ Boolean
35 36 37 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 35 def can_void?(payment) payment.state != 'void' end |
#capture(*args) ⇒ Object
49 50 51 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 49 def capture(*args) ActiveMerchant::Billing::Response.new(true, "Delhivery COD Captured", {}, {}) end |
#configuration_guide_partial_name ⇒ Object
15 16 17 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 15 def configuration_guide_partial_name 'delhivery_cod' end |
#description_partial_name ⇒ Object
11 12 13 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 11 def description_partial_name 'delhivery_cod' end |
#method_type ⇒ Object
3 4 5 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 3 def method_type 'delhivery_cod' end |
#payment_icon_name ⇒ Object
7 8 9 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 7 def payment_icon_name 'delhivery_cod' end |
#purchase(*args) ⇒ Object
Satisfies checkout engines that try to purchase immediately
45 46 47 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 45 def purchase(*args) ActiveMerchant::Billing::Response.new(true, "Delhivery COD Purchased", {}, {}) end |
#source_required? ⇒ Boolean
19 20 21 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 19 def source_required? false end |
#void(*args) ⇒ Object
53 54 55 |
# File 'app/models/spree/payment_method/delhivery_cod.rb', line 53 def void(*args) ActiveMerchant::Billing::Response.new(true, "Delhivery COD Voided", {}, {}) end |