@opengis/pay 1.1.0 → 1.1.1
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/module/pay/card/billing.accounts.table/general_info.hbs +10 -10
- package/module/pay/card/billing.accounts.table/index.yml +15 -15
- package/module/pay/card/billing.accounts.table/users.hbs +11 -11
- package/module/pay/card/billing.payments.table/general_info.hbs +12 -12
- package/module/pay/card/billing.payments.table/index.yml +9 -9
- package/module/pay/card/billing.users.table/general_info.hbs +10 -10
- package/module/pay/card/billing.users.table/index.yml +9 -9
- package/module/pay/form/billing.account_user.form.json +14 -14
- package/module/pay/form/billing.accounts.form.json +30 -30
- package/module/pay/form/billing.payment.form.json +22 -22
- package/module/pay/form/billing.users.form.json +38 -38
- package/module/pay/menu.json +24 -24
- package/module/pay/pt/marketplace-service-payment-client-template.html +3 -3
- package/module/pay/table/billing.accounts.table.json +60 -60
- package/module/pay/table/billing.payments.table.json +67 -67
- package/module/pay/table/billing.users.table.json +70 -70
- package/package.json +1 -1
- package/plugin.js +0 -5
- package/server/migrations/1_users.sql +120 -120
- package/server/migrations/2_accounts.sql +59 -59
- package/server/migrations/3_utils.sql +73 -73
- package/server/migrations/4_subscriptions.sql +35 -35
- package/server/migrations/5_payments.sql +36 -36
- package/server/migrations/6_invoices.sql +54 -54
- package/server/routes/portmone.redirect.js +26 -13
- package/server/routes/portmone.status.js +17 -7
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
config, logger, pgClients, getSelectVal,
|
|
3
|
-
dataUpdate,
|
|
2
|
+
config, logger, pgClients, getSelectVal, dataUpdate, getTemplate,
|
|
4
3
|
} from '@opengis/fastify-table/utils.js';
|
|
5
4
|
|
|
6
5
|
import { sendNotification } from '@opengis/admin/utils.js';
|
|
@@ -68,14 +67,23 @@ export default async function portmoneStatus(req, reply) {
|
|
|
68
67
|
|
|
69
68
|
// request portmone trx info to recheck request data is valid?
|
|
70
69
|
if (!config.debug && !origin?.startsWith(host)) {
|
|
71
|
-
logger.file('
|
|
72
|
-
|
|
70
|
+
logger.file('payments/warn', {
|
|
71
|
+
type: 'status',
|
|
72
|
+
origin,
|
|
73
|
+
uid: user.uid,
|
|
74
|
+
refill,
|
|
75
|
+
message: 'invalid referer',
|
|
73
76
|
});
|
|
74
77
|
return { message: 'access restricted', status: 403 };
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
logger.file('
|
|
78
|
-
|
|
80
|
+
logger.file('payments', {
|
|
81
|
+
type: 'status',
|
|
82
|
+
origin,
|
|
83
|
+
uid: user.uid,
|
|
84
|
+
refill,
|
|
85
|
+
body,
|
|
86
|
+
params,
|
|
79
87
|
});
|
|
80
88
|
|
|
81
89
|
// last trx contains total balance
|
|
@@ -111,16 +119,18 @@ export default async function portmoneStatus(req, reply) {
|
|
|
111
119
|
|
|
112
120
|
Object.assign(data, {
|
|
113
121
|
domain: req.hostname,
|
|
122
|
+
total_balance: +(refill || 0) + (+totalBalance || 0),
|
|
114
123
|
account_id_text: accountId ? cls2?.[accountId] || accountId : 'Інформація відсутня',
|
|
115
124
|
payment_status_text: trxStatus ? cls3?.[trxStatus] || trxStatus : 'Інформація відсутня',
|
|
116
125
|
});
|
|
117
126
|
|
|
118
127
|
if (to) {
|
|
128
|
+
const pt = await getTemplate('pt', 'marketplace-service-payment-client-template');
|
|
119
129
|
const options = {
|
|
120
130
|
pg,
|
|
121
131
|
to,
|
|
122
132
|
title: `Поповнення рахунку на порталі ${req.hostname}`,
|
|
123
|
-
template:
|
|
133
|
+
template: pt?.html || pt,
|
|
124
134
|
data,
|
|
125
135
|
nocache: config?.local,
|
|
126
136
|
};
|