Package Exports
- np-payment-sdk
- np-payment-sdk/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (np-payment-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
np-payment-sdk
Unified Payment SDK for Nepal
Features
- Unified API Layer for multiple Nepali payment gateways (eSewa, Khalti, ConnectIPS, IME Pay, Mobile Banking)
- Easy configuration
- Callback & Webhook handlers
- Sandbox & Production modes
- TypeScript support
Installation
npm install np-payment-sdkUsage Example
import { PaymentSDK, GatewayType } from 'np-payment-sdk';
const sdk = new PaymentSDK({
mode: 'sandbox',
gateways: {
esewa: { clientId: '...', secret: '...' },
khalti: { publicKey: '...', secretKey: '...' },
// ...other gateways
}
});
async function makePayment() {
const result = await sdk.pay({
gateway: GatewayType.ESEWA,
amount: 1000,
currency: 'NPR',
returnUrl: 'https://yourapp.com/payment/callback',
});
console.log(result);
}
makePayment();Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
License
MIT # n p - p a y m e n t - s d k