Skip to content

Latest commit

 

History

History
126 lines (100 loc) · 2.61 KB

README.md

File metadata and controls

126 lines (100 loc) · 2.61 KB

Version

The PayUMoney Pay library provides convenient access to the PayUMoney API from applications written in server-side JavaScript.

Documentation

See the PayUMoney API docs.

The package needs to be configured with your account's Merchant Key, Mecrhant Salt and Authorization Key, which are available in your PayUMoney Dashboard.

Installation

Install the package with:

npm i payumoney-pay --save

Include and Set Auth Data

var payumoney = require('payumoney-pay');
payumoney.setAuthData(MODE,MERCHANT_KEY, MERCHANT_SALT, AUTHORIZATION_HEADER,SURL,FURL);

Set auth data parameters

MODE

PROD=true TEST=false

MERCHANT_KEY,MERCHANT_SALT,AUTHORIZATION_HEADER

that key,which are available in your PayUMoney Dashboard

SURL,FURL

Set Success url and Failure url

APIs Available

1. Create a payment request

{
     "amount":"xxx",
     "firstname":"xxxx",
     "email":"[email protected]",
     "phone":"xxxxxxxx",
     "txnid":"xxxxxxxxxxxxxxx"
     "productinfo":"xxxx"
}
payumoney.makePayment(body, function(error, response) {
  if (error) {
    // Some error
  } else {
    // Payment redirection link
    console.log(response);
  }
});

2. Get Payment Status

{
     "txnid":"xxxxxxxxxxxxxxx"
}
payumoney.getPaymentResponse(txnid, function(error, response) {
  if (error) {
    // Some error
  } else {
    console.log(response);
  }

3. Check Payment Response

{
     "txnid":"xxxxxxxxxxxxxxx"
}
payumoney.checkPaymentResponse(txnid, function(error, response) {
  if (error) {
    // Some error
  } else {
    console.log(response);
  }

4. Send SMS Invoice

     {
	    "customerName":"Umesh",
	    "customerMobileNumber":*****78**,
	    "description":"Test",
	    "amount":8000
    }
payumoney.sendSMSInvoice(data, function(error, response) {
  if (error) {
    // Some error
  } else {
    console.log(response);
  }

Submit issues

You can raise an issue Raise.