Skip to content

Commit

Permalink
Add order model example to docs
Browse files Browse the repository at this point in the history
Currently the "Checkout and Payment" documentation page has an example payment.py that does not work if you follow the guide, because the guide never has you set up the custom Order model that it's using behind the scenes.
  • Loading branch information
pbadeer committed Feb 9, 2024
1 parent 8105e84 commit 2340053
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/checkout_and_payment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ which accepts a list of dotted paths to :class:`salesman.checkout.payment.Paymen

.. raw:: html

<h3>1. Create payment method</h3>
<h3>1. Create order model</h3>

In this example we don't modify the Order model, but you can if you want to.

.. literalinclude:: /../example/shop/models/order.py

.. raw:: html

<h3>2. Create payment method</h3>

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
Expand All @@ -23,7 +31,7 @@ override the :meth:`salesman.checkout.payment.PaymentMethod.basket_payment` meth

.. raw:: html

<h3>2. Register payment method</h3>
<h3>3. Register payment method</h3>

Then register your payment method in ``settings.py``:

Expand Down

0 comments on commit 2340053

Please sign in to comment.