diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboard-toolbars.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboard-toolbars.js
index be03423e7..ccabbfac0 100644
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboard-toolbars.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboard-toolbars.js
@@ -858,12 +858,57 @@ enyo.kind({
       }
     }
   },
+  prepaymentSelection: function(
+    paymentToolBarComponents,
+    dafaultPaymentCommand
+  ) {
+    var keyboard = this.owner.owner,
+      defaultPaymentComp,
+      defaultPaymentButton;
+
+    //Fetch default payment button if available in toolbar(sometimes default payment will be in more option)
+    defaultPaymentComp = _.find(paymentToolBarComponents, function(
+      toolBarPayment
+    ) {
+      return (
+        toolBarPayment.btn &&
+        toolBarPayment.btn.command === dafaultPaymentCommand
+      );
+    });
+
+    if (defaultPaymentComp) {
+      defaultPaymentButton = defaultPaymentComp.$[dafaultPaymentCommand];
+    }
+
+    OB.UTIL.HookManager.executeHooks(
+      'OBMOBC_PrePaymentSelected',
+      {
+        paymentSelected: defaultPaymentButton,
+        paymentInfo: dafaultPaymentCommand,
+        model: keyboard.model,
+        receipt: keyboard.receipt
+      },
+      function(args) {
+        if (args && args.cancellation && args.cancellation === true) {
+          keyboard.hasActivePayment = false;
+          keyboard.lastStatus = '';
+          keyboard.defaultcommand = '';
+          keyboard.setStatus('');
+          return;
+        }
+        keyboard.defaultcommand = dafaultPaymentCommand;
+        keyboard.setStatus(dafaultPaymentCommand);
+      }
+    );
+  },
   shown: function() {
     var me = this,
       refundablePayment,
       keypad,
       sideButton,
+      paymentCommand,
       keyboard = this.owner.owner,
+      paymentMethodCategory = {},
       isReturnReceipt =
         me.receipt && me.receipt.getPaymentStatus().isNegative ? true : false;
 
@@ -884,30 +929,73 @@ enyo.kind({
         keypad.active = true;
       });
       _.each(OB.MobileApp.model.paymentnames, function(payment) {
+        paymentCommand =
+          payment.providerGroup && payment.providerGroup.id !== '0'
+            ? payment.providerGroup.id
+            : payment.payment.searchKey;
+
         keyboard.disableCommandKey(me, {
           disabled: isReturnReceipt ? !payment.paymentMethod.refundable : false,
-          commands: [payment.payment.searchKey]
+          commands: [paymentCommand]
         });
 
         if (isReturnReceipt) {
           sideButton = _.find(
             OB.OBPOSPointOfSale.UI.PaymentMethods.prototype.sideButtons,
             function(sideBtn) {
-              return sideBtn.btn.command === payment.payment.searchKey;
+              return sideBtn.btn.command === paymentCommand;
             }
           );
           if (sideButton) {
             sideButton.active = payment.paymentMethod.refundable;
           }
           keypad = _.find(keyboard.activekeypads, function(keypad) {
-            return keypad.payment === payment.payment.searchKey;
+            return keypad.payment === paymentCommand;
           });
           if (keypad) {
             keypad.active = payment.paymentMethod.refundable;
           }
         }
+
+        if (payment.paymentMethod.paymentMethodCategory) {
+          paymentMethodCategory[payment.paymentMethod.paymentMethodCategory] =
+            paymentMethodCategory[
+              payment.paymentMethod.paymentMethodCategory
+            ] || [];
+          paymentMethodCategory[
+            payment.paymentMethod.paymentMethodCategory
+          ].push(payment);
+        }
       });
 
+      for (let key in paymentMethodCategory) {
+        let payments = paymentMethodCategory[key],
+          paymentButtonId = 'paymentMethodCategory.showitems.' + key,
+          refundablePayment = _.find(payments, function(payment) {
+            return payment.paymentMethod.refundable;
+          });
+        if (isReturnReceipt && !refundablePayment) {
+          keyboard.disableCommandKey(me, {
+            disabled: true,
+            commands: [paymentButtonId]
+          });
+          sideButton = _.find(
+            OB.OBPOSPointOfSale.UI.PaymentMethods.prototype.sideButtons,
+            function(sideBtn) {
+              return sideBtn.btn.command === paymentButtonId;
+            }
+          );
+          if (sideButton) {
+            sideButton.active = false;
+          }
+        } else {
+          keyboard.disableCommandKey(me, {
+            disabled: false,
+            commands: [paymentButtonId]
+          });
+        }
+      }
+
       keyboard.showKeypad('Coins-' + OB.MobileApp.model.get('currency').id); // shows the Coins/Notes panel for the terminal currency
       keyboard.showSidepad('sidedisabled');
       keyboard.hasActivePayment = true;
@@ -916,8 +1004,12 @@ enyo.kind({
         !isReturnReceipt ||
         (isReturnReceipt && me.defaultPayment.paymentMethod.refundable)
       ) {
-        keyboard.defaultcommand = me.defaultPayment.payment.searchKey;
-        keyboard.setStatus(me.defaultPayment.payment.searchKey);
+        paymentCommand =
+          me.defaultPayment.providerGroup &&
+          me.defaultPayment.providerGroup.id !== '0'
+            ? me.defaultPayment.providerGroup.id
+            : me.defaultPayment.payment.searchKey;
+        me.prepaymentSelection(this.getComponents(), paymentCommand);
       } else {
         refundablePayment = _.find(OB.MobileApp.model.get('payments'), function(
           payment
@@ -925,8 +1017,12 @@ enyo.kind({
           return payment.paymentMethod.refundable;
         });
         if (refundablePayment) {
-          keyboard.defaultcommand = refundablePayment.payment.searchKey;
-          keyboard.setStatus(refundablePayment.payment.searchKey);
+          paymentCommand =
+            refundablePayment.providerGroup &&
+            refundablePayment.providerGroup.id !== '0'
+              ? refundablePayment.providerGroup.id
+              : refundablePayment.payment.searchKey;
+          me.prepaymentSelection(this.getComponents(), paymentCommand);
         } else {
           keyboard.hasActivePayment = false;
           keyboard.lastStatus = '';
