quickpos 1.0.919 → 1.0.921
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/lib/paytr.js +8 -5
- package/package.json +1 -1
package/lib/paytr.js
CHANGED
|
@@ -267,16 +267,19 @@ class PayTR {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
handleCallback(callbackData) {
|
|
270
|
-
const { merchant_oid, status, total_amount, hash, type = 'iframe' } = callbackData;
|
|
270
|
+
const { merchant_oid, status, total_amount, hash, type = 'iframe', callback_id=false } = callbackData;
|
|
271
271
|
|
|
272
272
|
if (!hash) throw new Error('Hash param missing');
|
|
273
273
|
|
|
274
274
|
let token;
|
|
275
|
-
|
|
275
|
+
|
|
276
|
+
if (callbackData.callback_id) type = "link";
|
|
277
|
+
|
|
278
|
+
if (type == 'iframe') {
|
|
276
279
|
token = `${merchant_oid}${this.merchantSalt}${status}${total_amount}`;
|
|
277
|
-
} else if (type
|
|
278
|
-
token = `${
|
|
279
|
-
} else if (type
|
|
280
|
+
} else if (type == 'link') {
|
|
281
|
+
token = `${callback_id}${merchant_oid}${this.merchantSalt}${status}${total_amount}`;
|
|
282
|
+
} else if (type == 'eft') {
|
|
280
283
|
token = `${merchant_oid}${this.merchantSalt}${status}${total_amount}`;
|
|
281
284
|
}
|
|
282
285
|
|