Skip to main content

When to use PayPlus

Use PayPlus for a hosted redirect checkout in LKR or USD. The shared createOrder() function creates the provider session from your backend and returns a public redirect URL. A signed PayPlus notification is the payment evidence; your backend preserves its exact body and authorization header before requesting shared completion.
The shared UPG lifecycle—availability, createOrder(), and completePayment()—is documented in Quick Setup. This page covers only the released PayPlus standard hosted checkout.

SDK Functions

Retrieve a PayPlus payment status

Use status() from your backend when you need a read-only observation for a pending order or operational diagnosis. It queries the configured PayPlus status endpoint for the stored order ID and maps only its safe summary. It is not browser-side payment proof.
SDK response — PayPlusStatus:
The SDK exposes $status->orderId, $status->providerStatus, $status->timestamp, and $status->requestId. timestamp is the provider value when supplied; the current status contract represents an absent value as an empty string. This lookup intentionally omits raw provider data, session tokens, payment rails, and customer/card details.

Preserve a signed PayPlus callback

PayPlus signs the exact callback body. Read the original body and Authorization header on your backend before any JSON, Base64, or string transformation. The wrapper does not parse or verify the callback itself; it preserves the evidence for shared completion.
SDK response — PayPlusCallbackPayload::toArray():
Keep both strings server-only. The raw callback body and signature can be returned only through explicitly requested, protected diagnostic response modes; they do not belong in browser state, logs, queues, or analytics.

Complete a verified PayPlus callback

Pass the stored completion context and the payload wrapper to the shared completion API. By default, a verified successful callback is also reconciled through the PayPlus status endpoint. The status observation can confirm, conflict with, or be temporarily unavailable relative to the signed callback.
SDK response — PaymentCompletionResult:
Use $result->paymentStatus, $result->verified, and $result->reconciliation to decide your order state. A status lookup outage makes a formerly successful callback unknown with retry_recommended: true; do not fulfil until a later backend retry returns a verified succeeded result.

Payment Elements

PayPlus presents the payment rails enabled for the merchant account on its hosted page. Payment Elements should render one redirect card and must not advertise individual cards, wallets, QR rails, or other provider features that your PayPlus profile may not enable.
Elements redirects only to the public provider URL prepared by your backend. For rendering, visual customization, events, and the checkout lifecycle, see More Payment Elements features.

Gateway-specific options

The released standard checkout exposes only these backend-controlled providerOptions during order creation:
  • is_nic_editable — boolean; defaults to true.
  • plugin_version — optional identifier, defaulting to 1.0.0.
  • source — optional source label, defaulting to AVRAAPI.
  • Customer information and configured callback/return URLs are validated by the backend; credentials, merchant secret, hosted-session token, and buyer-controlled status values are never options.
LankaQR, reusable card tokens, recurring charging, JustPay token flows, and PayPlus-specific rails are not part of this released standard checkout. Do not treat the provider’s wider product API as an enabled AvraAPI SDK capability.

Completion, webhooks, and safety

The notification callback is authoritative evidence only after HMAC verification, Base64 decoding, and binding its order ID, amount, and currency to the stored completion context. A browser return merely returns the customer to your application; it does not complete payment. Keep the default reconcileProvider: true for successful callbacks. A final result can be succeeded, pending, failed, cancelled, or unknown; fulfil only a verified succeeded result. Handle a non-final result with bounded, idempotent backend retry rather than showing a provider status as success.
Last modified on October 1, 2026