Zibal IPG NPM Module
Here is Zibal's NPM Module to Easily Create and Process IPG Transactions.
Get Started
-
Install Module using
npm
oryarn
npm install zibal --save
-
Configure Module
const Zibal = ;const zibal =merchant: "YOUR_MERCHANT" // Your IPG's Merchant Id (You Can Get it From Zibal's Dashboard)callbackUrl: "https://yourwebsite.com/ipg/cb" // The URL Where User will be Redirected to After PaymentYou can Configure These Two Parameters for Each Transaction Too.
You can Specify
merchant: zibal
to Perform Sandbox Transactions. -
Create IPG Transaction
zibalSee Documentation For More Features.
-
Catch Data in Callback
User will be Redirected to
callbackUrl
you Have Sent in Request. We Will Specify Transaction Information in Query Strings Link:https://yourwebsite.com/ipg/cb?trackId=10000&success=1&status=2&orderId=1
You Shall Catch it in Your Application (ExpressJS, Koa, Hapi, Loopback, Sails, Meteor etc.) and Verify the Transactions if
success === true && status === 2
and Process Your Order for your Customer. -
Verify Transaction
Here you Should Tell Us that You Got the Transaction Information & Verify it.
zibal -
Done
Your Website is now Connected to Zibal IPG! Enjoy and Have Fun.