Skip to content

Payment methods

Valentin Ballestrino edited this page Nov 23, 2016 · 7 revisions

Yo handle payment gateways in your app, you need to integrate them with your app. Some gateways have integrations with Stall, so integrating them in your app should be dead simple.

If no existing gateway cover your needs, you can create your own.

Existing payment gateways

Creating your own

Create a Stall::Shipping::Calculator subclass in your app's lib/ folder, which defined two methods : #available_for?(address) and #price :

class MyPaymentGateway < Stall::Payments::Gateway
end

The add it in the stall initializer :

# If the class is not in your app's autoload_paths, require it
require 'my_payment_gateway'

Stall.configure do |config|
  config.shipping.register_gateway :my_payment_gateway, 'MyPaymentGateway'
end

Restart your server and you should be able to access the payment method.

Clone this wiki locally