# pay-u

> Node module for creating Pay-u Money requests.

Latest version **0.0.414** (published 2017-02-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install pay-u
pnpm add pay-u
yarn add pay-u
bun add pay-u
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.414 |
| Published | 2017-02-21 |
| First published | 2017-02-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ramachandra jr |
| Maintainers | ramachandrajr |
| Keywords | payu, payu_money, payubiz, payumoney |

## Links

- npm: https://www.npmjs.com/package/pay-u
- npm.io page: https://npm.io/package/pay-u

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.79.0

## Recent versions

- 0.0.414 (latest) — 2017-02-21
- 0.0.413 — 2017-02-21
- 0.0.412 — 2017-02-21
- 0.0.411 — 2017-02-21
- 0.0.41 — 2017-02-21
- 0.0.401 — 2017-02-21
- 0.0.4 — 2017-02-21
- 0.0.3 — 2017-02-21
- 0.0.2 — 2017-02-21
- 0.0.1 — 2017-02-21
- 1.0.0 — 2017-02-10

## README

# pay-u
pay-u is a module which you can use only for creating orders(for now) to the Payumoney / Payubiz / Payu* servers. More functionality will be added but for now the following functions are usable.

### Usage 


``` javascript

    const payu = require("pay-u").newOrder,
          // for ease of usage we will be using express.
          app = require("express")();

    // Putting all our stuff in the root route.
    app.get("/", (req, res) => {
        payu.Create({            
		    amount: 2000,
		    productinfo: 'None',
		    firstname: 'Rj',
		    email: 'rjwork333@gmail.com',
		    phone: '9090909090',
		    surl: 'http://localhost:1337/success',
		    furl: 'http://localhost:1337/failure',
		    service_provider: 'payu_paisa'
	    },/* false === test payment*/ false);
	    
	    payu.sendReq()
	    .then(url => {
    	    res.redirect(url);
    	})
    	.catch(err => {
	    	res.send(err);
    	});
    });
    
    // Path to success :D, YAY!
    app.post("/success", (req, res) => {
        res.send("Success!")
    });
    
    // :P My payment failed!
    app.post("/failure", (req, res) => {
        res.send("OOPS payment failed!")
    });
    
    app.listen(1337, () => {
        console.log("Don't go to http://localhost:1337");
    });
    
```

### Tips
Incase you are creating a huge app and you will have code in a lot of directories and a lot files / url's / blah.. blah try using express and then do:
``` javascript
    // In the main application file
    app.locals.payu = require("pay-u");
    // Access data in all other files as
    req.app.locals.payu.*;
    
```

---
_Source: https://npm.io/package/pay-u · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
