project-payment-service

1.0.0-a • Public • Published

Payment service

Service to ease work whith payment systems such as LiqudPay, PayPal

Installation

$ npm i project-payment-service

How to use?

const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');

const {LiqPay, PayPal} = require('./src/main');
const app = express();

app.use(express.static(path.resolve(__dirname, './public')));
app.get('/', (request, response) => {
    response.sendFile(path.resolve(__dirname, './public', 'index.html'));
});

app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());

/*
* from front-end call post:
* /paypal for payPal with json {total, currency, description}
* /liquidpay for liquidPay with json {amount, currency, description, order_id}
* */
// if not add second parameter it will be in sandbox mode
const liqPay = new LiqPay(app, 'prod');
const payPay = new PayPal(app);


app.listen(3000, () => {
    console.log(`listening on port 3000`);
});

Readme

Keywords

none

Package Sidebar

Install

npm i project-payment-service

Weekly Downloads

0

Version

1.0.0-a

License

ISC

Unpacked Size

6.38 kB

Total Files

5

Last publish

Collaborators

  • romanovich0195
  • travel78
  • varkroman