Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
razorpay-typescript
Advanced tools
[UNOFFICIAL] TypeScript based Node.js SDK for Razorpay API.
Read up here for getting started and understanding the payment flow with Razorpay: https://docs.razorpay.com/docs/getting-started
npm i razorpay-typescript
Documentation of Razorpay's API and their usage is available at https://docs.razorpay.com
Introducing RazorWebhook
, a wrapper class for simplifying Webhooks actions for Razorpay Webhook Payload. You can now focus more on your core logic than managing event types.
// --------------------
// Webhooks
// --------------------
const razorpayPayload: IRazorWebHookPayload = {
"entity":"event",
"account_id":"acc_BFQ7uQEaa7j2z7",
"event":"subscription.activated",
"contains":[
"subscription"
],
"payload":{
"subscription":{
"entity":{
...Your payload details ...
}
}
},
"created_at":1567690383
};
const wh: RazorWebhook = new RazorWebhook(razorpayPayload);
/// Setup your custom handler actions
wh.handler.subscriptionActivated = (pl) => {
/// ----- Your logic code.
return Promise.resolve();
};
wh.handler.subscriptionUpdated = (pl) => {
/// ----- Your logic code.
return Promise.resolve();
};
const execute: Promise<any> = await wh.execute();
Instantiate the razorpay instance with key_id
& key_secret
. You can obtain the keys from the dashboard app (https://dashboard.razorpay.com/#/app/keys)
const instance: Razorpay = new Razorpay({
authKey: {
key_id: 'YOUR_KEY_ID',
key_secret: 'YOUR_KEY_SECRET',
},
headers: {... Your Headers ...},
});
The resources can be accessed via the instance. All the methods invocations follows the namespaced signature
// API signature
// {razorpayInstance}.{resourceName}.{methodName}(resourceId [, params])
// Build with neat response interfaces
// example
const paymentDetails: IRazorPaymentId = await instance.payments.fetch(paymentId);
// Additional neat functionality than official nodejs SDK
// now even store instances of all services
// with neat instance classes
const payment: RazorPayment = instance.payments.payment('your_payementId');
payment.transfer([
{
account: 'acc_7HGyrafdeQDGfX',
amount: 100,
currency: 'INR'
}
]);
Every resource method returns a promise.
instance.payments
.all({
from: '2016-08-01',
to: '2016-08-20',
})
.then(response => {
// handle success
})
.catch(error => {
// handle error
});
npm install
npm run build
master
branch. Make sure you have the latest changes in the local masterCHANGELOG.md
& bump the version in package.json
npm publish
commandMIT Licensed. See LICENSE.txt for more details
1.0.12 - 2020-05-19
RarozPlan
interface.FAQs
Unofficial TypeScript based Node.js SDK for Razorpay API.
The npm package razorpay-typescript receives a total of 94 weekly downloads. As such, razorpay-typescript popularity was classified as not popular.
We found that razorpay-typescript demonstrated a not healthy version release cadence and project activity because the last version was released 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.