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
  • FORMWARD
  • 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.

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.

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

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': "...",
    }
}