geer-builder 1.2.664 → 1.2.666

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.
Files changed (2) hide show
  1. package/GCheckout.vue +57 -22
  2. package/package.json +1 -1
package/GCheckout.vue CHANGED
@@ -671,15 +671,18 @@ export default {
671
671
  },
672
672
  watch:
673
673
  {
674
- async dragon_pay_choice()
674
+ async dragon_pay_choice(value)
675
675
  {
676
- this.gcash_fee = 0;
677
- this.show_gcash_fee = false;
678
- if(this.dragon_pay_choice.shortName == 'GCash' || this.dragon_pay_choice.shortName == 'GCash App')
679
- {
680
- this.show_gcash_fee = true;
681
- this.addGcashFee(this.groupedProducts);
676
+ if (value.remarks) {
677
+ this.$q.dialog({ html: true, title: `Remarks`, message: value.remarks });
682
678
  }
679
+ // this.gcash_fee = 0;
680
+ // this.show_gcash_fee = false;
681
+ // if(this.dragon_pay_choice.shortName == 'GCash' || this.dragon_pay_choice.shortName == 'GCash App')
682
+ // {
683
+ // this.show_gcash_fee = true;
684
+ // this.addGcashFee(this.groupedProducts);
685
+ // }
683
686
  },
684
687
  async payment_method()
685
688
  {
@@ -717,13 +720,19 @@ export default {
717
720
  CEBB: 'https://www.cebuanalhuillier.com/wp-content/uploads/2018/02/CLRB-new-logo.png',
718
721
  DPAY: 'https://load.dragonpay.ph/images/dp-logo.png',
719
722
  DPWL: 'https://load.dragonpay.ph/images/dp-logo.png',
720
- PBCM: 'https://manilastandard.net/wp-content/uploads/2019/07/61b9c_pbcom.png'
723
+ PBCM: 'https://manilastandard.net/wp-content/uploads/2019/07/61b9c_pbcom.png',
724
+ CC: 'https://i.ibb.co/brMvw4b/cc.png',
725
+ 'BillEase Installments': 'https://i.ibb.co/0mRhznG/billease.png'
721
726
  };
722
727
 
723
728
  if (logos[data.procId])
724
729
  {
725
730
  return logos[data.procId];
726
731
  }
732
+ else if (logos[data.longName])
733
+ {
734
+ return logos[data.longName];
735
+ }
727
736
  else if (data.logo)
728
737
  {
729
738
  return data.logo;
@@ -767,26 +776,52 @@ export default {
767
776
  },
768
777
  async getPaymentChannel()
769
778
  {
779
+ const checkMaskCurrentDayAvailable = (mask) => {
780
+ if (mask.length !== 7) return false;
781
+ const today = new Date();
782
+ const currentDayIndex = today.getUTCDay();
783
+ const currentDayAvailability = mask[currentDayIndex];
784
+ return currentDayAvailability === 'X';
785
+ };
786
+
787
+ const isCurrentTimeAvailable = (startTime, endTime) => {
788
+ if (startTime === endTime) return true;
789
+
790
+ const currentTime = new Date();
791
+ const currentHours = currentTime.getHours();
792
+ const currentMinutes = currentTime.getMinutes();
793
+ const currentTimeInMinutes = currentHours * 60 + currentMinutes;
794
+
795
+ const startHours = parseInt(startTime.split(':')[0], 10);
796
+ const startMinutes = parseInt(startTime.split(':')[1], 10);
797
+ const startTimeInMinutes = startHours * 60 + startMinutes;
798
+
799
+ const endHours = parseInt(endTime.split(':')[0], 10);
800
+ const endMinutes = parseInt(endTime.split(':')[1], 10);
801
+ const endTimeInMinutes = endHours * 60 + endMinutes;
802
+
803
+ if (startTimeInMinutes <= endTimeInMinutes) {
804
+ // start time and end time are in the same day
805
+ return currentTimeInMinutes >= startTimeInMinutes && currentTimeInMinutes <= endTimeInMinutes;
806
+ } else {
807
+ // start time is later than end time, so it spans across midnight
808
+ return currentTimeInMinutes >= startTimeInMinutes || currentTimeInMinutes <= endTimeInMinutes;
809
+ }
810
+ };
811
+
770
812
  if(this.public_settings.hasOwnProperty('dragonpay_details') && this.public_settings.dragonpay_details.active)
771
813
  {
772
- // this.filtered_payment_channel = this.public_settings.dragonpay_details.hasOwnProperty('active_payment') ? this.public_settings.dragonpay_details.active_payment : [];
773
814
  try
774
815
  {
775
816
  let ret = await this.$_fbCall('memberGetPaymentChannel', {amount:this.dragon_pay_amount});
776
817
  let return_payment = ret.data;
777
- // console.log(return_payment, 'All Dragonpay channel');
778
- let x = 0;
779
- // let filtered_payment = [];
780
- // for (const element of return_payment)
781
- // {
782
- // if(this.filtered_payment_channel.includes(element.shortName))
783
- // {
784
- // filtered_payment.push(element);
785
- // }
786
- // x++;
787
- // }
788
- // console.log(return_payment);
789
- this.available_payment_channel = return_payment.filter(data => data.status === 'A');
818
+
819
+ this.available_payment_channel = return_payment.filter(data => {
820
+ const isAvailable = data.status === 'A';
821
+ const isTimeAvailable = isCurrentTimeAvailable(data.startTime, data.endTime);
822
+ const isMaskAvailable = checkMaskCurrentDayAvailable(data.dayOfWeek);
823
+ return (isAvailable && isTimeAvailable && isMaskAvailable) || false;
824
+ });
790
825
  }
791
826
  catch (error)
792
827
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.664",
3
+ "version": "1.2.666",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {