Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

payumoney-node

2.0.1 • Public • Published

PayUMoney NodeJs Wrapper

The PayUMoney Node 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 install payumoney-node --save

Include and set keys

var payumoney = require('payumoney-node');
payumoney.setKeys(MERCHANT_KEY, MERCHANT_SALT, AUTHORIZATION_HEADER);

Set Mode

payumoney.isProdMode(true); // production = true, test = false

APIs Available

Create new payment request

var paymentData = {
    productinfo: "",
    txnid: "",
    amount: "",
    email: "",
    phone: "",
    lastname: "",
    firstname: "",
    surl: "", //"http://localhost:3000/payu/success"
    furl: "", //"http://localhost:3000/payu/fail"
};
 
payumoney.makePayment(paymentData, function(error, response) {
  if (error) {
    // Some error
  } else {
    // Payment redirection link
    console.log(response);
  }
});

Get Payment Status

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

Initiate refund

payumoney.refundPayment("paymentId", "amount", function(error, response) {
  if (error) {
    // Some error
  } else {
    console.log(response);
  }
});

Get refund status

payumoney.refundStatus("paymentId", function(error, response) {
  if (error) {
    // Some error
  } else {
    console.log(response);
  }
});

Submit issues

You can raise an issue in this repo or mail me at pwnkumar016@gmail.com

Install

npm i payumoney-node

DownloadsWeekly Downloads

185

Version

2.0.1

License

ISC

Unpacked Size

6.79 kB

Total Files

3

Last publish

Collaborators

  • avatar