Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.15 KB

checkout_and_payment.rst

File metadata and controls

40 lines (25 loc) · 1.15 KB

Checkout & payment

To enable basket checkout you need to define a payment method in SALESMAN_PAYMENT_METHODS setting which accepts a list of dotted paths to salesman.checkout.payment.PaymentMethod classes.

Note

For this example, we assume your custom app is named shop.

1. Create payment method

First create your custom payment method. Payment methods are required to specify a label and a unique identifier property on class. To enable payment for the basket you should also override the salesman.checkout.payment.PaymentMethod.basket_payment method. Eg:

/../example/shop/payment.py

2. Register payment method

Then register your payment method in settings.py:

SALESMAN_PAYMENT_METHODS = [
    'shop.payment.PayInAdvance',
]

Now you can make a basket purchase through the :http:post:/checkout/ request with payment_method set to pay-in-advance.

For more information about payment methods see payment_methods.