Third-party payment gateways
Third-party payment gateways
Use this integration when you want to process white-label subscription payments through your own third-party gateway (Payfast, NetCash, SagePay, Stripe, Safaricom, or another provider). After a successful payment, activate the customer’s subscription through the Panic API.
This is distinct from AURA-hosted payment options, which are available only when the customer source and app have been configured for a supported provider. With a third-party gateway, pricing, card storage, gateway choice, recurring collections, refunds, and payment compliance remain your responsibility.
Who does what
The flow
-
In the app, a customer without a subscription chooses Online subscription.
-
The app opens an in-app webview to your signup handler, passing three query parameters:
token— the customer’s AURA OAuth access token (a JWT). Do not log it or persist it in analytics. Its claims includecustomerIdandsub— see Resolve the customer below before using either.redirectUrl— where to send the customer when you’re done.userid— the token’ssubclaim: the customer’s Auth0 user identifier (for exampleauth0|abc123). This is not the AURAcustomerId— the two are unrelated values anduseridcannot be used to look up the AURA customer on its own.
e.g.
https://my.paymentgateway.com?token=xxxxx&redirectUrl=...&userid=... -
Your signup handler takes payment through your gateway.
-
On success, activate a subscription via the Panic API, then redirect back to
redirectUrlwithsuccess=true(orsuccess=falseon failure), preserving the original parameters. The app watches the webview URL for thesuccessparameter to decide which screen to show. -
AURA’s payment handler verifies the subscription and returns the customer to the app, which shows a success or failure screen.
Activating the subscription
After payment succeeds, in your signup handler:
- Find the subscription type —
GET /panic-api/v2/subscriptions/subscriptionTypesand pick the entry whose value isWEB_SIGNUP_SINGLE(orWEB_SIGNUP_FAMILYfor family plans). Store itsid. - Resolve the customer. There is currently no API endpoint that resolves a
customer from a bearer token on your behalf, so decoding the token is the
supported way to get the
customerIdfor this flow. Verify the token’s signature against AURA’s Auth0 JWKS before trusting it — do not decode it without verifying first — then read thecustomerIdclaim.userid(sub) is a different value and will not resolve to an AURA customer. - Create the subscription —
POST /panic-api/v2/subscriptions:
Subscription lifecycle
- Once-off — set
validToto the actual service end date agreed with the customer. Do not use an arbitrary century-long entitlement as a substitute for an explicit commercial term. - Monthly renewal — set
validToto ~35 days out (allow a few days’ grace for retries), then renew each cycle withPUT /panic-api/v2/subscriptions/{subscriptionId}. - Cancel early —
DELETE /panic-api/v2/subscriptions/{subscriptionId}; access is lost immediately. - Re-subscribe — lapsed or deleted subscriptions can’t be recovered; create a
new one with
POST /panic-api/v2/subscriptions. - Family — use
WEB_SIGNUP_FAMILY; dependants are linked to the main member’s subscription and lose access if it lapses.
All dates use ISO 8601 in UTC (e.g. 2020-05-12T13:05:25.961Z). Convert from
your local timezone so subscriptions activate when intended.
