The browser code on this page is the same whether your backend uses the PHP, Laravel, or Node.js SDK. The SDK stays on your server; Payment Elements stays in the browser.
The security boundary
Checkout Page (Frontend)
- Payment Elements: customer form, method selector, provider presentation
- Your checkout endpoint: handles selected gateway, mode, and customer details
Your Backend
- AvraAPI SDK:
availability(),createOrder(),completePayment() - Your database: manages orders and fulfilment rules
- Provider callback: receives the verified return handler
- AvraAPI Project Client ID or Client Secret;
- Gateway Vault credentials, signing secrets, API keys, or private keys;
- a signed
completionContext; - a trusted amount, currency, order state, merchant domain, or gateway environment.
completePayment() before it fulfils an order.
Install the browser bundle
Use the immutable AvraAPI CDN URL and the exact integrity hash published in the matching release manifest.manifest.json. Do not use a floating URL, alter the bundle, or load logo and flag assets from an unrelated host.
The package exposes window.AvraAPIPaymentElements in a browser. Before mounting a checkout, you can verify that it loaded:
assertLoaded() throws elements_script_missing. Show a retry message to the buyer and check your Content Security Policy and the immutable CDN URL.
Create one checkout instance
Create one instance for a checkout page, then callrenderForm() and renderMethods() on that same instance. The createOrder callback is your application’s HTTPS endpoint. It is not an AvraAPI endpoint, an SDK function, or a second payment implementation.
createOrder(). It must not trust an amount, environment, merchant domain, or order identity supplied by the browser.
create() options
onePaySdkFactory exists only as an internal package test seam. It is not an integration option and should not be used by applications.
Shared appearance options
renderForm() and renderMethods() accept the same appearance options. They apply only to the Elements component they render.
Light defaults are a white surface with dark text. Dark defaults use a
#111827 surface with light text. Use accessible colour contrast; custom colours do not alter validation, availability, or payment security.
Components and checkout flow
renderMethods() can safely use its no-methods default. Learn how this works in Render Payment Methods.
Render Customer Form
Field options, country selection, validation, and normalized phone data.
Render Payment Methods
Safe defaults, explicit methods, availability, sandbox badges, and stale-page handling.
Checkout Lifecycle
Provider presentation, browser events, errors, and the server-side completion boundary.
