node-paytmpg 7.1.2 → 7.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/controllers/adapters/open_money.d.ts +23 -0
- package/dist/app/controllers/adapters/open_money.js +7 -8
- package/dist/app/controllers/adapters/paytm.d.ts +2 -0
- package/dist/app/controllers/adapters/payu.d.ts +41 -0
- package/dist/app/controllers/adapters/payu.js +6 -21
- package/dist/app/controllers/checksum/PaytmChecksum.d.ts +13 -0
- package/dist/app/controllers/checksum/checksum.d.ts +15 -0
- package/dist/app/controllers/checksum/crypt.d.ts +15 -0
- package/dist/app/controllers/checksum/server.d.ts +1 -0
- package/dist/app/controllers/checksum/server.js +4 -2
- package/dist/app/controllers/htmlhelper.d.ts +9 -0
- package/dist/app/controllers/htmlhelper.js +94 -0
- package/dist/app/controllers/payment.controller.d.ts +30 -0
- package/dist/app/controllers/payment.controller.js +23 -95
- package/dist/app/controllers/static/loadingsvg.d.ts +1 -0
- package/dist/app/controllers/user.controller.d.ts +9 -0
- package/dist/app/controllers/user.controller.js +1 -1
- package/dist/app/models/index.d.ts +78 -0
- package/dist/app/routes/payment_route.d.ts +2 -0
- package/dist/app/utils/buildConfig.d.ts +2 -0
- package/dist/app/utils/utils.d.ts +5 -0
- package/dist/index.d.ts +10 -0
- package/dist/package.json +2 -1
- package/package.json +2 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface OpenMoneyConfig {
|
|
2
|
+
accesskey: string;
|
|
3
|
+
secretkey: string;
|
|
4
|
+
url: string;
|
|
5
|
+
script_url: string;
|
|
6
|
+
KEY?: string;
|
|
7
|
+
SECRET?: string;
|
|
8
|
+
open_money_url?: string;
|
|
9
|
+
}
|
|
10
|
+
type AnyObject = {
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
};
|
|
13
|
+
export default class OpenMoney {
|
|
14
|
+
config: OpenMoneyConfig;
|
|
15
|
+
constructor(npconfig: AnyObject);
|
|
16
|
+
generatePaymentToken(params: AnyObject): Promise<AnyObject>;
|
|
17
|
+
verifyResult(req: AnyObject): Promise<AnyObject>;
|
|
18
|
+
processWebhook(req: AnyObject, res: AnyObject, updateTransaction: Function): void;
|
|
19
|
+
getPaymentStatus(paymentTokenId: string, cb?: (data: any) => void): Promise<any>;
|
|
20
|
+
renderProcessingPage(params: AnyObject, pmttoken: AnyObject, res: AnyObject, loadingSVG: string): void;
|
|
21
|
+
renderError(params: AnyObject, error: any, res: AnyObject): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -238,21 +238,20 @@ class OpenMoney {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
renderProcessingPage(params, pmttoken, res, loadingSVG) {
|
|
241
|
+
const headScript = `<script src="${this.config.script_url}"></script>`;
|
|
242
|
+
const bodyScript = `<script>triggerLayer();</script>`;
|
|
243
|
+
const html = require('../htmlhelper').buildProcessingPageHtml(pmttoken.html, loadingSVG, 'Merchant Checkout Page', headScript, bodyScript);
|
|
241
244
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
242
|
-
res.write(
|
|
245
|
+
res.write(html);
|
|
243
246
|
res.end();
|
|
244
247
|
}
|
|
245
248
|
renderError(params, error, res) {
|
|
246
249
|
console.log('ERROR:::', error, '\n');
|
|
247
250
|
res.status(500);
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
for (const x in errorResp) {
|
|
251
|
-
form_fields += "<input type='hidden' name='" + x + "' value='" + errorResp[x] + "' >";
|
|
252
|
-
}
|
|
253
|
-
form_fields += "<input type='hidden' name='CHECKSUMHASH' value='" + params['CHECKSUM'] + "' >";
|
|
251
|
+
const errorResp = { TXNID: 'na', STATUS: 'TXN_FAILURE', CANCELLED: 'cancelled', ORDERID: params['ORDER_ID'], CHECKSUMHASH: params['CHECKSUM'] };
|
|
252
|
+
const html = require('../htmlhelper').buildAutoPostFormHtml(params['CALLBACK_URL'], errorResp);
|
|
254
253
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
255
|
-
res.write(
|
|
254
|
+
res.write(html);
|
|
256
255
|
res.end();
|
|
257
256
|
}
|
|
258
257
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type Dict = Record<string, any>;
|
|
2
|
+
interface PayUConfig {
|
|
3
|
+
key: string;
|
|
4
|
+
salt: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
paymentUrl: string;
|
|
7
|
+
verifyUrl: string;
|
|
8
|
+
}
|
|
9
|
+
interface PayURequestLike {
|
|
10
|
+
body?: Dict;
|
|
11
|
+
query?: Dict;
|
|
12
|
+
rawBody?: any;
|
|
13
|
+
headers?: Dict;
|
|
14
|
+
}
|
|
15
|
+
interface PayUResponseLike {
|
|
16
|
+
writeHead: (status: number, headers: Dict) => void;
|
|
17
|
+
write: (chunk: string) => void;
|
|
18
|
+
end: () => void;
|
|
19
|
+
status: (code: number) => void;
|
|
20
|
+
send: (body: any) => void;
|
|
21
|
+
}
|
|
22
|
+
declare class PayU {
|
|
23
|
+
config: PayUConfig;
|
|
24
|
+
constructor(npconfig: Dict);
|
|
25
|
+
normalizeAmount(amount: any): string;
|
|
26
|
+
buildRequestHash(payload: Dict): string;
|
|
27
|
+
buildResponseHash(data: Dict): string;
|
|
28
|
+
generatePaymentRequest(params: Dict): {
|
|
29
|
+
html: string;
|
|
30
|
+
payload: Dict;
|
|
31
|
+
};
|
|
32
|
+
decodeTransactionResponse(txnDataBase64FromPayu: string): Dict;
|
|
33
|
+
verifyResult(req: PayURequestLike): Promise<Dict>;
|
|
34
|
+
getPaymentStatus(txnId: string): Promise<Dict>;
|
|
35
|
+
postCommand(command: string, transactionId: string): Promise<Dict>;
|
|
36
|
+
checkBqrTxnStatus(transactionId: string): Promise<Dict>;
|
|
37
|
+
renderProcessingPage(params: Dict, paymentReq: Dict, res: PayUResponseLike, loadingSVG: string): void;
|
|
38
|
+
renderError(params: Dict, error: any, res: PayUResponseLike): void;
|
|
39
|
+
processWebhook(req: PayURequestLike, res: PayUResponseLike, updateTransaction: Function): void;
|
|
40
|
+
}
|
|
41
|
+
export default PayU;
|
|
@@ -175,40 +175,25 @@ class PayU {
|
|
|
175
175
|
return this.postCommand('verify_payment', transactionId);
|
|
176
176
|
}
|
|
177
177
|
renderProcessingPage(params, paymentReq, res, loadingSVG) {
|
|
178
|
+
// delegate HTML construction to htmlhelper's builder (keeps behavior identical)
|
|
179
|
+
const html = require('../htmlhelper').buildProcessingPageHtml(paymentReq.html, loadingSVG);
|
|
178
180
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
179
|
-
res.write(
|
|
181
|
+
res.write(html);
|
|
180
182
|
res.end();
|
|
181
183
|
}
|
|
182
184
|
renderError(params, error, res) {
|
|
183
185
|
console.log('ERROR:::', error, '\n');
|
|
184
186
|
res.status(500);
|
|
185
|
-
let formFields = '';
|
|
186
187
|
const errorResp = {
|
|
187
188
|
TXNID: 'na',
|
|
188
189
|
STATUS: 'TXN_FAILURE',
|
|
189
190
|
CANCELLED: 'cancelled',
|
|
190
191
|
ORDERID: params.ORDER_ID,
|
|
192
|
+
CHECKSUMHASH: params.CHECKSUM || ''
|
|
191
193
|
};
|
|
192
|
-
|
|
193
|
-
formFields += `<input type='hidden' name='${key}' value='${errorResp[key]}' >`;
|
|
194
|
-
});
|
|
195
|
-
formFields += `<input type='hidden' name='CHECKSUMHASH' value='${params.CHECKSUM || ''}' >`;
|
|
194
|
+
const html = require('../htmlhelper').buildAutoPostFormHtml(params.CALLBACK_URL, errorResp);
|
|
196
195
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
197
|
-
res.write(
|
|
198
|
-
|
|
199
|
-
<head>
|
|
200
|
-
<title>Merchant Checkout Error</title>
|
|
201
|
-
</head>
|
|
202
|
-
|
|
203
|
-
<body>
|
|
204
|
-
<center>
|
|
205
|
-
<h1>Something went wrong. Please wait you will be redirected automatically...</h1>
|
|
206
|
-
</center>
|
|
207
|
-
<form method='post' action='${params.CALLBACK_URL}' name='f1'>${formFields}</form>
|
|
208
|
-
<script type='text/javascript'>document.f1.submit();</script>
|
|
209
|
-
</body>
|
|
210
|
-
|
|
211
|
-
</html>`);
|
|
196
|
+
res.write(html);
|
|
212
197
|
res.end();
|
|
213
198
|
}
|
|
214
199
|
processWebhook(req, res, updateTransaction) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class PaytmChecksum {
|
|
2
|
+
static iv: string;
|
|
3
|
+
static encrypt(input: string, key: string): string;
|
|
4
|
+
static decrypt(encrypted: string, key: string): string;
|
|
5
|
+
static generateSignature(params: Record<string, any> | string, key: string): Promise<string> | Promise<never>;
|
|
6
|
+
static verifySignature(params: Record<string, any> | string, key: string, checksum: string): boolean | Promise<never>;
|
|
7
|
+
static generateSignatureByString(params: string, key: string): Promise<string>;
|
|
8
|
+
static verifySignatureByString(params: string, key: string, checksum: string): boolean;
|
|
9
|
+
static generateRandomString(length: number): Promise<string>;
|
|
10
|
+
static getStringByParams(params: Record<string, any>): string;
|
|
11
|
+
static calculateHash(params: string, salt: string): string;
|
|
12
|
+
static calculateChecksum(params: string, key: string, salt: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function genchecksum(params: Record<string, any>, key: string, cb: (err: any, checksum?: string) => void): Promise<void>;
|
|
2
|
+
export declare function genchecksumbystring(params: string, key: string, cb: (err: any, checksum?: string) => void): void;
|
|
3
|
+
export declare function verifychecksum(params: Record<string, any>, key: string, checksumhash?: string): boolean | Promise<never>;
|
|
4
|
+
export declare function verifychecksumbystring(params: string, key: string, checksumhash: string): boolean;
|
|
5
|
+
export declare function genchecksumforrefund(params: Record<string, any>, key: string, cb: (err: any, result?: any) => void): void;
|
|
6
|
+
export declare function checkRazorSignature(razorpayOrderId: string, razorpayPaymentId: string, secret: string, razorpay_signature: string): boolean;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
genchecksum: typeof genchecksum;
|
|
9
|
+
verifychecksum: typeof verifychecksum;
|
|
10
|
+
verifychecksumbystring: typeof verifychecksumbystring;
|
|
11
|
+
genchecksumbystring: typeof genchecksumbystring;
|
|
12
|
+
genchecksumforrefund: typeof genchecksumforrefund;
|
|
13
|
+
checkRazorSignature: typeof checkRazorSignature;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const iv = "@@@@&&&&####$$$$";
|
|
2
|
+
export declare function encrypt(data: string, custom_key: string): string;
|
|
3
|
+
export declare function decrypt(data: string, custom_key: string): string;
|
|
4
|
+
export declare function gen_salt(length: number): Promise<string>;
|
|
5
|
+
export declare function md5sum(salt: string, data: string): string;
|
|
6
|
+
export declare function sha256sum(salt: string, data: string): string;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
iv: string;
|
|
9
|
+
encrypt: typeof encrypt;
|
|
10
|
+
decrypt: typeof decrypt;
|
|
11
|
+
gen_salt: typeof gen_salt;
|
|
12
|
+
md5sum: typeof md5sum;
|
|
13
|
+
sha256sum: typeof sha256sum;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -64,8 +64,9 @@ http.createServer(function (req, res) {
|
|
|
64
64
|
form_fields += "<input type='hidden' name='" + x + "' value='" + params[x] + "' >";
|
|
65
65
|
}
|
|
66
66
|
form_fields += "<input type='hidden' name='CHECKSUMHASH' value='" + checksum + "' >";
|
|
67
|
+
const html = require('../htmlhelper').buildAutoPostFormHtml(txn_url, Object.assign({}, params, { CHECKSUMHASH: checksum }), 'Merchant Checkout Page');
|
|
67
68
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
68
|
-
res.write(
|
|
69
|
+
res.write(html);
|
|
69
70
|
res.end();
|
|
70
71
|
});
|
|
71
72
|
break;
|
|
@@ -115,8 +116,9 @@ http.createServer(function (req, res) {
|
|
|
115
116
|
for (const x in _result) {
|
|
116
117
|
html += x + ' => ' + _result[x] + '<br/>';
|
|
117
118
|
}
|
|
119
|
+
const out = require('../htmlhelper').buildProcessingPageHtml(html, '', 'Callback Response');
|
|
118
120
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
119
|
-
res.write(
|
|
121
|
+
res.write(out);
|
|
120
122
|
res.end();
|
|
121
123
|
});
|
|
122
124
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { NPConfig } from '../models';
|
|
3
|
+
export declare function renderView(req: Request, res: Response, viewFile: string, data: any): void | Response<any, Record<string, any>>;
|
|
4
|
+
export declare function buildAutoPostFormHtml(action: string, fields: Record<string, any>, title?: string): string;
|
|
5
|
+
export declare function sendAutoPostForm(req: Request, res: Response, action: string, fields: Record<string, any>): Response<any, Record<string, any>>;
|
|
6
|
+
export declare function buildProcessingPageHtml(innerHtml: string, loadingSVG?: string, title?: string, headScripts?: string, bodyScripts?: string): string;
|
|
7
|
+
export declare function renderProcessingPage(req: Request, res: Response, innerHtml: string, loadingSVG?: string, headScripts?: string, bodyScripts?: string): Response<any, Record<string, any>>;
|
|
8
|
+
export declare function renderPaytmJsCheckout(req: Request, res: Response, paytmJsToken: any, config: NPConfig): Response<any, Record<string, any>>;
|
|
9
|
+
export declare function renderRazorpayCheckout(req: Request, res: Response, params: Record<string, any>, config: NPConfig, loadingSVG: string): Response<any, Record<string, any>>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderView = renderView;
|
|
4
|
+
exports.buildAutoPostFormHtml = buildAutoPostFormHtml;
|
|
5
|
+
exports.sendAutoPostForm = sendAutoPostForm;
|
|
6
|
+
exports.buildProcessingPageHtml = buildProcessingPageHtml;
|
|
7
|
+
exports.renderProcessingPage = renderProcessingPage;
|
|
8
|
+
exports.renderPaytmJsCheckout = renderPaytmJsCheckout;
|
|
9
|
+
exports.renderRazorpayCheckout = renderRazorpayCheckout;
|
|
10
|
+
const paytm_1 = require("./adapters/paytm");
|
|
11
|
+
function wantsJson(req) {
|
|
12
|
+
// Return true only when the caller EXPLICITLY sets Accept to only `application/json`.
|
|
13
|
+
// Examples that return true: "application/json" or "application/json; q=1"
|
|
14
|
+
// Examples that return false: "application/json, */*", "text/html", missing header, etc.
|
|
15
|
+
const hdr = String((req && req.headers && req.headers.accept) || '').trim().toLowerCase();
|
|
16
|
+
if (!hdr)
|
|
17
|
+
return false;
|
|
18
|
+
const types = hdr.split(',').map(t => t.split(';')[0].trim()).filter(Boolean);
|
|
19
|
+
return types.length > 0 && types.every(t => t === 'application/json');
|
|
20
|
+
}
|
|
21
|
+
function renderView(req, res, viewFile, data) {
|
|
22
|
+
if (wantsJson(req)) {
|
|
23
|
+
return res.json(data);
|
|
24
|
+
}
|
|
25
|
+
return res.render(viewFile, data);
|
|
26
|
+
}
|
|
27
|
+
function buildAutoPostFormHtml(action, fields, title = 'Merchant Checkout Error') {
|
|
28
|
+
const inputs = Object.keys(fields || {}).map((k) => {
|
|
29
|
+
const v = fields[k] === undefined || fields[k] === null ? '' : String(fields[k]);
|
|
30
|
+
return `<input type='hidden' name='${k}' value='${v}' >`;
|
|
31
|
+
}).join('');
|
|
32
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>${title}</title></head><body><center><h1>Something went wrong. Please wait you will be redirected automatically...</h1></center><form method="post" action="${action}" name="f1">${inputs}</form><script type="text/javascript">document.f1.submit();</script></body></html>`;
|
|
33
|
+
}
|
|
34
|
+
function sendAutoPostForm(req, res, action, fields) {
|
|
35
|
+
if (wantsJson(req)) {
|
|
36
|
+
// send dynamic content as JSON instead of embedding in an HTML form
|
|
37
|
+
return res.status(res.statusCode || 200).json({ action, fields });
|
|
38
|
+
}
|
|
39
|
+
const html = buildAutoPostFormHtml(action, fields);
|
|
40
|
+
return res.status(200).contentType('text/html').send(html);
|
|
41
|
+
}
|
|
42
|
+
function buildProcessingPageHtml(innerHtml, loadingSVG = '', title = 'Merchant Checkout Page', headScripts = '', bodyScripts = '') {
|
|
43
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>${title}</title>${headScripts}</head><body><center><h1>Processing ! Please do not refresh this page...</h1><br>${innerHtml}<br><br>${loadingSVG}</center>${bodyScripts}</body></html>`;
|
|
44
|
+
}
|
|
45
|
+
function renderProcessingPage(req, res, innerHtml, loadingSVG = '', headScripts = '', bodyScripts = '') {
|
|
46
|
+
if (wantsJson(req)) {
|
|
47
|
+
return res.json({ provider: 'processing', html: innerHtml, loadingSVG, headScripts, bodyScripts });
|
|
48
|
+
}
|
|
49
|
+
const html = buildProcessingPageHtml(innerHtml, loadingSVG, 'Merchant Checkout Page', headScripts, bodyScripts);
|
|
50
|
+
return res.status(200).contentType('text/html').send(html);
|
|
51
|
+
}
|
|
52
|
+
function renderPaytmJsCheckout(req, res, paytmJsToken, config) {
|
|
53
|
+
if (wantsJson(req)) {
|
|
54
|
+
// return the dynamic payload which would otherwise be embedded into the generated HTML
|
|
55
|
+
return res.json({ provider: 'paytm', token: paytmJsToken });
|
|
56
|
+
}
|
|
57
|
+
const html = (0, paytm_1.createPaytmJsCheckoutHtml)(paytmJsToken, config);
|
|
58
|
+
return res.send(html);
|
|
59
|
+
}
|
|
60
|
+
function renderRazorpayCheckout(req, res, params, config, loadingSVG) {
|
|
61
|
+
const options = {
|
|
62
|
+
key: String(config.KEY),
|
|
63
|
+
amount: Number(params['TXN_AMOUNT']) * 100,
|
|
64
|
+
currency: 'INR',
|
|
65
|
+
name: params['PRODUCT_NAME'],
|
|
66
|
+
description: `Order # ${params['ORDER_ID']}`,
|
|
67
|
+
image: config.logo,
|
|
68
|
+
order_id: params['ORDER_ID'],
|
|
69
|
+
callback_url: params['CALLBACK_URL'],
|
|
70
|
+
prefill: {
|
|
71
|
+
name: params['NAME'],
|
|
72
|
+
email: params['EMAIL'],
|
|
73
|
+
contact: params['MOBILE_NO']
|
|
74
|
+
},
|
|
75
|
+
theme: {
|
|
76
|
+
color: config.theme_color
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
if (wantsJson(req)) {
|
|
80
|
+
return res.json({ provider: 'razorpay', options, failForm: { action: params['CALLBACK_URL'], fields: { razorpay_order_id: params['ORDER_ID'] } }, loadingSVG });
|
|
81
|
+
}
|
|
82
|
+
const fail = `<div style="display:none"><form method="post" action="${params['CALLBACK_URL']}" id="fail"><input name="razorpay_order_id" value="${params['ORDER_ID']}" hidden="true"/></form></div>`;
|
|
83
|
+
const scriptOptions = `
|
|
84
|
+
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
|
|
85
|
+
<script>
|
|
86
|
+
var options = ${JSON.stringify(options, null, 4)};
|
|
87
|
+
options.modal = options.modal || {};
|
|
88
|
+
options.modal.ondismiss = function(){ document.getElementById('fail').submit(); };
|
|
89
|
+
var rzp1 = new Razorpay(options);
|
|
90
|
+
rzp1.open();
|
|
91
|
+
</script>`;
|
|
92
|
+
const html = `<!doctype html><html><head><title>Merchant Checkout Page</title></head><body><center><h1>Processing ! Please do not refresh this page...</h1><br>${scriptOptions}<br>${fail}<br>${loadingSVG}</center></body></html>`;
|
|
93
|
+
return res.status(200).contentType('text/html').send(html);
|
|
94
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MultiDbORM } from 'multi-db-orm';
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { NPConfig, NPTableNames } from '../models';
|
|
4
|
+
export declare class PaymentController {
|
|
5
|
+
private config;
|
|
6
|
+
private callbacks;
|
|
7
|
+
private db;
|
|
8
|
+
private tableNames;
|
|
9
|
+
private useController;
|
|
10
|
+
private viewPath;
|
|
11
|
+
private payuInstance;
|
|
12
|
+
private openMoneyInstance;
|
|
13
|
+
private razorPayInstance;
|
|
14
|
+
constructor(config: NPConfig, db: MultiDbORM, callbacks?: any, tableNames?: NPTableNames);
|
|
15
|
+
encodeTxnDataForUrl(txnDataJson: any): string;
|
|
16
|
+
decodeTxnDataFromUrl(encodedStr: string): any;
|
|
17
|
+
private configure;
|
|
18
|
+
private insertTransactionInDb;
|
|
19
|
+
private generateChecksum;
|
|
20
|
+
home(req: Request, res: Response): void | Response<any, Record<string, any>>;
|
|
21
|
+
init(req: Request, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
22
|
+
updateTransaction(req: Request, res: Response): Promise<void>;
|
|
23
|
+
callback(req: Request, res: Response): Promise<void>;
|
|
24
|
+
webhook(req: Request, res: Response): Promise<void>;
|
|
25
|
+
createTxn(req: Request, res: Response): Promise<void>;
|
|
26
|
+
createTxnToken(req: Request, res: Response): Promise<void>;
|
|
27
|
+
getTransactions(req: Request, res: Response): Promise<void>;
|
|
28
|
+
status(req: Request, res: Response): Promise<void>;
|
|
29
|
+
private getStatusFromPaytm;
|
|
30
|
+
}
|
|
@@ -49,7 +49,7 @@ const payu_1 = __importDefault(require("./adapters/payu"));
|
|
|
49
49
|
const user_controller_1 = require("./user.controller");
|
|
50
50
|
const utils_1 = require("../utils/utils");
|
|
51
51
|
const loadingsvg_1 = require("./static/loadingsvg");
|
|
52
|
-
const
|
|
52
|
+
const htmlhelper_1 = require("./htmlhelper");
|
|
53
53
|
const IDLEN = 14;
|
|
54
54
|
function makeid(length) {
|
|
55
55
|
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
@@ -178,7 +178,7 @@ class PaymentController {
|
|
|
178
178
|
}
|
|
179
179
|
home(req, res) {
|
|
180
180
|
package_json_1.default.repository.url = package_json_1.default.repository.url.replace('git+', '');
|
|
181
|
-
|
|
181
|
+
return (0, htmlhelper_1.renderView)(req, res, this.viewPath + "home.hbs", package_json_1.default);
|
|
182
182
|
}
|
|
183
183
|
async init(req, res) {
|
|
184
184
|
var _a;
|
|
@@ -273,114 +273,36 @@ class PaymentController {
|
|
|
273
273
|
paytmJsToken.TXN_AMOUNT = params['TXN_AMOUNT'];
|
|
274
274
|
paytmJsToken.MID = params['MID'];
|
|
275
275
|
paytmJsToken.CALLBACK_URL = params['CALLBACK_URL'];
|
|
276
|
-
return
|
|
276
|
+
return (0, htmlhelper_1.renderPaytmJsCheckout)(req, res, paytmJsToken, this.config);
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
279
279
|
console.log('ERROR:::', resp.status, '\n', body);
|
|
280
280
|
res.status(500);
|
|
281
|
-
|
|
282
|
-
let errorResp = {
|
|
281
|
+
const errorResp = {
|
|
283
282
|
TXNID: 'na',
|
|
284
283
|
STATUS: 'TXN_FAILURE',
|
|
285
284
|
CANCELLED: 'cancelled',
|
|
286
|
-
ORDERID: params['ORDER_ID']
|
|
285
|
+
ORDERID: params['ORDER_ID'],
|
|
286
|
+
CHECKSUMHASH: checksum
|
|
287
287
|
};
|
|
288
|
-
|
|
289
|
-
form_fields += "<input type='hidden' name='" + x + "' value='" + errorResp[x] + "' >";
|
|
290
|
-
}
|
|
291
|
-
form_fields += "<input type='hidden' name='CHECKSUMHASH' value='" + checksum + "' >";
|
|
292
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
293
|
-
res.write(`<html>
|
|
294
|
-
|
|
295
|
-
<head>
|
|
296
|
-
<title>Merchant Checkout Error</title>
|
|
297
|
-
</head>
|
|
298
|
-
|
|
299
|
-
<body>
|
|
300
|
-
<center>
|
|
301
|
-
<h1>Something went wrong. Please wait you will be redirected automatically...</h1>
|
|
302
|
-
</center>
|
|
303
|
-
<form method="post" action="${params['CALLBACK_URL']}" name="f1">${form_fields}</form>
|
|
304
|
-
<script type="text/javascript">document.f1.submit();</script>
|
|
305
|
-
</body>
|
|
306
|
-
|
|
307
|
-
</html>`);
|
|
308
|
-
res.end();
|
|
288
|
+
return (0, htmlhelper_1.sendAutoPostForm)(req, res, params['CALLBACK_URL'], errorResp);
|
|
309
289
|
}
|
|
310
290
|
}
|
|
311
291
|
catch (err) {
|
|
312
292
|
console.log('ERROR:::', err);
|
|
313
293
|
res.status(500);
|
|
314
|
-
|
|
315
|
-
let errorResp = {
|
|
294
|
+
const errorResp = {
|
|
316
295
|
TXNID: 'na',
|
|
317
296
|
STATUS: 'TXN_FAILURE',
|
|
318
297
|
CANCELLED: 'cancelled',
|
|
319
|
-
ORDERID: params['ORDER_ID']
|
|
298
|
+
ORDERID: params['ORDER_ID'],
|
|
299
|
+
CHECKSUMHASH: checksum
|
|
320
300
|
};
|
|
321
|
-
|
|
322
|
-
form_fields += "<input type='hidden' name='" + x + "' value='" + errorResp[x] + "' >";
|
|
323
|
-
}
|
|
324
|
-
form_fields += "<input type='hidden' name='CHECKSUMHASH' value='" + checksum + "' >";
|
|
325
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
326
|
-
res.write(`<html>
|
|
327
|
-
|
|
328
|
-
<head>
|
|
329
|
-
<title>Merchant Checkout Error</title>
|
|
330
|
-
</head>
|
|
331
|
-
|
|
332
|
-
<body>
|
|
333
|
-
<center>
|
|
334
|
-
<h1>Something went wrong. Please wait you will be redirected automatically...</h1>
|
|
335
|
-
</center>
|
|
336
|
-
<form method="post" action="${params['CALLBACK_URL']}" name="f1">${form_fields}</form>
|
|
337
|
-
<script type="text/javascript">document.f1.submit();</script>
|
|
338
|
-
</body>
|
|
339
|
-
|
|
340
|
-
</html>`);
|
|
341
|
-
res.end();
|
|
301
|
+
return (0, htmlhelper_1.sendAutoPostForm)(req, res, params['CALLBACK_URL'], errorResp);
|
|
342
302
|
}
|
|
343
303
|
}
|
|
344
304
|
else if (this.config.razor_url) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<form method="post" action="${params['CALLBACK_URL']}" id="fail">
|
|
348
|
-
<input name="razorpay_order_id" value="${params['ORDER_ID']}" hidden="true"/>
|
|
349
|
-
</form>
|
|
350
|
-
</div>`;
|
|
351
|
-
let html = `
|
|
352
|
-
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
|
|
353
|
-
<script>
|
|
354
|
-
var options = {
|
|
355
|
-
"key": "${this.config.KEY}",
|
|
356
|
-
"amount": "${parseFloat(params['TXN_AMOUNT']) * 100}",
|
|
357
|
-
"currency": "INR",
|
|
358
|
-
"name": "${params['PRODUCT_NAME']}",
|
|
359
|
-
"description": "Order # ${params['ORDER_ID']}",
|
|
360
|
-
"image": "${this.config.logo}",
|
|
361
|
-
"order_id": "${params['ORDER_ID']}",
|
|
362
|
-
"callback_url": "${params['CALLBACK_URL']}",
|
|
363
|
-
"prefill": {
|
|
364
|
-
"name": "${params['NAME']}",
|
|
365
|
-
"email": "${params['EMAIL']}",
|
|
366
|
-
"contact": "${params['MOBILE_NO']}"
|
|
367
|
-
},
|
|
368
|
-
"theme": {
|
|
369
|
-
"color": "${this.config.theme_color}"
|
|
370
|
-
},
|
|
371
|
-
"modal": {
|
|
372
|
-
"ondismiss": function(){
|
|
373
|
-
document.getElementById("fail").submit()
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
var rzp1 = new Razorpay(options);
|
|
378
|
-
|
|
379
|
-
rzp1.open();
|
|
380
|
-
</script>`;
|
|
381
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
382
|
-
res.write(`<html><head><title>Merchant Checkout Page</title></head><body><center><h1>Processing ! Please do not refresh this page...</h1><br>${html}<br>${fail}<br>${loadingsvg_1.LoadingSVG}</center></body></html>`);
|
|
383
|
-
res.end();
|
|
305
|
+
return (0, htmlhelper_1.renderRazorpayCheckout)(req, res, params, this.config, loadingsvg_1.LoadingSVG);
|
|
384
306
|
}
|
|
385
307
|
else if (this.config.payu_url) {
|
|
386
308
|
const payuRequest = this.payuInstance.generatePaymentRequest(params);
|
|
@@ -426,7 +348,7 @@ class PaymentController {
|
|
|
426
348
|
params['NAME'] = txnData.name;
|
|
427
349
|
params['PRODUCT_NAME'] = txnData.pname;
|
|
428
350
|
const showConfirmation = (checksum = '') => {
|
|
429
|
-
|
|
351
|
+
return (0, htmlhelper_1.renderView)(req, res, vp + "init.hbs", {
|
|
430
352
|
path_prefix: config.path_prefix,
|
|
431
353
|
action: "/" + config.path_prefix + "/init",
|
|
432
354
|
readonly: 'readonly',
|
|
@@ -533,7 +455,7 @@ class PaymentController {
|
|
|
533
455
|
}
|
|
534
456
|
}
|
|
535
457
|
else {
|
|
536
|
-
|
|
458
|
+
return (0, htmlhelper_1.renderView)(req, res, this.viewPath + "init.hbs", {
|
|
537
459
|
path_prefix: this.config.path_prefix,
|
|
538
460
|
action: "/" + this.config.path_prefix + "/init",
|
|
539
461
|
readonly: '',
|
|
@@ -615,7 +537,7 @@ class PaymentController {
|
|
|
615
537
|
const separator = returnUrl.indexOf('?') > -1 ? '&' : '?';
|
|
616
538
|
return res.redirect(`${returnUrl}${separator}status=${objForUpdate.status}&ORDERID=${objForUpdate.orderId}&TXNID=${objForUpdate.txnId}`);
|
|
617
539
|
}
|
|
618
|
-
|
|
540
|
+
(0, htmlhelper_1.renderView)(req, res, vp + "result.hbs", {
|
|
619
541
|
path_prefix: config.path_prefix,
|
|
620
542
|
...objForUpdate
|
|
621
543
|
});
|
|
@@ -654,7 +576,7 @@ class PaymentController {
|
|
|
654
576
|
const separator = returnUrl.indexOf('?') > -1 ? '&' : '?';
|
|
655
577
|
return res.redirect(`${returnUrl}${separator}status=${objForUpdate.status}&ORDERID=${objForUpdate.orderId}&TXNID=${objForUpdate.txnId}`);
|
|
656
578
|
}
|
|
657
|
-
|
|
579
|
+
(0, htmlhelper_1.renderView)(req, res, vp + "result.hbs", {
|
|
658
580
|
path_prefix: config.path_prefix,
|
|
659
581
|
...objForUpdate
|
|
660
582
|
});
|
|
@@ -700,6 +622,12 @@ class PaymentController {
|
|
|
700
622
|
}
|
|
701
623
|
}
|
|
702
624
|
else if (config.razor_url) {
|
|
625
|
+
let orderid = req.body.razorpay_order_id || req.query.ORDERID || req.query.order_id;
|
|
626
|
+
let liveResonse = null;
|
|
627
|
+
if (orderid) {
|
|
628
|
+
liveResonse = await this.razorPayInstance.orders.fetch(orderid).catch(() => null);
|
|
629
|
+
req.body.extras = liveResonse;
|
|
630
|
+
}
|
|
703
631
|
if (req.body.razorpay_payment_id) {
|
|
704
632
|
result = checksum_1.default.checkRazorSignature(req.body.razorpay_order_id, req.body.razorpay_payment_id, config.SECRET, req.body.razorpay_signature);
|
|
705
633
|
if (result) {
|
|
@@ -713,7 +641,7 @@ class PaymentController {
|
|
|
713
641
|
const orderId = JSON.parse(req.body.error.metadata).order_id;
|
|
714
642
|
req.body.razorpay_order_id = orderId;
|
|
715
643
|
}
|
|
716
|
-
req.body.STATUS = 'TXN_FAILURE';
|
|
644
|
+
req.body.STATUS = (liveResonse === null || liveResonse === void 0 ? void 0 : liveResonse.attempts) ? 'TXN_FAILURE' : 'CANCELLED';
|
|
717
645
|
req.body.ORDERID = req.body.razorpay_order_id || req.query.order_id;
|
|
718
646
|
isCancelled = true;
|
|
719
647
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LoadingSVG = " <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"margin:auto;background:#fff;display:block;\" width=\"200px\" height=\"200px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n<g transform=\"rotate(0 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.9166666666666666s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(30 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.8333333333333334s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(60 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.75s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(90 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.6666666666666666s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(120 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5833333333333334s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(150 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(180 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.4166666666666667s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(210 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.3333333333333333s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(240 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.25s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(270 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.16666666666666666s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(300 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.08333333333333333s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g><g transform=\"rotate(330 50 50)\">\n<rect x=\"47\" y=\"24\" rx=\"3\" ry=\"6\" width=\"6\" height=\"12\" fill=\"#0097a7\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"0s\" repeatCount=\"indefinite\"></animate>\n</rect>\n</g>\n</svg>";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MultiDbORM } from "multi-db-orm";
|
|
2
|
+
import { NPUser } from "../models";
|
|
3
|
+
export declare class NPUserController {
|
|
4
|
+
db: MultiDbORM;
|
|
5
|
+
tableName: string;
|
|
6
|
+
constructor(db: MultiDbORM, tableName?: string);
|
|
7
|
+
init(): Promise<void>;
|
|
8
|
+
create(userData: NPUser): Promise<NPUser>;
|
|
9
|
+
}
|
|
@@ -28,7 +28,7 @@ class NPUserController {
|
|
|
28
28
|
objForUpdate.phone = userData.phone;
|
|
29
29
|
if (userData.name && userData.name.length > 2)
|
|
30
30
|
objForUpdate.name = userData.name;
|
|
31
|
-
const newvalues =
|
|
31
|
+
const newvalues = objForUpdate;
|
|
32
32
|
try {
|
|
33
33
|
await this.db.update(this.tableName, myquery, newvalues);
|
|
34
34
|
return objForUpdate;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type Callback = (err?: any, res?: any) => void;
|
|
2
|
+
export interface NPUser {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
createdAt?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* NPTransaction is the interface for the transaction object stored in the database. It contains all the details of a transaction, including the order ID, customer ID, time of transaction, status, name, email, phone number, amount, product name, and any extra information.
|
|
11
|
+
* time: in miliseconds
|
|
12
|
+
* status: can be 'TXN_SUCCESS', 'TXN_FAILURE', 'PENDING', 'INITIATED'
|
|
13
|
+
* extra: json can be used to store any extra information related to the transaction, such as the payment method used, the bank name, etc.
|
|
14
|
+
*/
|
|
15
|
+
export interface NPTransaction {
|
|
16
|
+
id: string;
|
|
17
|
+
orderId: string;
|
|
18
|
+
cusId: string;
|
|
19
|
+
time: Number;
|
|
20
|
+
status: string;
|
|
21
|
+
name: string;
|
|
22
|
+
email: string;
|
|
23
|
+
phone: string;
|
|
24
|
+
amount: Number;
|
|
25
|
+
pname: string;
|
|
26
|
+
extra: string;
|
|
27
|
+
readonly?: string;
|
|
28
|
+
txnId?: string;
|
|
29
|
+
clientId: string;
|
|
30
|
+
returnUrl: string;
|
|
31
|
+
webhookUrl: string;
|
|
32
|
+
}
|
|
33
|
+
export interface NPCallbacks {
|
|
34
|
+
onStart: (orderId: string, paymentData?: NPTransaction) => void;
|
|
35
|
+
onFinish: (orderId: string, paymentData?: NPTransaction) => void;
|
|
36
|
+
}
|
|
37
|
+
export type NPConfig = {
|
|
38
|
+
KEY: string;
|
|
39
|
+
SECRET: string;
|
|
40
|
+
MID?: string;
|
|
41
|
+
WEBSITE?: string;
|
|
42
|
+
CHANNEL_ID?: string;
|
|
43
|
+
INDUSTRY_TYPE_ID?: string;
|
|
44
|
+
CALLBACK_URL?: string;
|
|
45
|
+
paytm_url?: string;
|
|
46
|
+
mode?: string;
|
|
47
|
+
razor_url?: string;
|
|
48
|
+
open_money_url?: string;
|
|
49
|
+
payu_url?: string;
|
|
50
|
+
templateDir?: string;
|
|
51
|
+
view_path: string;
|
|
52
|
+
theme_color?: string;
|
|
53
|
+
brand?: string;
|
|
54
|
+
logo?: string;
|
|
55
|
+
host_url?: string;
|
|
56
|
+
path_prefix: string;
|
|
57
|
+
id_length?: number;
|
|
58
|
+
};
|
|
59
|
+
export type NPTableNames = {
|
|
60
|
+
USER: string;
|
|
61
|
+
TRANSACTION: string;
|
|
62
|
+
};
|
|
63
|
+
export type NPParam = {
|
|
64
|
+
ORDER_ID?: string;
|
|
65
|
+
CUST_ID?: string;
|
|
66
|
+
TXN_AMOUNT: string;
|
|
67
|
+
CALLBACK_URL?: string;
|
|
68
|
+
EMAIL?: string;
|
|
69
|
+
MOBILE_NO?: string;
|
|
70
|
+
NAME?: string;
|
|
71
|
+
PRODUCT_NAME?: string;
|
|
72
|
+
RETURN_URL?: string;
|
|
73
|
+
MID?: string;
|
|
74
|
+
WEBSITE?: string;
|
|
75
|
+
CHANNEL_ID?: string;
|
|
76
|
+
INDUSTRY_TYPE_ID?: string;
|
|
77
|
+
CURRENCY?: string;
|
|
78
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Application, RequestHandler, Router } from 'express';
|
|
2
|
+
import { NPCallbacks, NPConfig, NPTableNames } from './app/models';
|
|
3
|
+
import { MultiDbORM } from 'multi-db-orm';
|
|
4
|
+
export * from './app/models';
|
|
5
|
+
export declare function attachBodyParser(app: Application, userConfig?: Partial<NPConfig>): void;
|
|
6
|
+
export declare function createPaymentMiddleware(app: Application, userConfig: NPConfig, db: MultiDbORM, callbacks?: NPCallbacks, authenticationMiddleware?: RequestHandler, tableNames?: NPTableNames): Router;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
createPaymentMiddleware: typeof createPaymentMiddleware;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
package/dist/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-paytmpg",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.5",
|
|
4
4
|
"description": "Payment Gateway Integration using NodeJS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"start": "node example.js",
|
|
8
9
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-paytmpg",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.5",
|
|
4
4
|
"description": "Payment Gateway Integration using NodeJS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"start": "node example.js",
|
|
8
9
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|