payment() accessor for backend payment
work while the canonical UPG documentation defines the complete integration,
gateway capabilities, frontend presentation, and completion rules.
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 PHP 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.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).
In Node.js, use client.payment() from @avraapi/node-sdk. Every SDK keeps the
same typed, server-only lifecycle: availability, order preparation, callback
completion, and gateway-specific reconciliation. Use the canonical UPG guides
rather than recreating the 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.
