mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Add draft of payment api documentation
This commit is contained in:
28
doc/development/api/payment.rst
Normal file
28
doc/development/api/payment.rst
Normal file
@@ -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 <pluginsetup>` 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
|
||||
Reference in New Issue
Block a user