Processor Backends

There always needs to be a special Organization, the processor in your database. The processor represents the payment processor backend in charge and deposit transactions.

Organization with pk=1 will be considered to be the default processor. This can be overridden by defining PROCESSOR_ID in the settings block.

$ cat settings.py

SAAS = {
    'PROCESSOR_ID': 1
}

Razorpay configuration

Install Razorpay pip package

$ pip install razorpay

Go to your Razorpay dashboard “API Keys”, click on “Generate Key”, then copy/paste the keys into your project settings.py

SAAS = {
    'PROCESSOR': {
        'BACKEND': 'saas.backends.razorpay_processor.RazorpayBackend',
        'PRIV_KEY': "...",
        'PUB_KEY': "...",
    }
}

Stripe configuration

The Stripe backend works in 3 different modes:

  • LOCAL

  • FORWARD

  • REMOTE

In LOCAL mode, Stripe Customer and Charge objects are created on the Stripe Account identified by settings.PROCESSOR[‘PRIV_KEY’]. All transfers are made to the bank account associated to that account. Stripe fees are paid by the broker.

In FORWARD mode, Stripe Customer and Charge objects are also created on the Stripe account identified by settings.PROCESSOR[‘PRIV_KEY’] but each Charge is tied automatically to a Stripe Transfer to a Stripe Connect Account. Stripe fees are paid by the broker.

In REMOTE mode, Stripe Customer and Charge objects are created on the Stripe Connect Account. Stripe fees are paid by the provider.

To configure Stripe Connect, follow the instructions at https://stripe.com/docs/connect,

Go to “Account Settings” > “Connect”

Edit the redirect_url and copy/paste the keys into your project settings.py

SAAS = {
    'PROCESSOR': {
        'BACKEND': 'saas.backends.stripe_processor.StripeBackend',
        'PRIV_KEY': "...",
        'PUB_KEY': "...",
    # optional
        'CLIENT_ID': "...",
        'MODE': "...",
    }
}