amount|txnid. Remove a leading test_ prefix from the merchant token only when computing the digest.12345678import { createClient } from "egov.js"; const client = createClient({ baseUrl: "https://egovpay-pgi-ws-dev.oueg.info", headers: { "X-eGovPay-Token": process.env.EGOVPAY_TOKEN!, }, });
egovPay.generatePaymentPOST /api/v1/transaction creates a payment transaction and returns its reference, UUID, channel, and hosted payment URL.123456789101112131415import { egovPay } from "egov.js"; const payment = await egovPay.generatePayment({ client, body: { amount: 1_000, callback_url: "https://example.gov.ph/payments/callback", digest, items: [{ amount: 1_000, name: "Permit fee" }], redirect_url: "https://example.gov.ph/payments/complete", settlement_template_uuid: process.env.EGOVPAY_SETTLEMENT_TEMPLATE_UUID!, txnid: "PERMIT-2026-0001", }, throwOnError: true, });
egovPay.getTransactionGET /api/v1/transaction/{uuid} retrieves transaction details for the supplied payment UUID.1234567import { egovPay } from "egov.js"; const transaction = await egovPay.getTransaction({ client, path: { uuid: payment.data.uuid }, throwOnError: true, });
egovPay.voidTransactionPUT /api/v1/transaction/{uuid}/void voids an eligible transaction and returns the updated payment state.1234567import { egovPay } from "egov.js"; const voided = await egovPay.voidTransaction({ client, path: { uuid: payment.data.uuid }, throwOnError: true, });