Class: Gateway::AcledaMobile
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- Gateway::AcledaMobile
- Defined in:
- app/models/spree/gateway/acleda_mobile.rb
Instance Method Summary collapse
-
#auto_capture? ⇒ Boolean
force to purchase instead of authorize.
-
#available_for_order?(_order) ⇒ Boolean
Custom PaymentMethod/Gateway can redefine this method to check method availability for concrete order.
- #cancel(_response_code) ⇒ Object
-
#method_type ⇒ Object
partial to render the gateway.
- #payment_profiles_supported? ⇒ Boolean
- #payment_source_class ⇒ Object
- #process(_money, _source, gateway_options) ⇒ Object
Instance Method Details
#auto_capture? ⇒ Boolean
force to purchase instead of authorize
27 28 29 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 27 def auto_capture? true end |
#available_for_order?(_order) ⇒ Boolean
Custom PaymentMethod/Gateway can redefine this method to check method availability for concrete order.
22 23 24 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 22 def available_for_order?(_order) true end |
#cancel(_response_code) ⇒ Object
38 39 40 41 42 43 44 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 38 def cancel(_response_code) # we can use this to send request to payment gateway api to cancel the payment ( void ) # currently Payway does not support to cancel the gateway # in our case don't do anything ActiveMerchant::Billing::Response.new(true, 'Acleda Mobile order has been cancelled.') end |
#method_type ⇒ Object
partial to render the gateway.
8 9 10 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 8 def method_type 'acleda_mobile' end |
#payment_profiles_supported? ⇒ Boolean
16 17 18 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 16 def payment_profiles_supported? false end |
#payment_source_class ⇒ Object
12 13 14 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 12 def payment_source_class Spree::VpagoPaymentSource end |
#process(_money, _source, gateway_options) ⇒ Object
31 32 33 34 35 36 |
# File 'app/models/spree/gateway/acleda_mobile.rb', line 31 def process(_money, _source, ) Rails.logger.debug { "About to create payment for order #{[:order_id]}" } # First of all, invalidate all previous tranx orders to prevent multiple paid orders # source.save! ActiveMerchant::Billing::Response.new(true, 'Order created') end |