summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarcin Gębala <maarcin.gebala@gmail.com>2014-09-02 17:11:14 +0200
committerMarcin Gębala <maarcin.gebala@gmail.com>2014-09-02 17:11:14 +0200
commitf055e6bf7c36343106e4db3a6245fbc01e037466 (patch)
tree6d92ba1e4a3f4665441c9a83ce6f3bc080dd5caa /doc
parent9443423dcf663c7ba79c28a29c70092a8b1c48ed (diff)
downloaddjango-payments-taler-f055e6bf7c36343106e4db3a6245fbc01e037466.tar.gz
django-payments-taler-f055e6bf7c36343106e4db3a6245fbc01e037466.tar.bz2
django-payments-taler-f055e6bf7c36343106e4db3a6245fbc01e037466.zip
Refactor preauth chapter
Diffstat (limited to 'doc')
-rw-r--r--doc/preauth.rst49
1 files changed, 29 insertions, 20 deletions
diff --git a/doc/preauth.rst b/doc/preauth.rst
index bf7427c..01f57bf 100644
--- a/doc/preauth.rst
+++ b/doc/preauth.rst
@@ -1,35 +1,44 @@
.. _capture-payments:
-Capture payments later
-======================
+Authorization and capture
+=========================
-Some gateways offer a two-step payment method known as Authorization & Capture, which allows you to collect the payment at a later time. To use this payment type, do the following:
+Some gateways offer a two-step payment method known as Authorization & Capture, which allows you to collect the payment manually after the buyer has authorized it. To enable this payment type, you have to set the ``capture`` parameter to ``False`` in the configuration of payment backend::
-1. Set ``capture`` parameter to ``False`` in the configuration of your payment backend, for example::
+ # settings.py
+ PAYMENT_VARIANTS = {
+ 'default': ('payments.dummy.DummyProvider', {
+ 'capture': False})}
- # settings.py
- PAYMENT_VARIANTS = {
- 'default': ('payments.dummy.DummyProvider', {
- 'capture': False})}
+Capturing the payment
+---------------------
+To capture the payment from the buyer, call the ``capture()`` method on the :class:`Payment` instance::
-2. To capture the payment, call the ``capture()`` method on the :class:`Payment` instance::
+ >>> from payments import get_payment_model
+ >>> Payment = get_payment_model()
+ >>> payment = Payment.objects.get()
+ >>> payment.capture()
- >>> from payments import get_payment_model
- >>> Payment = get_payment_model()
- >>> payment = Payment.objects.get()
- >>> payment.capture()
-
- By default, the total amount will be captured, but you can capture a lower amount, by providing the ``amount`` parameter::
+By default, the total amount will be captured. You can capture a lower amount, by providing the ``amount`` parameter::
>>> from decimal import Decimal
>>> payment.capture(amount=Decimal(10.0))
+.. note::
+
+ Only payments with the ``preauth`` status can be captured.
+
+
+Releasing the payment
+---------------------
+To release the payment to the buyer, call the ``release()`` method on your :class:`Payment` instance::
-3. To release the payment, call the ``release()`` method on your :class:`Payment` instance::
+ >>> from payments import get_payment_model
+ >>> Payment = get_payment_model()
+ >>> payment = Payment.objects.get()
+ >>> payment.release()
- >>> from payments import get_payment_model
- >>> Payment = get_payment_model()
- >>> payment = Payment.objects.get()
- >>> payment.release()
+.. note::
+ Only payments with the ``preauth`` status can be released. \ No newline at end of file