Verify Payment
The verifyPayment
method accepts 2 arguments:
- an object, containing
amount
andreferenceId
of transaction. - 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.