From 46dd06897cc861d30c7db0f5d6c58af227c337f4 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 14 Mar 2015 14:19:58 +0100 Subject: [PATCH] Add draft of payment api documentation --- doc/development/api/payment.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/development/api/payment.rst diff --git a/doc/development/api/payment.rst b/doc/development/api/payment.rst new file mode 100644 index 000000000..5b70dd4a6 --- /dev/null +++ b/doc/development/api/payment.rst @@ -0,0 +1,28 @@ +.. highlight:: python + :linenothreshold: 5 + +Writing a payment provider plugin +================================= + +In this document, we will walk through the creation of a payment provider plugin. + +Please read :ref:`Creating a plugin ` first, if you haven't already. + +The signal +---------- + +The payment provider API does not make a lot of usage from signals, however, it +does use a signal to get a list of all available payment providers. Your plugin +should listen for this signal and return the subclass of ``pretix.base.payment.PaymentProvider`` +that we'll soon create:: + + from django.dispatch import receiver + + from pretix.base.signals import register_payment_providers + + from .payment import BankTransfer + + + @receiver(register_payment_providers) + def register_payment_provider(sender, **kwargs): + return BankTransfer