Skip to content

Verify Payment

The verifyPayment method accepts 2 arguments:

  1. an object, containing amount and referenceId of transaction.
  2. request parameters in the callback route
import { getPaymentDriver } from "monopay";

const driver = getPaymentDriver("zarinpal")({
  merchantId: "zarinpal-merchant",
});

const receipt = await driver.verifyPayment(
  {
    amount: 5000,
  },
  { ...request.params, ...request.body }
);

This method returns you a receipt that will contain a transactionId and a cardPan and some other info about the payment. At this point the payment process is finished and you can provide your service/product to the user.