payment() accessor for backend payment
work while the canonical UPG documentation defines the complete integration,
gateway capabilities, frontend presentation, and completion rules.
The Laravel integration resolves the same configured ApixClient and typed
payment objects as the PHP SDK. It does not add Laravel-specific payment
events, queues, jobs, controllers, or webhook routes.
Quick Setup
Connect a payment flow with the smallest complete backend integration.
Advanced Setup
Control initiation, returns, webhooks, and authoritative completion.
Payment Elements
Add AvraAPI’s optional checkout UI while retaining your backend authority.
Gateway capabilities
Find verified gateway-specific functions, payment choices, and limits.
Access the Laravel payment service
Access the Advanced Service
PaymentService. Its common lifecycle methods
return dedicated payment value objects rather than a generic provider result.
The service also exposes typed gateway facilities through
payhere(),
marxpay(), payplus(), koko(), onepay(), and webxpay(). Use the
gateway-wise guides for
the provider-specific contract instead of treating every gateway alike.
Keep authority in your backend
1
Create a pending order
Store your order, amount, currency, customer data, and fulfilment intent in
your application before creating a payment session.
2
Prepare the session through payment()
Use
createOrder() with a typed CreateOrderOptions object. Keep the
returned completionContext with your pending order; it is not browser
data.3
Present the checkout
Follow the selected gateway’s redirect, overlay, or embedded presentation
guide. A browser event or return page is not authoritative payment proof.
4
Complete and fulfil
Send the callback or return payload to your backend and use
completePayment(). Fulfil only after the returned completion result is
verified and its payment status meets your application policy.PaymentSession::completionContext is deliberately server-only. A
PaymentCompletionResult is the normalised completion result, but your
application remains responsible for idempotency, order state, and the final
fulfilment decision.Use the Facade in a controller, command, job, or service class, or inject
Avraapi\Apix\ApixClient when the dependency should be explicit. Both
patterns resolve the same configured payment service.Choose the right UPG guide
UPG Overview
Learn the lifecycle, project requirements, and supported integration paths.
Webhooks & completion
Implement authoritative callback verification and reconciliation.
Gateway-wise functions
Use provider-specific capabilities only where they are verified and released.
SDK availability
UPG is available through the PHP, Laravel, and Node.js SDKs. In Laravel, use the Facade accessorAvraAPI::payment() (or inject the underlying
ApixClient) to use the same typed payment service and option objects. In
Node.js, use the released server-only client.payment() lifecycle. Use the
canonical UPG guides rather than attempting to recreate this server-side
contract through a raw HTTP call.
Next steps
Start Quick Setup
Build the smallest complete payment flow first.
Review UPG errors
Understand safe handling for unavailable methods, callbacks, and completion outcomes.
