@managesome/eposmatic-toolkit 0.2.495 → 0.2.497

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.
@@ -241,7 +241,6 @@ export interface IReceiptMetadata {
241
241
  addExtraSpaceOnTop: boolean | undefined;
242
242
  num_of_columns: number | undefined;
243
243
  splitCheckNumber: number | undefined;
244
- customMessage: string | null | undefined;
245
244
  printerName: string;
246
245
  rasterOnlyReceipt: boolean | undefined;
247
246
  displayMetadataOnCustomerReceipt: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { COUNTRY_ALPHA_3_ENUM, PAYMENT_EXTENSION_ENUM, PAYMENT_TYPE_ENUM } from '../../constants';
1
+ import { PAYMENT_EXTENSION_ENUM, PAYMENT_TYPE_ENUM } from '../../constants';
2
2
  import { IOrderPayment } from '../../schemas';
3
3
  export declare function getPaymentAmountPayed(payment: IOrderPayment, allowUnverifiedPayments?: boolean): {
4
4
  amountPaid: number;
@@ -40,5 +40,5 @@ export declare function getPaymentSmartTitle(paymentType: string): {
40
40
  export declare const getQRCodePaymentLink: (grandTotal: number | undefined, payments: IOrderPayment[] | null | undefined) => {
41
41
  qrLink: string;
42
42
  amount: number;
43
- countryAlpha3: COUNTRY_ALPHA_3_ENUM.PAK | null;
43
+ scanMessage: string;
44
44
  } | null;
@@ -300,14 +300,14 @@ const getQRCodePaymentLink = (grandTotal, payments) => {
300
300
  return null;
301
301
  let qrLink = undefined;
302
302
  let amount = undefined;
303
- let countryAlpha3 = null;
303
+ let scanMessage = 'Scan To Pay';
304
304
  const raastPayment = payments.find((p) => p.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING && p?.payment_type === constants_1.PAYMENT_TYPE_ENUM.RAAST_PAY);
305
305
  if (raastPayment) {
306
306
  const raw = raastPayment?.card_details?.card_number;
307
307
  // Only accept a real QR payload (not the initial placeholder)
308
308
  qrLink = raw != null && raw !== '**** **** **** ****' ? raw : undefined;
309
309
  amount = raastPayment?.amount_due;
310
- countryAlpha3 = constants_1.COUNTRY_ALPHA_3_ENUM.PAK;
310
+ scanMessage = 'Scan with JazzCash, EasyPaisa, or Bank App to Pay';
311
311
  }
312
312
  if (!qrLink || !amount) {
313
313
  return null;
@@ -315,7 +315,7 @@ const getQRCodePaymentLink = (grandTotal, payments) => {
315
315
  return {
316
316
  qrLink,
317
317
  amount: (0, common_1.parseNum)(amount),
318
- countryAlpha3,
318
+ scanMessage,
319
319
  };
320
320
  };
321
321
  exports.getQRCodePaymentLink = getQRCodePaymentLink;
@@ -831,12 +831,7 @@ function receiptEngine(payload, mappedItems = {}) {
831
831
  const qrCodePayment = (0, payment_helpers_1.getQRCodePaymentLink)(grandTotal, payments);
832
832
  if (qrCodePayment != null) {
833
833
  order_link = qrCodePayment.qrLink;
834
- if (qrCodePayment.countryAlpha3 === constants_1.COUNTRY_ALPHA_3_ENUM.PAK) {
835
- custom_message = 'Scan with JazzCash, EasyPaisa, or Bank App to Pay';
836
- }
837
- else {
838
- custom_message = 'Scan To Pay';
839
- }
834
+ custom_message = qrCodePayment.scanMessage;
840
835
  }
841
836
  else if (display_qr_code_on_receipt) {
842
837
  const digitalReceiptLink = business_website != null ? `https://${business_website}/orders/${payload.order._id}` : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.495",
3
+ "version": "0.2.497",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",