-
-
Notifications
You must be signed in to change notification settings - Fork 86
Ticket Sale: API and database concept
Columns:
event (INT/PK/AI) (=event id) | news INTEGER | kino INTEGER | file (INT/FK) | title (STRING) | description (STRING) | locality (STRING) | start (DATETIME) | end (DATETIME) | link (STRING) |
---|
Columns:
ticket_type (INT/PK/AI) | event (INT/FK) | price (INT) | contingent (INT) | description (STRING) | ticket_payment (INT/FK) |
---|
Columns:
ticket_history (INT/PK/AI) (=ticket id) | member (INT/FK) | ticket_type (INT/FK) | purchase (TIMESTAMP) | redemption (TIMESTAMP) | created (TIMESTAMP/CT) | code (STRING) |
---|
Columns:
ticket_payment (INT/PK/AI) | name (STRING) | min_amount (DOUBLE) | max_amount (DOUBLE) | config (STRING) |
---|
GET api/event/list/[i:id]?
Parameters:
- id (optional) -> only return event with the defined ID
Response: List
GET api/event/list/[i:earliest]/[i:latest]
Parameters:
- earliest (required) -> only return events that happen at or after the specified timestamp
- latest (required) -> only return events that happen at or before the specified timestamp
Response: Event
3. Fuzzy search for an event. Only returns information shown in the single cards of the event overview.
GET api/event/list/search/[*:search_string]
Parameters:
- search_string (required)
Response: List
4. Get list of purchased tickets for a particular user. Return value for ticketList is null if no tickets have been purchased.
POST api/event/ticket/my/?
Parameters:
none
Response: List
GET api/event/ticket/type/[i:event]
Parameters:
- event (required) -> event ID that the ticket types should be associated with.
Response: List
POST api/event/ticket/validate
Parameters:
- event_id (required) -> event that the ticket is associated with
- code (required) -> ticket code
Response ['valid' => $valid, 'purchase' => $data['purchase'], 'redemption' => $data['redemption'], 'ticket_history' => $data['ticket_history'], 'firstname' => $userdata['firstname'], 'name' => $userdata['surname']]
POST api/event/ticket/redeem
Parameters:
- ticket_history (required) -> ID of the ticket that should be redeemed
Response ['success' => true]
GET api/event/ticket/status/[i:event]/?
Parameters:
- event (required): event to return the stats for
Response: [ { "ticket_type": "1", "contingent": "200", "sold": "3" }, { "ticket_type": "2", "contingent": "100", "sold": "0" }, { "ticket_type": "3", "contingent": "500", "sold": "0" }, { "ticket_type": "4", "contingent": "200", "sold": "0" } ]
9. Reserve a ticket when user enters payment process. User will receive a ticket ID that they can use to perform the purchase later on.
POST api/event/ticket/reserve
Parameters:
- ticket_type (required): ID of ticket type (-> implies eventID)
Response [ “ticket_history” => $ticketID ]
POST api/event/ticket/reserve/cancel
Parameters:
- ticket_history (required) -> ticket ID
Response { “success”: true }
POST api/event/ticket/payment/stripe/purchase
Parameters:
- customer_name (required) -> name of credit card holder
- ticket_history (required) -> ticket ID retrieved before from ticket reservation
- token (required) -> contains token generated on client side from credit data
Response: [ 'event' => $ticket_data['event'], 'ticket_history' => $ticket_data['ticket_history'], 'code' => $ticket_data['code'], 'ticket_type' => $ticket_data['ticket_type'], ]
POST api/event/ticket/payment/stripe/ephemeralkey/?
Parameters:
- api_version (required) -> stripe api version from client
Response: Stripe's Ephimeral Key Object
POST api/event/ticket/sold/?
Parameters:
- event (required) -> event to return the ticket data for
Response: [ { "name": "Toni Wampe", "lrz_id": "gr234we", "ticket_type": "5", "ticket_payment": null, "created": "2018-07-08 15:15:21", "purchase": "2018-07-08 15:17:21", "redemption": "2018-07-12 15:15:21" }, { "name": "Max Mustermann", "lrz_id": "gb123er", "ticket_type": "5", "ticket_payment": null, "created": "2018-07-08 15:16:41", "purchase": null, "redemption": null } ]