
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@dhanyatra/checkout-js
Advanced tools
A web checkout module to invoke instant payment.
Dhanyatra Checkout-JS is a JavaScript library tailored for seamless integration with Dhanyatra's payment gateway. It empowers developers to effortlessly incorporate Dhanyatra's payment features into their applications. By offering a clean and intuitive API, Dhanyatra Checkout-JS simplifies the process of handling payments, providing businesses with a robust solution for processing transactions and enhancing the checkout experience for customers.
Install the package from the npm registry as follows:
npm i @dhanyatra/checkout-js
# yarn
yarn add @dhanyatra/checkout-js
# pnpm
pnpm add @dhanyatra/checkout-js
The module exposes a Dhanyatra
class, which can be used to payment server and listen for payments events.
import { Dhanyatra } from '@dhanyatra/checkout-js';
const options = {
key: 'Mw.9BnMszEkdEOE8OYmSPA0-IvISRHJCkUUKalSR_keJ2zWT9vFQtUsgfXM2ryn', // Enter the Key ID generated from the Dashboard
amount: '500', // Any amount can be float
currency: 'INR', // Currently only INR accepted
organization: "Hustler's Academy", // Name to be displayed of organization
image: 'https://i.imgur.com/n5tjHFD.png', // Logo to be displayed of organization
handler: function (response) {
//response after payment event either Success or Failed
alert(response.dhanyatra_payment_id);
},
modal: {
//Modal Handler inside payment gateway
ondismiss: function () {
//Dismiss Modal Handler
let txt = '';
if (confirm('Are you sure, you want to close the form?')) {
txt = 'You pressed OK!';
console.log('Checkout form closed by the user');
rzp1.close();
} else {
txt = 'You pressed Cancel!';
console.log('Complete the Payment');
}
},
},
}
// Setup Dhanyatra options
const dhanyatra = new Dhanyatra(options)
// Trigger Payment
dhanyatra.open();
Using the package as script tag on HTML
<script type="module">
import { Dhanyatra } from 'https://www.unpkg.com/@dhanyatra/checkout-js@0.0.2/build/checkout.modern.js';
const options = {
key: 'Mw.9BnMszEkdEOE8OYmSPA0-IvISRHJCkUUKalSR_keJ2zWT9vFQtUsgfXM2ryn', // Enter the Key ID generated from the Dashboard
amount: '500', // Any amount can be float
currency: 'INR', // Currently only INR accepted
organization: "Hustler's Academy", // Name to be displayed of organization
image: 'https://i.imgur.com/n5tjHFD.png', // Logo to be displayed of organization
handler: function (response) {
//response after payment event either Success or Failed
alert(response.dhanyatra_payment_id);
},
modal: {
//Modal Handler inside payment gateway
ondismiss: function () {
//Dismiss Modal Handler
let txt = '';
if (confirm('Are you sure, you want to close the form?')) {
txt = 'You pressed OK!';
console.log('Checkout form closed by the user');
rzp1.close();
} else {
txt = 'You pressed Cancel!';
console.log('Complete the Payment');
}
},
},
}
// Setup Dhanyatra options
const dhanyatra = new Dhanyatra(options)
// Trigger Payment
dhanyatra.open();
<script type="module">
FAQs
Check Js Module For Instant Web Checkout
We found that @dhanyatra/checkout-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.