@opengis/pay 2.0.2 → 2.0.3

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/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "@opengis/pay",
3
- "version": "2.0.2",
4
- "type": "module",
5
- "description": "pay plugins for billing",
6
- "main": "plugin.js",
7
- "browser": "plugin.js",
8
- "files": [
9
- "server/*",
10
- "module/*",
11
- "plugin.js",
12
- "config.js",
13
- "utils.js"
14
- ],
15
- "scripts": {
16
- "patch": "npm version patch && git push && npm publish",
17
- "test": "node --test",
18
- "start": "node --watch-path=server server",
19
- "admin": "set NODE_ENV=admin&& npm run start",
20
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
21
- },
22
- "dependencies": {
23
- "liqpayjs-sdk": "3.3.1",
24
- "request-promise": "4.2.6"
25
- },
26
- "devDependencies": {
27
- "dotenv": "^17.2.2",
28
- "eslint": "8.49.0",
29
- "eslint-config-airbnb": "19.0.4",
30
- "fastify": "5.3.3",
31
- "fastify-plugin": "5.0.1",
32
- "ioredis": "5.3.2",
33
- "nodemailer": "6.5.0",
34
- "pg": "8.11.3",
35
- "vitest": "^3.2.4"
36
- },
37
- "author": "Softpro",
38
- "license": "ISC"
39
- }
1
+ {
2
+ "name": "@opengis/pay",
3
+ "version": "2.0.3",
4
+ "type": "module",
5
+ "description": "pay plugins for billing",
6
+ "main": "plugin.js",
7
+ "browser": "plugin.js",
8
+ "files": [
9
+ "server/*",
10
+ "module/*",
11
+ "plugin.js",
12
+ "config.js",
13
+ "utils.js"
14
+ ],
15
+ "scripts": {
16
+ "patch": "npm version patch && git push && npm publish",
17
+ "test": "node --test",
18
+ "start": "node --watch-path=server server",
19
+ "admin": "set NODE_ENV=admin&& npm run start",
20
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
21
+ },
22
+ "dependencies": {
23
+ "liqpayjs-sdk": "3.3.1",
24
+ "request-promise": "4.2.6"
25
+ },
26
+ "devDependencies": {
27
+ "dotenv": "^17.2.2",
28
+ "eslint": "8.49.0",
29
+ "eslint-config-airbnb": "19.0.4",
30
+ "fastify": "5.3.3",
31
+ "fastify-plugin": "5.0.1",
32
+ "ioredis": "5.3.2",
33
+ "nodemailer": "6.5.0",
34
+ "pg": "8.11.3",
35
+ "vitest": "^3.2.4"
36
+ },
37
+ "author": "Softpro",
38
+ "license": "ISC"
39
+ }
@@ -17,7 +17,7 @@ export default async function createPayment({
17
17
  pg,
18
18
  table,
19
19
  data: {
20
- referer_url: paymentRedirect ? paymentRedirect.replace(/{{id}}/g, paymentId) : referer,
20
+ referer_url: referer,
21
21
  amount,
22
22
  user_id: uid,
23
23
  order_id: orderId,
@@ -7,7 +7,7 @@ import pgClients from '../pg/pgClients.js';
7
7
  import createPayment from './createPayment.js';
8
8
 
9
9
  const { prefix = '/api' } = config;
10
- const { table = 'pay.transactions', backUrl } = config.integrations?.pay || {};
10
+ const { table = 'pay.transactions', backUrl: bUrl } = config.integrations?.pay || {};
11
11
 
12
12
  const {
13
13
  host = 'https://www.liqpay.ua',
@@ -19,7 +19,9 @@ const liqpay = new LiqPay(publicKey, privateKey);
19
19
  export default async function liqpayCreateTransaction({
20
20
  id, orderId, amount, referer, uid, debug, expiredDate, description, paytypes, action = 'pay', currency = 'uah', language = 'uk',
21
21
  }, pg = pgClients.client) {
22
- if (!publicKey || !privateKey || !backUrl) {
22
+ const backUrl = bUrl || referer.slice(0, referer.indexOf('/', 7));
23
+
24
+ if (!publicKey || !privateKey) {
23
25
  throw new Error('invalid liqpay integration settings');
24
26
  }
25
27