
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@naeimsafaee/ipg-node
Advanced tools
A lightweight, pluggable driver framework for integrating Iranian payment gateways (e.g. Zibal, IdPay, …) into your Node.js or TypeScript projects.
.pay(...) and .verify(...) calls for every gatewaynpm install @naeimsafaee/ipg-node
# or
yarn add @naeimsafaee/ipg-node
const { PaymentGateway , ZibalDriver } = require('ipg-node');
const gateway = new PaymentGateway({
drivers: [new ZibalDriver("")],
config: {
callbackUrlOverride: paymentCallbackUrl,
sandbox: true
}
});
async function checkout() {
// 1. Create payment
const { success, paymentUrl, raw } = await gateway.pay('zibal', {
amount: 250000,
// If no callbackUrl was provided in the PaymentRequest, fall back to callbackUrlOverride from the gateway config
//callbackUrl: 'https://yourapp.com/callback',
orderId: 'order_1234'
})
if (success && paymentUrl) {
// redirect user
console.log('Go pay at:', paymentUrl)
} else {
console.error('Error requesting payment:', raw)
}
}
// 2. In your callback handler
import express from 'express'
const app = express()
app.get('/callback', async (req, res) => {
const result = await gateway.verify('zibal', req.query)
if (result.success) {
console.log('Paid! TraceNo:', result.traceNo)
res.send('Payment successful!')
} else {
console.warn('Verification failed:', result.raw)
res.status(400).send('Payment verification failed.')
}
})
const { PaymentGateway , ZibalDriver } = require('ipg-node');
const gateway = new PaymentGateway([
new ZibalDriver(process.env.ZIBAL_API_KEY)
])
// Create payment
gateway.pay('zibal', {
amount: 250000,
callbackUrl: 'https://yourapp.com/callback',
orderId: 'order_1234'
})
.then(({ success, paymentUrl, raw }) => {
if (success) {
console.log('Redirect to:', paymentUrl)
} else {
console.error('Payment error:', raw)
}
})
// Verify callback (e.g. in Express)
app.get('/callback', (req, res) => {
gateway.verify('zibal', req.query)
.then(result => {
if (result.success) {
res.send('OK')
} else {
res.sendStatus(400)
}
})
})
new PaymentGateway(drivers?: PaymentDriver[])PaymentDriver instancesgateway.register(driver: PaymentDriver): voidRegister a new driver at runtime. Must have a unique driver.driverName.
gateway.pay(driverName: string, req: PaymentRequest): Promise<PaymentResponse>'zibal', 'idpay', etc.{ amount: number; callbackUrl: string; orderId?: string; [k: string]: any }{ success: boolean; paymentUrl?: string; raw: any }gateway.verify(driverName: string, data: any): Promise<VerificationResponse>{ success: boolean; traceNo?: string; raw: any }Contributions, issues, and feature requests are welcome! Please open an issue or pull request on GitHub.
MIT © [Naeim Safaee] - https://github.com/naeimsafaee
FAQs
Pluggable drivers for Iranian payment gateways
We found that @naeimsafaee/ipg-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.