101Turn
DrawApp - Consumer transactional

Taking payment for tickets that can only be sold once

The backend behind a prize-draw app. A user reserves ticket numbers and pays. They either get their tickets, or the reservation is released, and nothing is left half-done.

DrawApp - Taking payment for tickets that can only be sold onceDrawApp - Taking payment for tickets that can only be sold once
Fig. 1DrawApp, Consumer transactional
0
tickets issued before the payment is verified
OpenAPI
description the app and server both follow
Queued
refunds run in the background

The challenge

There are only so many ticket numbers, so a reservation has to hold real tickets while the payment company finishes the payment. If the payment fails, is cancelled or never comes back, those tickets must be released every time. One single buy step can't do that. And the app on the phone can't be trusted to decide whether the payment worked, because a phone app that decides that for itself can be tricked into issuing free tickets.

The brief

Consumer transactional. DrawApp.

Our approach

We split buying into three clear steps, reserve, confirm and cancel, so tickets are never held by accident while a request is still in progress. The server checks the payment with the payment company before any ticket is issued. The app reports what happened and never decides it. Refunds run in the background so a slow payment company can't hold up a user. The API is described in an OpenAPI file, so the mobile app and the server can't quietly drift apart.

What we did

Designed and built end to end.

What we built

  • Phone number login with a one-time code (Firebase), swapped on the server for a secure access token (Laravel Sanctum)
  • Reserve, pay, then issue tickets, with tickets released automatically if anything fails
  • Razorpay payments checked on the server, with refunds run in the background
  • Admin panel for draws, orders, users, banners, FAQs and notifications
  • In-app bug reports, support ticketing, and account deletion that meets app store rules
  • A way to make users update to the latest version of the app

The results

Built and documented across the whole draw, from sign-up with a one-time code to ticket issue and refunds.

The outcome

3 steps: reserve, confirm, cancel

Next case study

A travel website built around the trip dates

Get in touch

Got something like this to build?

Tell us what you're working on and what's slowing you down. A short call is usually enough to know whether we're the right fit - no proposal required first.

Quick links

WhatsApp