Skip to main content

Overview

The Payaza Web Checkout SDK gives you a hosted, secure payment modal that handles card charges, virtual account bank transfers, and mobile money collections — without you building the payment UI yourself. Add it to any website in minutes.

Via CDN (HTML)

Include the Payaza bundle script in your HTML and call PayazaCheckout.setup().

Via npm / yarn

Install the payaza-web-sdk package and import it into your JavaScript or TypeScript project.

Prerequisites

Before integrating, make sure you have:
Your raw API key goes directly into the SDK as merchant_key. You do not need to Base64-encode it for the Checkout SDK — Base64 encoding is only required for direct REST API calls.

Integration

Option 1 — HTML (CDN)

Include the Payaza bundle script in your <head> and call PayazaCheckout.setup() when the user initiates checkout.

Option 2 — npm / yarn

Install the package:
JavaScript:
TypeScript:

Handling the callback response

The callback function fires when the payment flow completes. It receives a response object with the outcome:
Always verify the payment server-side using the transaction_reference before fulfilling an order. The callback fires on the client — it can be intercepted. Use the Transaction Status Query API or listen for a webhook to confirm the final state.

SDK parameters


SDK errors


Testing

Use Test Mode test cards to simulate different payment outcomes before going live. Set connection_mode: "Test" and use your test API key.
Payments made in Test Mode are not processed or settled. Switch connection_mode to "Live" and use your live API key only when you are ready to accept real payments.

What’s next

Webhooks

Set up server-side event notifications to confirm payments and update order state.

Test Cards

Simulate card approvals, declines, and 3DS flows during development.

Card Collections API

Build a fully custom card checkout without the hosted SDK.

Virtual Accounts

Collect payments via bank transfer using dynamic or reserved account numbers.