diff --git a/doc/development/api/payment.rst b/doc/development/api/payment.rst new file mode 100644 index 0000000000..5b70dd4a61 --- /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