private void paymentClick() throws InterruptedException {

        if(jTable6.getRowCount()<1)
            return;
        
        if (jTable6.getSelectedRow() < 0) {
            JOptionPane.showMessageDialog(this, "Please select NYM", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        String nymID = (String) jTable6.getModel().getValueAt(jTable6.getSelectedRow(), 1);
        String serverID = ((String[]) serverMap.get((Integer) jComboSrvPay.getSelectedIndex()))[1];
        boolean isReg = Payments.checkNym(nymID, serverID);
        if(isReg){
           populatePaymentDetails(serverID, nymID);
        }else{
            int option = JOptionPane.showConfirmDialog(this, "This Nym is not registered on server "+(String)jComboSrvPay.getSelectedItem()+", Do you want to register?", "Confirn Nym registration", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
            if(option == 0){
                int status = new NYM().registerNym(serverID, nymID);
            if (status == 0) {
                System.out.println("Nym registered sucessfully on the server"); 
                populatePaymentDetails(serverID, nymID);
                // Refresh Market NYM list
                MainPage.refreshMarketNym(serverID);
            } else if (status == 1) {
                System.out.println("Nym is already registered on server " + serverID);
                populatePaymentDetails(serverID, nymID);
            } else {
                System.out.println("Cannot register nym on server");
            }
            }else{
                clearPaymentDetails();
            }
        }
        /*Map inbox = Payments.getPaymentInboxData(nymID);
        Map outbox = null;
        if (inbox != null) {
            if (inbox.get("Popup") != null) {
                RegisterNYMDialog registerNYM = new RegisterNYMDialog(this, true, nymID);
                registerNYM.setVisible(true);
                String serverID = registerNYM.getPaymentServerID();
                System.out.println("PaymentClick - after reg nym, serverID:" + serverID);
                if (Utility.VerifyStringVal(serverID)) {
                    inbox = Payments.getPaymentInboxRecords(nymID, serverID);
                }
            } else if (inbox.get("serverList") != null) {
                ServerSelectionDialog selectServer = new ServerSelectionDialog(this, true, (Map) inbox.get("serverList"));
                selectServer.setVisible(true);
                String serverID = selectServer.getPaymentServerID();
                System.out.println("PaymentClick - after selecting server, serverID:" + serverID);
                if (Utility.VerifyStringVal(serverID)) {
                    inbox = Payments.getPaymentInboxRecords(nymID, serverID);
                    outbox = Payments.getPaymentOutboxRecords(nymID, serverID);

                    ((PaymentInboxTableModel) jTable20.getModel()).setValue(inbox, jTable20);
                    ((PaymentOutboxTableModel) jTable21.getModel()).setValue(outbox, jTable21);
                    ((PaymentRecordboxTableModel) jTable22.getModel()).setValue(inbox, jTable22);
                }
            }
        }*/

    }