phonepe-payment-integration
v1.0.4
Published
This is Phone pe SDK for web to integrate phone pay
Downloads
14
Maintainers
Readme
phonpe-payment-integration
This package will help you to integrate phone pe in you existing application
Documentation
Installation
Install phonepe-payment-integration with npm
npm install phonepe-payment-integration
Init Phone Pay
// Use it in you app.js/server.js
const { initPhonePay } = require("phonepe-payment-integration");
// No need to pass credential while testing only for production you need it
initPhonePay();
Phone pay instance
// Use it anywhere when application running
const { getPhonePayInstance } = require("phonepe-payment-integration");
// You will get phone pay instance
getPhonePayInstance();
PhonePe pay instance
// Use it anywhere when application running
const { getPhonePayInstance } = require("phonepe-payment-integration");
// You will get phone pay instance
const { response } = await getPhonePayInstance().pay({
amount,
name,
mobileNumber,
redirectUrl,
});
PhonePe verify instance
// Use it anywhere when application running
const { getPhonePayInstance } = require("phonepe-payment-integration");
// You will get phone pay instance
const { response } = await getPhonePayInstance()?.verifyPayment(
req?.body?.transactionId
);
console.log(`🚀 ~ file: razorypay.js:194 ~ response:`, response);
if (response?.data.state === "COMPLETED") {
console.log("Payment Done");
}else{
console.log("Something went wrong");
};