This page applies to Aikeedo 5.x. Class names, paths and signatures match the 5.0 source code.
The payment lifecycle
Step by step
1
Checkout lists the gateways
The checkout page asks the gateway factory for every registered gateway, skips the ones that aren’t enabled, and groups the rest: card, crypto, offsite and offline. A gateway that implements
PlanAwarePaymentGatewayInterface is hidden for plans it says it can’t handle.2
The user picks one
The browser posts to
/api/billing/checkout with the plan, the gateway key and any coupon. Aikeedo creates an order, then calls your purchase().3
purchase() starts the payment
What you return decides what happens next:
4
The provider returns the user
The provider sends the user back to
/payment-callback/{orderId}/{gatewayKey}. Aikeedo calls completePurchase($order, $params) with the query string, merged with the parsed body for a POST. Verify the payment and return the provider’s reference.5
Aikeedo finishes the order
The order is paid with the reference you returned, then fulfilled. For a recurring plan a subscription is created, carrying that same reference. Any previous subscription is cancelled. The user lands on the receipt.
6
The provider notifies you later
Events such as cancellations arrive at
POST /webhooks/{gatewayKey} and are routed to your webhook handler.Interfaces
Every gateway implementsBilling\Infrastructure\Payments\PaymentGatewayInterface:
Add the marker interfaces that describe your gateway:
Where things live
Exceptions
Official gateways
Aikeedo ships with Stripe, PayPal, bank transfer and manual payment gateways. Official gateways for more regions are available on the Aikeedo Marketplace:Continue
Build a gateway
A complete, working gateway plugin.
Checkout flows
Hosted redirects, embedded forms and tokens.
Subscriptions and renewals
Recurring billing, trials and cancellation.
Webhooks
Verify, route and act on provider events.