IDEMPIERE-462 Ticket #1001503: Credit Cards Online - make the payment processor fields configurable
This commit is contained in:
parent
816f897f06
commit
5f50cd16b6
|
@ -45,7 +45,7 @@ public interface Callout
|
||||||
* @return Error message or ""
|
* @return Error message or ""
|
||||||
*/
|
*/
|
||||||
public String start (Properties ctx, String method, int WindowNo,
|
public String start (Properties ctx, String method, int WindowNo,
|
||||||
GridTab mTab, GridField mField, Object value, Object oldValue);
|
IGridTab mTab, GridField mField, Object value, Object oldValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion Rules.
|
* Conversion Rules.
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class CalloutEngine implements Callout
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
protected CLogger log = CLogger.getCLogger(getClass());
|
protected CLogger log = CLogger.getCLogger(getClass());
|
||||||
private GridTab m_mTab;
|
private IGridTab m_mTab;
|
||||||
private GridField m_mField;
|
private GridField m_mField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +70,7 @@ public class CalloutEngine implements Callout
|
||||||
* @return Error message or ""
|
* @return Error message or ""
|
||||||
*/
|
*/
|
||||||
public String start (Properties ctx, String methodName, int WindowNo,
|
public String start (Properties ctx, String methodName, int WindowNo,
|
||||||
GridTab mTab, GridField mField, Object value, Object oldValue)
|
IGridTab mTab, GridField mField, Object value, Object oldValue)
|
||||||
{
|
{
|
||||||
if (methodName == null || methodName.length() == 0)
|
if (methodName == null || methodName.length() == 0)
|
||||||
throw new IllegalArgumentException ("No Method Name");
|
throw new IllegalArgumentException ("No Method Name");
|
||||||
|
@ -267,7 +267,7 @@ public class CalloutEngine implements Callout
|
||||||
*
|
*
|
||||||
* @return gridTab
|
* @return gridTab
|
||||||
*/
|
*/
|
||||||
public GridTab getGridTab()
|
public IGridTab getGridTab()
|
||||||
{
|
{
|
||||||
return m_mTab;
|
return m_mTab;
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,6 +355,27 @@ public class GridFieldVO implements Serializable
|
||||||
return voT;
|
return voT;
|
||||||
} // createParameter
|
} // createParameter
|
||||||
|
|
||||||
|
public static GridFieldVO createParameter (Properties ctx, int WindowNo,
|
||||||
|
int AD_Column_ID, String ColumnName, String Name, int AD_Reference_ID, int AD_Reference_Value_ID,
|
||||||
|
boolean IsMandatory, boolean IsEncrypted)
|
||||||
|
{
|
||||||
|
GridFieldVO vo = new GridFieldVO (ctx, WindowNo, 0, 0, 0, false);
|
||||||
|
vo.isProcess = true;
|
||||||
|
vo.IsDisplayed = true;
|
||||||
|
vo.IsReadOnly = false;
|
||||||
|
vo.IsUpdateable = true;
|
||||||
|
vo.AD_Table_ID = 0;
|
||||||
|
vo.AD_Column_ID = AD_Column_ID; // **
|
||||||
|
vo.ColumnName = ColumnName;
|
||||||
|
vo.Header = Name;
|
||||||
|
vo.displayType = AD_Reference_ID;
|
||||||
|
vo.AD_Reference_Value_ID = AD_Reference_Value_ID;
|
||||||
|
vo.IsMandatory = IsMandatory;
|
||||||
|
vo.IsEncryptedField= IsEncrypted;
|
||||||
|
//
|
||||||
|
vo.initFinish();
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a standard field (Created/Updated/By)
|
* Make a standard field (Created/Updated/By)
|
||||||
|
|
|
@ -106,7 +106,7 @@ import org.compiere.util.ValueNamePair;
|
||||||
* @author Paul Bowden, phib BF 2900767 Zoom to child tab - inefficient queries
|
* @author Paul Bowden, phib BF 2900767 Zoom to child tab - inefficient queries
|
||||||
* @see https://sourceforge.net/tracker/?func=detail&aid=2900767&group_id=176962&atid=879332
|
* @see https://sourceforge.net/tracker/?func=detail&aid=2900767&group_id=176962&atid=879332
|
||||||
*/
|
*/
|
||||||
public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
public class GridTab implements IGridTab, DataStatusListener, Evaluatee, Serializable
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* Copyright (C) 2012 Elaine Tan *
|
||||||
|
* Copyright (C) 2012 Trek Global
|
||||||
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
* by the Free Software Foundation. This program is distributed in the hope *
|
||||||
|
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* See the GNU General Public License for more details. *
|
||||||
|
* You should have received a copy of the GNU General Public License along *
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||||
|
*****************************************************************************/
|
||||||
|
package org.compiere.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Elaine
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IGridTab {
|
||||||
|
public String setValue(String columnName, Object value);
|
||||||
|
public String setValue(GridField field, Object value);
|
||||||
|
public Object getValue(String columnName);
|
||||||
|
public Object getValue(GridField field);
|
||||||
|
|
||||||
|
public String[] getActiveCallouts();
|
||||||
|
public Callout[] getActiveCalloutInstance();
|
||||||
|
|
||||||
|
public String processCallout(GridField field);
|
||||||
|
}
|
|
@ -117,7 +117,7 @@ public abstract class PaymentProcessor
|
||||||
*/
|
*/
|
||||||
public String validate() throws IllegalArgumentException {
|
public String validate() throws IllegalArgumentException {
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if (p_mp.getCustomerPaymentProfileID() != null)
|
if (p_mp.getC_BP_BankAccount_ID() != 0 || p_mp.getCustomerPaymentProfileID() != null)
|
||||||
return msg;
|
return msg;
|
||||||
if (MPayment.TENDERTYPE_CreditCard.equals(p_mp.getTenderType())) {
|
if (MPayment.TENDERTYPE_CreditCard.equals(p_mp.getTenderType())) {
|
||||||
msg = validateCreditCard();
|
msg = validateCreditCard();
|
||||||
|
|
Loading…
Reference in New Issue