Add plugin documentation

This commit is contained in:
Raphael Michel
2016-12-08 18:20:43 +01:00
parent fa0bd5e89e
commit fb19891473
8 changed files with 152 additions and 0 deletions

13
doc/plugins/index.rst Normal file
View File

@@ -0,0 +1,13 @@
Plugin documentation
====================
This part of the documentation contains information about available plugins
that can be used to extend pretix's functionality.
If you want to **create** a plugin, please go to the
:ref:`Developer documentation <pluginsetup>` instead.
.. toctree::
:maxdepth: 2
list
pretixdroid

30
doc/plugins/list.rst Normal file
View File

@@ -0,0 +1,30 @@
List of plugins
===============
The following plugins are shipped with pretix and are supported in the same
ways that pretix itself is:
* Bank transfer
* PayPal
* Stripe
* Check-in lists
* pretixdroid
* Report exporter
* Send out emails
* Statistics
* PDF ticket output
The following plugins are not shipped with pretix but are maintained by the
same team:
* `Passbook/Wallet ticket output`_
* `Cartshare`_
The following plugins are from independent third-party authors, so we can make
no statements about their stability:
* `esPass ticket output`_
.. _Passbook/Wallet ticket output: https://github.com/pretix/pretix-passbook
.. _Cartshare: https://github.com/pretix/pretix-cartshare
.. _esPass ticket output: https://github.com/esPass/pretix-espass

100
doc/plugins/pretixdroid.rst Normal file
View File

@@ -0,0 +1,100 @@
pretixdroid HTTP API
====================
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
uses to communicate with the pretix server.
.. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/
Redeems a ticket, i.e. checks the user in.
**Example request**:
.. sourcecode:: http
POST /pretixdroid/api/demoorga/democon/redeem/?key=ABCDEF HTTP/1.1
Host: demo.pretix.eu
Accept: application/json, text/javascript
Content-Type: application/x-www-form-urlencoded
secret=az9u4mymhqktrbupmwkvv6xmgds5dk3
**Example successful response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: text/json
{
'status': 'ok'
'version': 2
}
**Example error response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: text/json
{
'status': 'error',
'reason': 'already_redeemed',
'version': 2
}
Possible error reasons:
* ``unpaid`` - Ticket is not paid for or has been refunded
* ``already_redeemed`` - Ticket already has been redeemed
* ``unknown_ticket`` - Secret does not match a ticket in the database
:query key: Secret API key
:statuscode 200: Valid request
:statuscode 404: Unknown organizer or event
:statuscode 403: Invalid authorization key
.. http:get:: /pretixdroid/api/(organizer)/(event)/search/
Searches for a ticket.
At most 25 results will be returned. **Queries with less than 4 characters will always return an empty result set.**
**Example request**:
.. sourcecode:: http
GET /pretixdroid/api/demoorga/democon/search/?key=ABCDEF&query=Peter HTTP/1.1
Host: demo.pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: text/json
{
'results': [
{
'secret': 'az9u4mymhqktrbupmwkvv6xmgds5dk3',
'order': 'ABCE6',
'item': 'Standard ticket',
'variation': null,
'attendee_name': 'Peter Higgs',
'redeemed': false,
'paid': true
},
...
],
'version': 2
}
:query query: Search query
:query key: Secret API key
:statuscode 200: Valid request
:statuscode 404: Unknown organizer or event
:statuscode 403: Invalid authorization key
.. _pretixdroid Android app: https://github.com/pretix/pretixdroid