Merge with 60dc60b

This commit is contained in:
Heng Sin Low 2012-11-17 07:53:55 +08:00
commit 30490af91d
31 changed files with 7166 additions and 481 deletions

View File

@ -133,3 +133,6 @@ INSERT INTO AD_ToolBarButton (Action,AD_Tab_ID,SeqNo,AD_Process_ID,AD_ToolBarBut
INSERT INTO AD_ToolBarButton (Action,AD_Tab_ID,SeqNo,AD_Process_ID,AD_ToolBarButton_ID,Updated,IsActive,IsCustomization,Name,AD_Client_ID,AD_ToolBarButton_UU,ComponentName,Created,CreatedBy,UpdatedBy,AD_Org_ID) VALUES ('W',692,10,200016,200072,TO_DATE('2012-11-12 18:37:49','YYYY-MM-DD HH24:MI:SS'),'Y','N','Reverse PO Matching',0,'99e7e98d-a600-4174-9b55-923b790d03ba','ReverseMatchPO',TO_DATE('2012-11-12 18:37:49','YYYY-MM-DD HH24:MI:SS'),100,100,0)
;
SELECT register_migration_script('201211140148_IDEMPIERE-378.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-457 - hide tab editor for inactive tabs
UPDATE AD_ToolBarButton SET DisplayLogic='@IsSortTab@=N & @IsActive@=Y ',Updated=TO_DATE('2012-11-07 14:29:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200068
;
SELECT register_migration_script('201211141558_IDEMPIERE-457.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
-- Nov 16, 2012 5:26:48 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Ref_List.Value NOT IN (''A'', ''F'')',200012,'D','TrxType - No Authorization','S','f7ec6296-14f2-4162-8cf1-ba5912a8d6e4',100,100,TO_DATE('2012-11-16 17:26:47','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-11-16 17:26:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',0)
;
-- Nov 16, 2012 5:27:08 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
UPDATE AD_Val_Rule SET Name='TrxType - No Authorizations',Updated=TO_DATE('2012-11-16 17:27:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200012
;
-- Nov 16, 2012 5:27:16 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
UPDATE AD_Column SET AD_Val_Rule_ID=200012,Updated=TO_DATE('2012-11-16 17:27:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5044
;
SELECT register_migration_script('201211161731_IDEMPIERE-462.sql') FROM dual
;

View File

@ -133,3 +133,6 @@ INSERT INTO AD_ToolBarButton ("action",AD_Tab_ID,SeqNo,AD_Process_ID,AD_ToolBarB
INSERT INTO AD_ToolBarButton ("action",AD_Tab_ID,SeqNo,AD_Process_ID,AD_ToolBarButton_ID,Updated,IsActive,IsCustomization,Name,AD_Client_ID,AD_ToolBarButton_UU,ComponentName,Created,CreatedBy,UpdatedBy,AD_Org_ID) VALUES ('W',692,10,200016,200072,TO_TIMESTAMP('2012-11-12 18:37:49','YYYY-MM-DD HH24:MI:SS'),'Y','N','Reverse PO Matching',0,'99e7e98d-a600-4174-9b55-923b790d03ba','ReverseMatchPO',TO_TIMESTAMP('2012-11-12 18:37:49','YYYY-MM-DD HH24:MI:SS'),100,100,0)
;
SELECT register_migration_script('201211140148_IDEMPIERE-378.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-457 - hide tab editor for inactive tabs
UPDATE AD_ToolBarButton SET DisplayLogic='@IsSortTab@=N & @IsActive@=Y ',Updated=TO_TIMESTAMP('2012-11-07 14:29:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200068
;
SELECT register_migration_script('201211141558_IDEMPIERE-457.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
-- Nov 16, 2012 5:26:48 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Ref_List.Value NOT IN (''A'', ''F'')',200012,'D','TrxType - No Authorization','S','f7ec6296-14f2-4162-8cf1-ba5912a8d6e4',100,100,TO_TIMESTAMP('2012-11-16 17:26:47','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-11-16 17:26:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',0)
;
-- Nov 16, 2012 5:27:08 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
UPDATE AD_Val_Rule SET Name='TrxType - No Authorizations',Updated=TO_TIMESTAMP('2012-11-16 17:27:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200012
;
-- Nov 16, 2012 5:27:16 PM SGT
-- IDEMPIERE-462 Ticket #1001503: Credit Cards Online
UPDATE AD_Column SET AD_Val_Rule_ID=200012,Updated=TO_TIMESTAMP('2012-11-16 17:27:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5044
;
SELECT register_migration_script('201211161731_IDEMPIERE-462.sql') FROM dual
;

View File

@ -0,0 +1,57 @@
package org.compiere.model;
import java.util.Properties;
import org.compiere.util.Env;
/**
*
* @author Elaine
*
*/
public class CalloutBankAcctProcessor extends CalloutEngine
{
/**
* Payment Processor Changed
* @param ctx
* @param WindowNo
* @param mTab
* @param mField
* @param value
* @return null or error message
*/
public String paymentProcessor(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
Integer C_PaymentProcessor_ID = (Integer)value;
if (C_PaymentProcessor_ID == null || C_PaymentProcessor_ID.intValue() == 0)
return "";
MPaymentProcessor pp = new MPaymentProcessor(ctx, C_PaymentProcessor_ID, null);
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptMC, pp.isAcceptMC());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptVisa, pp.isAcceptVisa());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptAMEX, pp.isAcceptAMEX());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptDiners, pp.isAcceptDiners());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptCorporate, pp.isAcceptCorporate());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptDiscover, pp.isAcceptDiscover());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptDirectDeposit, pp.isAcceptDirectDeposit());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptDirectDebit, pp.isAcceptDirectDebit());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptCheck, pp.isAcceptCheck());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_AcceptATM, pp.isAcceptATM());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_MinimumAmt, pp.getMinimumAmt());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_C_Currency_ID, pp.getC_Currency_ID());
mTab.setValue(MBankAccountProcessor.COLUMNNAME_RequireVV, pp.isRequireVV());
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptMC, pp.isAcceptMC() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptVisa, pp.isAcceptVisa() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptAMEX, pp.isAcceptAMEX() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptDiners, pp.isAcceptDiners() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptCorporate, pp.isAcceptCorporate() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptDiscover, pp.isAcceptDiscover() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptDirectDeposit, pp.isAcceptDirectDeposit() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptDirectDebit, pp.isAcceptDirectDebit() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptCheck, pp.isAcceptCheck() ? "Y" : "N");
Env.setContext(ctx, WindowNo, mTab.getTabNo(), MBankAccountProcessor.COLUMNNAME_IsPPAcceptATM, pp.isAcceptATM() ? "Y" : "N");
return null;
}
}

View File

@ -24,6 +24,7 @@ import java.net.URL;
import java.util.List;
import java.util.logging.Level;
import org.compiere.model.MBankAccountProcessor;
import org.compiere.model.MPaymentProcessor;
import org.compiere.model.ModelValidator;
import org.compiere.model.PaymentInterface;
@ -94,17 +95,18 @@ public class Core {
/**
* Get payment processor instance
* @param mpp payment processor model
* @param mbap payment processor model
* @param mp payment model
* @return initialized PaymentProcessor or null
*/
public static PaymentProcessor getPaymentProcessor(MPaymentProcessor mpp, PaymentInterface mp) {
public static PaymentProcessor getPaymentProcessor(MBankAccountProcessor mbap, PaymentInterface mp) {
if (s_log.isLoggable(Level.FINE))
s_log.fine("create for " + mpp);
s_log.fine("create for " + mbap);
MPaymentProcessor mpp = new MPaymentProcessor(mbap.getCtx(), mbap.getC_PaymentProcessor_ID(), mbap.get_TrxName());
String className = mpp.getPayProcessorClass();
if (className == null || className.length() == 0) {
s_log.log(Level.SEVERE, "No PaymentProcessor class name in " + mpp);
s_log.log(Level.SEVERE, "No PaymentProcessor class name in " + mbap);
return null;
}
//
@ -130,7 +132,7 @@ public class Core {
}
// Initialize
myProcessor.initialize(mpp, mp);
myProcessor.initialize(mbap, mp);
//
return myProcessor;
}

View File

@ -45,7 +45,7 @@ public interface Callout
* @return Error message or ""
*/
public String start (Properties ctx, String method, int WindowNo,
IGridTab mTab, GridField mField, Object value, Object oldValue);
GridTab mTab, GridField mField, Object value, Object oldValue);
/**
* Conversion Rules.

View File

@ -49,7 +49,7 @@ public class CalloutEngine implements Callout
/** Logger */
protected CLogger log = CLogger.getCLogger(getClass());
private IGridTab m_mTab;
private GridTab m_mTab;
private GridField m_mField;
/**
@ -70,7 +70,7 @@ public class CalloutEngine implements Callout
* @return Error message or ""
*/
public String start (Properties ctx, String methodName, int WindowNo,
IGridTab mTab, GridField mField, Object value, Object oldValue)
GridTab mTab, GridField mField, Object value, Object oldValue)
{
if (methodName == null || methodName.length() == 0)
throw new IllegalArgumentException ("No Method Name");
@ -267,7 +267,7 @@ public class CalloutEngine implements Callout
*
* @return gridTab
*/
public IGridTab getGridTab()
public GridTab getGridTab()
{
return m_mTab;
}

View File

@ -106,7 +106,7 @@ import org.compiere.util.ValueNamePair;
* @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
*/
public class GridTab implements IGridTab, DataStatusListener, Evaluatee, Serializable
public class GridTab implements DataStatusListener, Evaluatee, Serializable
{

View File

@ -1,31 +0,0 @@
/******************************************************************************
* 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);
}

View File

@ -41,6 +41,136 @@ public interface I_C_BankAccount_Processor
/** Load Meta Data */
/** Column name AcceptAMEX */
public static final String COLUMNNAME_AcceptAMEX = "AcceptAMEX";
/** Set Accept AMEX.
* Accept American Express Card
*/
public void setAcceptAMEX (boolean AcceptAMEX);
/** Get Accept AMEX.
* Accept American Express Card
*/
public boolean isAcceptAMEX();
/** Column name AcceptATM */
public static final String COLUMNNAME_AcceptATM = "AcceptATM";
/** Set Accept ATM.
* Accept Bank ATM Card
*/
public void setAcceptATM (boolean AcceptATM);
/** Get Accept ATM.
* Accept Bank ATM Card
*/
public boolean isAcceptATM();
/** Column name AcceptCheck */
public static final String COLUMNNAME_AcceptCheck = "AcceptCheck";
/** Set Accept Electronic Check.
* Accept ECheck (Electronic Checks)
*/
public void setAcceptCheck (boolean AcceptCheck);
/** Get Accept Electronic Check.
* Accept ECheck (Electronic Checks)
*/
public boolean isAcceptCheck();
/** Column name AcceptCorporate */
public static final String COLUMNNAME_AcceptCorporate = "AcceptCorporate";
/** Set Accept Corporate.
* Accept Corporate Purchase Cards
*/
public void setAcceptCorporate (boolean AcceptCorporate);
/** Get Accept Corporate.
* Accept Corporate Purchase Cards
*/
public boolean isAcceptCorporate();
/** Column name AcceptDiners */
public static final String COLUMNNAME_AcceptDiners = "AcceptDiners";
/** Set Accept Diners.
* Accept Diner's Club
*/
public void setAcceptDiners (boolean AcceptDiners);
/** Get Accept Diners.
* Accept Diner's Club
*/
public boolean isAcceptDiners();
/** Column name AcceptDirectDebit */
public static final String COLUMNNAME_AcceptDirectDebit = "AcceptDirectDebit";
/** Set Accept Direct Debit.
* Accept Direct Debits (vendor initiated)
*/
public void setAcceptDirectDebit (boolean AcceptDirectDebit);
/** Get Accept Direct Debit.
* Accept Direct Debits (vendor initiated)
*/
public boolean isAcceptDirectDebit();
/** Column name AcceptDirectDeposit */
public static final String COLUMNNAME_AcceptDirectDeposit = "AcceptDirectDeposit";
/** Set Accept Direct Deposit.
* Accept Direct Deposit (payee initiated)
*/
public void setAcceptDirectDeposit (boolean AcceptDirectDeposit);
/** Get Accept Direct Deposit.
* Accept Direct Deposit (payee initiated)
*/
public boolean isAcceptDirectDeposit();
/** Column name AcceptDiscover */
public static final String COLUMNNAME_AcceptDiscover = "AcceptDiscover";
/** Set Accept Discover.
* Accept Discover Card
*/
public void setAcceptDiscover (boolean AcceptDiscover);
/** Get Accept Discover.
* Accept Discover Card
*/
public boolean isAcceptDiscover();
/** Column name AcceptMC */
public static final String COLUMNNAME_AcceptMC = "AcceptMC";
/** Set Accept MasterCard.
* Accept Master Card
*/
public void setAcceptMC (boolean AcceptMC);
/** Get Accept MasterCard.
* Accept Master Card
*/
public boolean isAcceptMC();
/** Column name AcceptVisa */
public static final String COLUMNNAME_AcceptVisa = "AcceptVisa";
/** Set Accept Visa.
* Accept Visa Cards
*/
public void setAcceptVisa (boolean AcceptVisa);
/** Get Accept Visa.
* Accept Visa Cards
*/
public boolean isAcceptVisa();
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
@ -86,6 +216,21 @@ public interface I_C_BankAccount_Processor
/** Get C_BankAccount_Processor_UU */
public String getC_BankAccount_Processor_UU();
/** Column name C_Currency_ID */
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
/** Set Currency.
* The Currency for this record
*/
public void setC_Currency_ID (int C_Currency_ID);
/** Get Currency.
* The Currency for this record
*/
public int getC_Currency_ID();
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_PaymentProcessor_ID */
public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID";
@ -130,6 +275,148 @@ public interface I_C_BankAccount_Processor
*/
public boolean isActive();
/** Column name IsPPAcceptAMEX */
public static final String COLUMNNAME_IsPPAcceptAMEX = "IsPPAcceptAMEX";
/** Set Accept AMEX */
public void setIsPPAcceptAMEX (boolean IsPPAcceptAMEX);
/** Get Accept AMEX */
public boolean isPPAcceptAMEX();
/** Column name IsPPAcceptATM */
public static final String COLUMNNAME_IsPPAcceptATM = "IsPPAcceptATM";
/** Set Accept ATM */
public void setIsPPAcceptATM (boolean IsPPAcceptATM);
/** Get Accept ATM */
public boolean isPPAcceptATM();
/** Column name IsPPAcceptCheck */
public static final String COLUMNNAME_IsPPAcceptCheck = "IsPPAcceptCheck";
/** Set Accept Check */
public void setIsPPAcceptCheck (boolean IsPPAcceptCheck);
/** Get Accept Check */
public boolean isPPAcceptCheck();
/** Column name IsPPAcceptCorporate */
public static final String COLUMNNAME_IsPPAcceptCorporate = "IsPPAcceptCorporate";
/** Set Accept Corporate */
public void setIsPPAcceptCorporate (boolean IsPPAcceptCorporate);
/** Get Accept Corporate */
public boolean isPPAcceptCorporate();
/** Column name IsPPAcceptDiners */
public static final String COLUMNNAME_IsPPAcceptDiners = "IsPPAcceptDiners";
/** Set Accept Diners */
public void setIsPPAcceptDiners (boolean IsPPAcceptDiners);
/** Get Accept Diners */
public boolean isPPAcceptDiners();
/** Column name IsPPAcceptDirectDebit */
public static final String COLUMNNAME_IsPPAcceptDirectDebit = "IsPPAcceptDirectDebit";
/** Set Accept Direct Debit */
public void setIsPPAcceptDirectDebit (boolean IsPPAcceptDirectDebit);
/** Get Accept Direct Debit */
public boolean isPPAcceptDirectDebit();
/** Column name IsPPAcceptDirectDeposit */
public static final String COLUMNNAME_IsPPAcceptDirectDeposit = "IsPPAcceptDirectDeposit";
/** Set Accept Direct Deposit */
public void setIsPPAcceptDirectDeposit (boolean IsPPAcceptDirectDeposit);
/** Get Accept Direct Deposit */
public boolean isPPAcceptDirectDeposit();
/** Column name IsPPAcceptDiscover */
public static final String COLUMNNAME_IsPPAcceptDiscover = "IsPPAcceptDiscover";
/** Set Accept Discover */
public void setIsPPAcceptDiscover (boolean IsPPAcceptDiscover);
/** Get Accept Discover */
public boolean isPPAcceptDiscover();
/** Column name IsPPAcceptMC */
public static final String COLUMNNAME_IsPPAcceptMC = "IsPPAcceptMC";
/** Set Accept MasterCard */
public void setIsPPAcceptMC (boolean IsPPAcceptMC);
/** Get Accept MasterCard */
public boolean isPPAcceptMC();
/** Column name IsPPAcceptVisa */
public static final String COLUMNNAME_IsPPAcceptVisa = "IsPPAcceptVisa";
/** Set Accept Visa */
public void setIsPPAcceptVisa (boolean IsPPAcceptVisa);
/** Get Accept Visa */
public boolean isPPAcceptVisa();
/** Column name MinimumAmt */
public static final String COLUMNNAME_MinimumAmt = "MinimumAmt";
/** Set Minimum Amt.
* Minimum Amount in Document Currency
*/
public void setMinimumAmt (BigDecimal MinimumAmt);
/** Get Minimum Amt.
* Minimum Amount in Document Currency
*/
public BigDecimal getMinimumAmt();
/** Column name PartnerID */
public static final String COLUMNNAME_PartnerID = "PartnerID";
/** Set Partner ID.
* Partner ID or Account for the Payment Processor
*/
public void setPartnerID (String PartnerID);
/** Get Partner ID.
* Partner ID or Account for the Payment Processor
*/
public String getPartnerID();
/** Column name Password */
public static final String COLUMNNAME_Password = "Password";
/** Set Password.
* Password of any length (case sensitive)
*/
public void setPassword (String Password);
/** Get Password.
* Password of any length (case sensitive)
*/
public String getPassword();
/** Column name RequireVV */
public static final String COLUMNNAME_RequireVV = "RequireVV";
/** Set Require CreditCard Verification Code.
* Require 3/4 digit Credit Verification Code
*/
public void setRequireVV (boolean RequireVV);
/** Get Require CreditCard Verification Code.
* Require 3/4 digit Credit Verification Code
*/
public boolean isRequireVV();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
@ -145,4 +432,30 @@ public interface I_C_BankAccount_Processor
* User who updated this records
*/
public int getUpdatedBy();
/** Column name UserID */
public static final String COLUMNNAME_UserID = "UserID";
/** Set User ID.
* User ID or account number
*/
public void setUserID (String UserID);
/** Get User ID.
* User ID or account number
*/
public String getUserID();
/** Column name VendorID */
public static final String COLUMNNAME_VendorID = "VendorID";
/** Set Vendor ID.
* Vendor ID for the Payment Processor
*/
public void setVendorID (String VendorID);
/** Get Vendor ID.
* Vendor ID for the Payment Processor
*/
public String getVendorID();
}

View File

@ -237,6 +237,28 @@ public interface I_C_PaymentProcessor
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_PaymentProcessor_ID */
public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID";
/** Set Payment Processor.
* Payment processor for electronic payments
*/
public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID);
/** Get Payment Processor.
* Payment processor for electronic payments
*/
public int getC_PaymentProcessor_ID();
/** Column name C_PaymentProcessor_UU */
public static final String COLUMNNAME_C_PaymentProcessor_UU = "C_PaymentProcessor_UU";
/** Set C_PaymentProcessor_UU */
public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU);
/** Get C_PaymentProcessor_UU */
public String getC_PaymentProcessor_UU();
/** Column name Commission */
public static final String COLUMNNAME_Commission = "Commission";
@ -263,28 +285,6 @@ public interface I_C_PaymentProcessor
*/
public BigDecimal getCostPerTrx();
/** Column name C_PaymentProcessor_ID */
public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID";
/** Set Payment Processor.
* Payment processor for electronic payments
*/
public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID);
/** Get Payment Processor.
* Payment processor for electronic payments
*/
public int getC_PaymentProcessor_ID();
/** Column name C_PaymentProcessor_UU */
public static final String COLUMNNAME_C_PaymentProcessor_UU = "C_PaymentProcessor_UU";
/** Set C_PaymentProcessor_UU */
public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU);
/** Get C_PaymentProcessor_UU */
public String getC_PaymentProcessor_UU();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
@ -379,32 +379,6 @@ public interface I_C_PaymentProcessor
*/
public String getName();
/** Column name PartnerID */
public static final String COLUMNNAME_PartnerID = "PartnerID";
/** Set Partner ID.
* Partner ID or Account for the Payment Processor
*/
public void setPartnerID (String PartnerID);
/** Get Partner ID.
* Partner ID or Account for the Payment Processor
*/
public String getPartnerID();
/** Column name Password */
public static final String COLUMNNAME_Password = "Password";
/** Set Password.
* Password of any length (case sensitive)
*/
public void setPassword (String Password);
/** Get Password.
* Password of any length (case sensitive)
*/
public String getPassword();
/** Column name PayProcessorClass */
public static final String COLUMNNAME_PayProcessorClass = "PayProcessorClass";
@ -511,30 +485,4 @@ public interface I_C_PaymentProcessor
* User who updated this records
*/
public int getUpdatedBy();
/** Column name UserID */
public static final String COLUMNNAME_UserID = "UserID";
/** Set User ID.
* User ID or account number
*/
public void setUserID (String UserID);
/** Get User ID.
* User ID or account number
*/
public String getUserID();
/** Column name VendorID */
public static final String COLUMNNAME_VendorID = "VendorID";
/** Set Vendor ID.
* Vendor ID for the Payment Processor
*/
public void setVendorID (String VendorID);
/** Get Vendor ID.
* Vendor ID for the Payment Processor
*/
public String getVendorID();
}

View File

@ -14,8 +14,16 @@
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
/**
* Bank Account Payment Processor
@ -29,6 +37,92 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor {
*/
private static final long serialVersionUID = -9082774421123292838L;
/** Static Logger */
private static CLogger s_log = CLogger.getCLogger (MBankAccountProcessor.class);
public static MBankAccountProcessor[] find (Properties ctx,
String tender, String CCType,
int AD_Client_ID, int AD_Org_ID, int C_Currency_ID, BigDecimal Amt, String trxName)
{
return find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Amt, trxName);
}
/**
* Get Bank Account Processor
* @param ctx context
* @param tender optional Tender see TENDER_
* @param CCType optional CC Type see CC_
* @param AD_Client_ID Client
* @param C_Currency_ID Currency (ignored)
* @param Amt Amount (ignored)
* @param trxName transaction
* @return Array of BankAccount[0] & PaymentProcessor[1] or null
*/
public static MBankAccountProcessor[] find (Properties ctx,
String tender, String CCType,
int AD_Client_ID, int C_Currency_ID, BigDecimal Amt, String trxName)
{
ArrayList<MBankAccountProcessor> list = new ArrayList<MBankAccountProcessor>();
StringBuffer sql = new StringBuffer("SELECT bap.* "
+ "FROM C_BankAccount_Processor bap, C_PaymentProcessor pp, C_BankAccount ba "
+ "WHERE pp.C_PaymentProcessor_ID = bap.C_PaymentProcessor_ID"
+ " AND ba.C_BankAccount_ID = bap.C_BankAccount_ID"
+ " AND ba.AD_Client_ID=? AND pp.IsActive='Y'" // #1
+ " AND ba.IsActive='Y' AND bap.IsActive='Y' "
+ " AND (bap.C_Currency_ID IS NULL OR bap.C_Currency_ID=?)" // #2
+ " AND (bap.MinimumAmt IS NULL OR bap.MinimumAmt = 0 OR bap.MinimumAmt <= ?)"); // #3
if (MPayment.TENDERTYPE_DirectDeposit.equals(tender))
sql.append(" AND bap.AcceptDirectDeposit='Y'");
else if (MPayment.TENDERTYPE_DirectDebit.equals(tender))
sql.append(" AND bap.AcceptDirectDebit='Y'");
else if (MPayment.TENDERTYPE_Check.equals(tender))
sql.append(" AND bap.AcceptCheck='Y'");
// CreditCards
else if (MPayment.CREDITCARDTYPE_ATM.equals(CCType))
sql.append(" AND bap.AcceptATM='Y'");
else if (MPayment.CREDITCARDTYPE_Amex.equals(CCType))
sql.append(" AND bap.AcceptAMEX='Y'");
else if (MPayment.CREDITCARDTYPE_Visa.equals(CCType))
sql.append(" AND bap.AcceptVISA='Y'");
else if (MPayment.CREDITCARDTYPE_MasterCard.equals(CCType))
sql.append(" AND bap.AcceptMC='Y'");
else if (MPayment.CREDITCARDTYPE_Diners.equals(CCType))
sql.append(" AND bap.AcceptDiners='Y'");
else if (MPayment.CREDITCARDTYPE_Discover.equals(CCType))
sql.append(" AND bap.AcceptDiscover='Y'");
else if (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CCType))
sql.append(" AND bap.AcceptCORPORATE='Y'");
sql.append(" ORDER BY ba.IsDefault DESC ");
//
try
{
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), trxName);
pstmt.setInt(1, AD_Client_ID);
pstmt.setInt(2, C_Currency_ID);
pstmt.setBigDecimal(3, Amt);
ResultSet rs = pstmt.executeQuery();
while (rs.next())
list.add(new MBankAccountProcessor (ctx, rs, trxName));
rs.close();
pstmt.close();
}
catch (SQLException e)
{
s_log.log(Level.SEVERE, "find - " + sql, e);
return null;
}
//
if (list.size() == 0)
s_log.warning("find - not found - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
else
s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
MBankAccountProcessor[] retValue = new MBankAccountProcessor[list.size()];
list.toArray(retValue);
return retValue;
} // find
public static MBankAccountProcessor get(Properties ctx, int C_BankAccount_ID, int C_PaymentProcessor_ID, String trxName)
{
final String whereClause = MBankAccountProcessor.COLUMNNAME_C_BankAccount_ID + "=? AND " + MBankAccountProcessor.COLUMNNAME_C_PaymentProcessor_ID + "=?";
@ -57,6 +151,29 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor {
setC_PaymentProcessor_ID(C_PaymentProcessor_ID); // FK
}
/**
* Does Payment Processor accepts tender / CC
* @param TenderType tender type
* @param CreditCardType credit card type
* @return true if acceptes
*/
public boolean accepts (String TenderType, String CreditCardType)
{
if ((MPayment.TENDERTYPE_DirectDeposit.equals(TenderType) && isAcceptDirectDeposit())
|| (MPayment.TENDERTYPE_DirectDebit.equals(TenderType) && isAcceptDirectDebit())
|| (MPayment.TENDERTYPE_Check.equals(TenderType) && isAcceptCheck())
//
|| (MPayment.CREDITCARDTYPE_ATM.equals(CreditCardType) && isAcceptATM())
|| (MPayment.CREDITCARDTYPE_Amex.equals(CreditCardType) && isAcceptAMEX())
|| (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CreditCardType) && isAcceptCorporate())
|| (MPayment.CREDITCARDTYPE_Diners.equals(CreditCardType) && isAcceptDiners())
|| (MPayment.CREDITCARDTYPE_Discover.equals(CreditCardType) && isAcceptDiscover())
|| (MPayment.CREDITCARDTYPE_MasterCard.equals(CreditCardType) && isAcceptMC())
|| (MPayment.CREDITCARDTYPE_Visa.equals(CreditCardType) && isAcceptVisa()))
return true;
return false;
} // accepts
public String toString()
{
StringBuilder sb = new StringBuilder("MBankAccountProcessor[")
@ -65,4 +182,40 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor {
.append("]");
return sb.toString ();
}
public String getHostAddress()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getHostAddress();
}
public int getHostPort()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getHostPort();
}
public String getProxyAddress()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getProxyAddress();
}
public int getProxyPort()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getProxyPort();
}
public String getProxyLogon()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getProxyLogon();
}
public String getProxyPassword()
{
MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName());
return pp.getProxyPassword();
}
}

View File

@ -500,8 +500,7 @@ public final class MPayment extends X_C_Payment
try
{
MPaymentProcessor paymentProcessor = new MPaymentProcessor(m_mBankAccountProcessor.getCtx(), m_mBankAccountProcessor.getC_PaymentProcessor_ID(), m_mBankAccountProcessor.get_TrxName());
PaymentProcessor pp = PaymentProcessor.create(paymentProcessor, this);
PaymentProcessor pp = PaymentProcessor.create(m_mBankAccountProcessor, this);
if (pp == null)
setErrorMessage(Msg.getMsg(Env.getCtx(), "PaymentNoProcessor"));
else
@ -897,11 +896,11 @@ public final class MPayment extends X_C_Payment
m_mBankAccountProcessor = null;
// Get Processor List
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(),
m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx(), tender, CCType, getAD_Client_ID(),
getC_Currency_ID(), getPayAmt(), get_TrxName());
// Relax Amount
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(),
m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx(), tender, CCType, getAD_Client_ID(),
getC_Currency_ID(), Env.ZERO, get_TrxName());
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
return false;
@ -910,8 +909,7 @@ public final class MPayment extends X_C_Payment
for (int i = 0; i < m_mBankAccountProcessors.length; i++)
{
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccountProcessor.getCtx(), bankAccountProcessor.getC_PaymentProcessor_ID(), bankAccountProcessor.get_TrxName());
if (paymentProcessor.accepts (tender, CCType))
if (bankAccountProcessor.accepts(tender, CCType))
{
m_mBankAccountProcessor = m_mBankAccountProcessors[i];
break;
@ -947,25 +945,24 @@ public final class MPayment extends X_C_Payment
try
{
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find (getCtx (), null, null,
m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx (), null, null,
getAD_Client_ID (), getC_Currency_ID (), amt, get_TrxName());
//
HashMap<String,ValueNamePair> map = new HashMap<String,ValueNamePair>(); // to eliminate duplicates
for (int i = 0; i < m_mBankAccountProcessors.length; i++)
{
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccountProcessor.getCtx(), bankAccountProcessor.getC_PaymentProcessor_ID(), bankAccountProcessor.get_TrxName());
if (paymentProcessor.isAcceptAMEX ())
if (bankAccountProcessor.isAcceptAMEX())
map.put (CREDITCARDTYPE_Amex, getCreditCardPair (CREDITCARDTYPE_Amex));
if (paymentProcessor.isAcceptDiners ())
if (bankAccountProcessor.isAcceptDiners())
map.put (CREDITCARDTYPE_Diners, getCreditCardPair (CREDITCARDTYPE_Diners));
if (paymentProcessor.isAcceptDiscover ())
if (bankAccountProcessor.isAcceptDiscover())
map.put (CREDITCARDTYPE_Discover, getCreditCardPair (CREDITCARDTYPE_Discover));
if (paymentProcessor.isAcceptMC ())
if (bankAccountProcessor.isAcceptMC())
map.put (CREDITCARDTYPE_MasterCard, getCreditCardPair (CREDITCARDTYPE_MasterCard));
if (paymentProcessor.isAcceptCorporate ())
if (bankAccountProcessor.isAcceptCorporate())
map.put (CREDITCARDTYPE_PurchaseCard, getCreditCardPair (CREDITCARDTYPE_PurchaseCard));
if (paymentProcessor.isAcceptVisa ())
if (bankAccountProcessor.isAcceptVisa())
map.put (CREDITCARDTYPE_Visa, getCreditCardPair (CREDITCARDTYPE_Visa));
} // for all payment processors
//

View File

@ -16,16 +16,9 @@
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -41,95 +34,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor
*
*/
private static final long serialVersionUID = 8514876566904723695L;
public static MBankAccountProcessor[] find (Properties ctx,
String tender, String CCType,
int AD_Client_ID, int AD_Org_ID, int C_Currency_ID, BigDecimal Amt, String trxName)
{
return find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Amt, trxName);
}
/**
* Get Bank Account Processor
* @param ctx context
* @param tender optional Tender see TENDER_
* @param CCType optional CC Type see CC_
* @param AD_Client_ID Client
* @param C_Currency_ID Currency (ignored)
* @param Amt Amount (ignored)
* @param trxName transaction
* @return Array of BankAccount[0] & PaymentProcessor[1] or null
*/
public static MBankAccountProcessor[] find (Properties ctx,
String tender, String CCType,
int AD_Client_ID, int C_Currency_ID, BigDecimal Amt, String trxName)
{
ArrayList<MBankAccountProcessor> list = new ArrayList<MBankAccountProcessor>();
StringBuffer sql = new StringBuffer("SELECT bap.* "
+ "FROM C_BankAccount_Processor bap, C_PaymentProcessor pp, C_BankAccount ba "
+ "WHERE pp.C_PaymentProcessor_ID = bap.C_PaymentProcessor_ID"
+ " AND ba.C_BankAccount_ID = bap.C_BankAccount_ID"
+ " AND ba.AD_Client_ID=? AND pp.IsActive='Y'" // #1
+ " AND ba.IsActive='Y' AND bap.IsActive='Y' "
+ " AND (pp.C_Currency_ID IS NULL OR pp.C_Currency_ID=?)" // #2
+ " AND (pp.MinimumAmt IS NULL OR pp.MinimumAmt = 0 OR pp.MinimumAmt <= ?)"); // #3
if (MPayment.TENDERTYPE_DirectDeposit.equals(tender))
sql.append(" AND pp.AcceptDirectDeposit='Y'");
else if (MPayment.TENDERTYPE_DirectDebit.equals(tender))
sql.append(" AND pp.AcceptDirectDebit='Y'");
else if (MPayment.TENDERTYPE_Check.equals(tender))
sql.append(" AND pp.AcceptCheck='Y'");
// CreditCards
else if (MPayment.CREDITCARDTYPE_ATM.equals(CCType))
sql.append(" AND pp.AcceptATM='Y'");
else if (MPayment.CREDITCARDTYPE_Amex.equals(CCType))
sql.append(" AND pp.AcceptAMEX='Y'");
else if (MPayment.CREDITCARDTYPE_Visa.equals(CCType))
sql.append(" AND pp.AcceptVISA='Y'");
else if (MPayment.CREDITCARDTYPE_MasterCard.equals(CCType))
sql.append(" AND pp.AcceptMC='Y'");
else if (MPayment.CREDITCARDTYPE_Diners.equals(CCType))
sql.append(" AND pp.AcceptDiners='Y'");
else if (MPayment.CREDITCARDTYPE_Discover.equals(CCType))
sql.append(" AND pp.AcceptDiscover='Y'");
else if (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CCType))
sql.append(" AND pp.AcceptCORPORATE='Y'");
sql.append(" ORDER BY ba.IsDefault DESC ");
//
try
{
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), trxName);
pstmt.setInt(1, AD_Client_ID);
pstmt.setInt(2, C_Currency_ID);
pstmt.setBigDecimal(3, Amt);
ResultSet rs = pstmt.executeQuery();
while (rs.next())
list.add(new MBankAccountProcessor (ctx, rs, trxName));
rs.close();
pstmt.close();
}
catch (SQLException e)
{
s_log.log(Level.SEVERE, "find - " + sql, e);
return null;
}
//
if (list.size() == 0)
s_log.warning("find - not found - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
else
s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
MBankAccountProcessor[] retValue = new MBankAccountProcessor[list.size()];
list.toArray(retValue);
return retValue;
} // find
/** Static Logger */
private static CLogger s_log = CLogger.getCLogger (MPaymentProcessor.class);
/**************************************************************************
* Payment Processor Model
* @param ctx context
@ -186,29 +91,6 @@ public class MPaymentProcessor extends X_C_PaymentProcessor
return sb.toString ();
} // toString
/**
* Does Payment Processor accepts tender / CC
* @param TenderType tender type
* @param CreditCardType credit card type
* @return true if acceptes
*/
public boolean accepts (String TenderType, String CreditCardType)
{
if ((MPayment.TENDERTYPE_DirectDeposit.equals(TenderType) && isAcceptDirectDeposit())
|| (MPayment.TENDERTYPE_DirectDebit.equals(TenderType) && isAcceptDirectDebit())
|| (MPayment.TENDERTYPE_Check.equals(TenderType) && isAcceptCheck())
//
|| (MPayment.CREDITCARDTYPE_ATM.equals(CreditCardType) && isAcceptATM())
|| (MPayment.CREDITCARDTYPE_Amex.equals(CreditCardType) && isAcceptAMEX())
|| (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CreditCardType) && isAcceptCorporate())
|| (MPayment.CREDITCARDTYPE_Diners.equals(CreditCardType) && isAcceptDiners())
|| (MPayment.CREDITCARDTYPE_Discover.equals(CreditCardType) && isAcceptDiscover())
|| (MPayment.CREDITCARDTYPE_MasterCard.equals(CreditCardType) && isAcceptMC())
|| (MPayment.CREDITCARDTYPE_Visa.equals(CreditCardType) && isAcceptVisa()))
return true;
return false;
} // accepts
/**
* @deprecated Use C_BankAccount.C_PaymentProcessor_ID
*/

View File

@ -126,11 +126,11 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
m_mBankAccountProcessor = null;
// Get Processor List
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(),
m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx(), tender, CCType, getAD_Client_ID(),
getC_Currency_ID(), getPayAmt(), get_TrxName());
// Relax Amount
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(),
m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx(), tender, CCType, getAD_Client_ID(),
getC_Currency_ID(), Env.ZERO, get_TrxName());
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
return false;
@ -139,8 +139,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
for (int i = 0; i < m_mBankAccountProcessors.length; i++)
{
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccountProcessor.getCtx(), bankAccountProcessor.getC_PaymentProcessor_ID(), bankAccountProcessor.get_TrxName());
if (paymentProcessor.accepts (tender, CCType))
if (bankAccountProcessor.accepts(tender, CCType))
{
m_mBankAccountProcessor = m_mBankAccountProcessors[i];
break;
@ -208,8 +207,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
try
{
MPaymentProcessor paymentProcessor = new MPaymentProcessor(m_mBankAccountProcessor.getCtx(), m_mBankAccountProcessor.getC_PaymentProcessor_ID(), m_mBankAccountProcessor.get_TrxName());
PaymentProcessor pp = PaymentProcessor.create(paymentProcessor, this);
PaymentProcessor pp = PaymentProcessor.create(m_mBankAccountProcessor, this);
if (pp == null)
setErrorMessage(Msg.getMsg(Env.getCtx(), "PaymentNoProcessor"));
else

View File

@ -68,9 +68,9 @@ public abstract class PaymentProcessor
* @param mpp
* @param mp
*/
public void initialize(MPaymentProcessor mpp, PaymentInterface mp)
public void initialize(MBankAccountProcessor mbap, PaymentInterface mp)
{
p_mpp = mpp;
p_mbap = mbap;
p_mp = mp;
}
@ -80,14 +80,14 @@ public abstract class PaymentProcessor
* @param mp payment model
* @return initialized PaymentProcessor or null
*/
public static PaymentProcessor create (MPaymentProcessor mpp, PaymentInterface mp)
public static PaymentProcessor create (MBankAccountProcessor mbap, PaymentInterface mp)
{
return Core.getPaymentProcessor(mpp, mp);
return Core.getPaymentProcessor(mbap, mp);
} // create
/*************************************************************************/
protected MPaymentProcessor p_mpp = null;
protected MBankAccountProcessor p_mbap = null;
protected PaymentInterface p_mp = null;
//
private int m_timeout = 30;

View File

@ -17,8 +17,10 @@
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.util.Env;
/** Generated Model for C_BankAccount_Processor
* @author iDempiere (generated)
@ -29,7 +31,7 @@ public class X_C_BankAccount_Processor extends PO implements I_C_BankAccount_Pro
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20121116L;
/** Standard Constructor */
public X_C_BankAccount_Processor (Properties ctx, int C_BankAccount_Processor_ID, String trxName)
@ -37,8 +39,32 @@ public class X_C_BankAccount_Processor extends PO implements I_C_BankAccount_Pro
super (ctx, C_BankAccount_Processor_ID, trxName);
/** if (C_BankAccount_Processor_ID == 0)
{
setAcceptAMEX (false);
// N
setAcceptATM (false);
// N
setAcceptCheck (false);
// N
setAcceptCorporate (false);
// N
setAcceptDiners (false);
// N
setAcceptDirectDebit (false);
// N
setAcceptDirectDeposit (false);
// N
setAcceptDiscover (false);
// N
setAcceptMC (false);
// N
setAcceptVisa (false);
// N
setC_BankAccount_ID (0);
setC_PaymentProcessor_ID (0);
setPassword (null);
setRequireVV (false);
// N
setUserID (null);
} */
}
@ -70,6 +96,246 @@ public class X_C_BankAccount_Processor extends PO implements I_C_BankAccount_Pro
return sb.toString();
}
/** Set Accept AMEX.
@param AcceptAMEX
Accept American Express Card
*/
public void setAcceptAMEX (boolean AcceptAMEX)
{
set_Value (COLUMNNAME_AcceptAMEX, Boolean.valueOf(AcceptAMEX));
}
/** Get Accept AMEX.
@return Accept American Express Card
*/
public boolean isAcceptAMEX ()
{
Object oo = get_Value(COLUMNNAME_AcceptAMEX);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept ATM.
@param AcceptATM
Accept Bank ATM Card
*/
public void setAcceptATM (boolean AcceptATM)
{
set_Value (COLUMNNAME_AcceptATM, Boolean.valueOf(AcceptATM));
}
/** Get Accept ATM.
@return Accept Bank ATM Card
*/
public boolean isAcceptATM ()
{
Object oo = get_Value(COLUMNNAME_AcceptATM);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Electronic Check.
@param AcceptCheck
Accept ECheck (Electronic Checks)
*/
public void setAcceptCheck (boolean AcceptCheck)
{
set_Value (COLUMNNAME_AcceptCheck, Boolean.valueOf(AcceptCheck));
}
/** Get Accept Electronic Check.
@return Accept ECheck (Electronic Checks)
*/
public boolean isAcceptCheck ()
{
Object oo = get_Value(COLUMNNAME_AcceptCheck);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Corporate.
@param AcceptCorporate
Accept Corporate Purchase Cards
*/
public void setAcceptCorporate (boolean AcceptCorporate)
{
set_Value (COLUMNNAME_AcceptCorporate, Boolean.valueOf(AcceptCorporate));
}
/** Get Accept Corporate.
@return Accept Corporate Purchase Cards
*/
public boolean isAcceptCorporate ()
{
Object oo = get_Value(COLUMNNAME_AcceptCorporate);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Diners.
@param AcceptDiners
Accept Diner's Club
*/
public void setAcceptDiners (boolean AcceptDiners)
{
set_Value (COLUMNNAME_AcceptDiners, Boolean.valueOf(AcceptDiners));
}
/** Get Accept Diners.
@return Accept Diner's Club
*/
public boolean isAcceptDiners ()
{
Object oo = get_Value(COLUMNNAME_AcceptDiners);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Direct Debit.
@param AcceptDirectDebit
Accept Direct Debits (vendor initiated)
*/
public void setAcceptDirectDebit (boolean AcceptDirectDebit)
{
set_Value (COLUMNNAME_AcceptDirectDebit, Boolean.valueOf(AcceptDirectDebit));
}
/** Get Accept Direct Debit.
@return Accept Direct Debits (vendor initiated)
*/
public boolean isAcceptDirectDebit ()
{
Object oo = get_Value(COLUMNNAME_AcceptDirectDebit);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Direct Deposit.
@param AcceptDirectDeposit
Accept Direct Deposit (payee initiated)
*/
public void setAcceptDirectDeposit (boolean AcceptDirectDeposit)
{
set_Value (COLUMNNAME_AcceptDirectDeposit, Boolean.valueOf(AcceptDirectDeposit));
}
/** Get Accept Direct Deposit.
@return Accept Direct Deposit (payee initiated)
*/
public boolean isAcceptDirectDeposit ()
{
Object oo = get_Value(COLUMNNAME_AcceptDirectDeposit);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Discover.
@param AcceptDiscover
Accept Discover Card
*/
public void setAcceptDiscover (boolean AcceptDiscover)
{
set_Value (COLUMNNAME_AcceptDiscover, Boolean.valueOf(AcceptDiscover));
}
/** Get Accept Discover.
@return Accept Discover Card
*/
public boolean isAcceptDiscover ()
{
Object oo = get_Value(COLUMNNAME_AcceptDiscover);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept MasterCard.
@param AcceptMC
Accept Master Card
*/
public void setAcceptMC (boolean AcceptMC)
{
set_Value (COLUMNNAME_AcceptMC, Boolean.valueOf(AcceptMC));
}
/** Get Accept MasterCard.
@return Accept Master Card
*/
public boolean isAcceptMC ()
{
Object oo = get_Value(COLUMNNAME_AcceptMC);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Visa.
@param AcceptVisa
Accept Visa Cards
*/
public void setAcceptVisa (boolean AcceptVisa)
{
set_Value (COLUMNNAME_AcceptVisa, Boolean.valueOf(AcceptVisa));
}
/** Get Accept Visa.
@return Accept Visa Cards
*/
public boolean isAcceptVisa ()
{
Object oo = get_Value(COLUMNNAME_AcceptVisa);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException
{
return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_Name)
@ -112,6 +378,34 @@ public class X_C_BankAccount_Processor extends PO implements I_C_BankAccount_Pro
return (String)get_Value(COLUMNNAME_C_BankAccount_Processor_UU);
}
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException
{
return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name)
.getPO(getC_Currency_ID(), get_TrxName()); }
/** Set Currency.
@param C_Currency_ID
The Currency for this record
*/
public void setC_Currency_ID (int C_Currency_ID)
{
if (C_Currency_ID < 1)
set_Value (COLUMNNAME_C_Currency_ID, null);
else
set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID));
}
/** Get Currency.
@return The Currency for this record
*/
public int getC_Currency_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_PaymentProcessor getC_PaymentProcessor() throws RuntimeException
{
return (org.compiere.model.I_C_PaymentProcessor)MTable.get(getCtx(), org.compiere.model.I_C_PaymentProcessor.Table_Name)
@ -139,4 +433,316 @@ public class X_C_BankAccount_Processor extends PO implements I_C_BankAccount_Pro
return 0;
return ii.intValue();
}
/** Set Accept AMEX.
@param IsPPAcceptAMEX Accept AMEX */
public void setIsPPAcceptAMEX (boolean IsPPAcceptAMEX)
{
throw new IllegalArgumentException ("IsPPAcceptAMEX is virtual column"); }
/** Get Accept AMEX.
@return Accept AMEX */
public boolean isPPAcceptAMEX ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptAMEX);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept ATM.
@param IsPPAcceptATM Accept ATM */
public void setIsPPAcceptATM (boolean IsPPAcceptATM)
{
throw new IllegalArgumentException ("IsPPAcceptATM is virtual column"); }
/** Get Accept ATM.
@return Accept ATM */
public boolean isPPAcceptATM ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptATM);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Check.
@param IsPPAcceptCheck Accept Check */
public void setIsPPAcceptCheck (boolean IsPPAcceptCheck)
{
throw new IllegalArgumentException ("IsPPAcceptCheck is virtual column"); }
/** Get Accept Check.
@return Accept Check */
public boolean isPPAcceptCheck ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptCheck);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Corporate.
@param IsPPAcceptCorporate Accept Corporate */
public void setIsPPAcceptCorporate (boolean IsPPAcceptCorporate)
{
throw new IllegalArgumentException ("IsPPAcceptCorporate is virtual column"); }
/** Get Accept Corporate.
@return Accept Corporate */
public boolean isPPAcceptCorporate ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptCorporate);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Diners.
@param IsPPAcceptDiners Accept Diners */
public void setIsPPAcceptDiners (boolean IsPPAcceptDiners)
{
throw new IllegalArgumentException ("IsPPAcceptDiners is virtual column"); }
/** Get Accept Diners.
@return Accept Diners */
public boolean isPPAcceptDiners ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptDiners);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Direct Debit.
@param IsPPAcceptDirectDebit Accept Direct Debit */
public void setIsPPAcceptDirectDebit (boolean IsPPAcceptDirectDebit)
{
throw new IllegalArgumentException ("IsPPAcceptDirectDebit is virtual column"); }
/** Get Accept Direct Debit.
@return Accept Direct Debit */
public boolean isPPAcceptDirectDebit ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptDirectDebit);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Direct Deposit.
@param IsPPAcceptDirectDeposit Accept Direct Deposit */
public void setIsPPAcceptDirectDeposit (boolean IsPPAcceptDirectDeposit)
{
throw new IllegalArgumentException ("IsPPAcceptDirectDeposit is virtual column"); }
/** Get Accept Direct Deposit.
@return Accept Direct Deposit */
public boolean isPPAcceptDirectDeposit ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptDirectDeposit);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Discover.
@param IsPPAcceptDiscover Accept Discover */
public void setIsPPAcceptDiscover (boolean IsPPAcceptDiscover)
{
throw new IllegalArgumentException ("IsPPAcceptDiscover is virtual column"); }
/** Get Accept Discover.
@return Accept Discover */
public boolean isPPAcceptDiscover ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptDiscover);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept MasterCard.
@param IsPPAcceptMC Accept MasterCard */
public void setIsPPAcceptMC (boolean IsPPAcceptMC)
{
throw new IllegalArgumentException ("IsPPAcceptMC is virtual column"); }
/** Get Accept MasterCard.
@return Accept MasterCard */
public boolean isPPAcceptMC ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptMC);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Accept Visa.
@param IsPPAcceptVisa Accept Visa */
public void setIsPPAcceptVisa (boolean IsPPAcceptVisa)
{
throw new IllegalArgumentException ("IsPPAcceptVisa is virtual column"); }
/** Get Accept Visa.
@return Accept Visa */
public boolean isPPAcceptVisa ()
{
Object oo = get_Value(COLUMNNAME_IsPPAcceptVisa);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Minimum Amt.
@param MinimumAmt
Minimum Amount in Document Currency
*/
public void setMinimumAmt (BigDecimal MinimumAmt)
{
set_Value (COLUMNNAME_MinimumAmt, MinimumAmt);
}
/** Get Minimum Amt.
@return Minimum Amount in Document Currency
*/
public BigDecimal getMinimumAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MinimumAmt);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Partner ID.
@param PartnerID
Partner ID or Account for the Payment Processor
*/
public void setPartnerID (String PartnerID)
{
set_Value (COLUMNNAME_PartnerID, PartnerID);
}
/** Get Partner ID.
@return Partner ID or Account for the Payment Processor
*/
public String getPartnerID ()
{
return (String)get_Value(COLUMNNAME_PartnerID);
}
/** Set Password.
@param Password
Password of any length (case sensitive)
*/
public void setPassword (String Password)
{
set_Value (COLUMNNAME_Password, Password);
}
/** Get Password.
@return Password of any length (case sensitive)
*/
public String getPassword ()
{
return (String)get_Value(COLUMNNAME_Password);
}
/** Set Require CreditCard Verification Code.
@param RequireVV
Require 3/4 digit Credit Verification Code
*/
public void setRequireVV (boolean RequireVV)
{
set_Value (COLUMNNAME_RequireVV, Boolean.valueOf(RequireVV));
}
/** Get Require CreditCard Verification Code.
@return Require 3/4 digit Credit Verification Code
*/
public boolean isRequireVV ()
{
Object oo = get_Value(COLUMNNAME_RequireVV);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set User ID.
@param UserID
User ID or account number
*/
public void setUserID (String UserID)
{
set_Value (COLUMNNAME_UserID, UserID);
}
/** Get User ID.
@return User ID or account number
*/
public String getUserID ()
{
return (String)get_Value(COLUMNNAME_UserID);
}
/** Set Vendor ID.
@param VendorID
Vendor ID for the Payment Processor
*/
public void setVendorID (String VendorID)
{
set_Value (COLUMNNAME_VendorID, VendorID);
}
/** Get Vendor ID.
@return Vendor ID for the Payment Processor
*/
public String getVendorID ()
{
return (String)get_Value(COLUMNNAME_VendorID);
}
}

View File

@ -32,7 +32,7 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20121116L;
/** Standard Constructor */
public X_C_PaymentProcessor (Properties ctx, int C_PaymentProcessor_ID, String trxName)
@ -50,15 +50,13 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
setAcceptDiscover (false);
setAcceptMC (false);
setAcceptVisa (false);
setC_PaymentProcessor_ID (0);
setCommission (Env.ZERO);
setCostPerTrx (Env.ZERO);
setC_PaymentProcessor_ID (0);
setHostAddress (null);
setHostPort (0);
setName (null);
setPassword (null);
setRequireVV (false);
setUserID (null);
} */
}
@ -414,6 +412,43 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
return ii.intValue();
}
/** Set Payment Processor.
@param C_PaymentProcessor_ID
Payment processor for electronic payments
*/
public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID)
{
if (C_PaymentProcessor_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, Integer.valueOf(C_PaymentProcessor_ID));
}
/** Get Payment Processor.
@return Payment processor for electronic payments
*/
public int getC_PaymentProcessor_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set C_PaymentProcessor_UU.
@param C_PaymentProcessor_UU C_PaymentProcessor_UU */
public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU)
{
set_Value (COLUMNNAME_C_PaymentProcessor_UU, C_PaymentProcessor_UU);
}
/** Get C_PaymentProcessor_UU.
@return C_PaymentProcessor_UU */
public String getC_PaymentProcessor_UU ()
{
return (String)get_Value(COLUMNNAME_C_PaymentProcessor_UU);
}
/** Set Commission %.
@param Commission
Commission stated as a percentage
@ -454,43 +489,6 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
return bd;
}
/** Set Payment Processor.
@param C_PaymentProcessor_ID
Payment processor for electronic payments
*/
public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID)
{
if (C_PaymentProcessor_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, Integer.valueOf(C_PaymentProcessor_ID));
}
/** Get Payment Processor.
@return Payment processor for electronic payments
*/
public int getC_PaymentProcessor_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set C_PaymentProcessor_UU.
@param C_PaymentProcessor_UU C_PaymentProcessor_UU */
public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU)
{
set_Value (COLUMNNAME_C_PaymentProcessor_UU, C_PaymentProcessor_UU);
}
/** Get C_PaymentProcessor_UU.
@return C_PaymentProcessor_UU */
public String getC_PaymentProcessor_UU ()
{
return (String)get_Value(COLUMNNAME_C_PaymentProcessor_UU);
}
/** Set Description.
@param Description
Optional short description of the record
@ -590,40 +588,6 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
return new KeyNamePair(get_ID(), getName());
}
/** Set Partner ID.
@param PartnerID
Partner ID or Account for the Payment Processor
*/
public void setPartnerID (String PartnerID)
{
set_Value (COLUMNNAME_PartnerID, PartnerID);
}
/** Get Partner ID.
@return Partner ID or Account for the Payment Processor
*/
public String getPartnerID ()
{
return (String)get_Value(COLUMNNAME_PartnerID);
}
/** Set Password.
@param Password
Password of any length (case sensitive)
*/
public void setPassword (String Password)
{
set_Value (COLUMNNAME_Password, Password);
}
/** Get Password.
@return Password of any length (case sensitive)
*/
public String getPassword ()
{
return (String)get_Value(COLUMNNAME_Password);
}
/** Set Payment Processor Class.
@param PayProcessorClass
Payment Processor Java Class
@ -767,38 +731,4 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_
{
return (String)get_Value(COLUMNNAME_TrxType);
}
/** Set User ID.
@param UserID
User ID or account number
*/
public void setUserID (String UserID)
{
set_Value (COLUMNNAME_UserID, UserID);
}
/** Get User ID.
@return User ID or account number
*/
public String getUserID ()
{
return (String)get_Value(COLUMNNAME_UserID);
}
/** Set Vendor ID.
@param VendorID
Vendor ID for the Payment Processor
*/
public void setVendorID (String VendorID)
{
set_Value (COLUMNNAME_VendorID, VendorID);
}
/** Get Vendor ID.
@return Vendor ID for the Payment Processor
*/
public String getVendorID ()
{
return (String)get_Value(COLUMNNAME_VendorID);
}
}

View File

@ -191,22 +191,22 @@ public class PP_Optimal extends PaymentProcessor
public boolean processCC ()
throws IllegalArgumentException
{
log.fine(p_mpp.getHostAddress() + ":" + p_mpp.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mpp.getProxyAddress() + ":" + p_mpp.getProxyPort() + " " + p_mpp.getProxyLogon() + " " + p_mpp.getProxyPassword());
log.fine(p_mbap.getHostAddress() + ":" + p_mbap.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mbap.getProxyAddress() + ":" + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword());
setEncoded(true);
String urlString = p_mpp.getHostAddress();
String urlString = p_mbap.getHostAddress();
// "https://realtime.firepay.com/servlet/DPServlet";
// "https://realtime.test.firepay.com/servlet/DPServlet";
if (p_mpp.getHostPort() != 0)
urlString += ":" + p_mpp.getHostPort();
if (p_mbap.getHostPort() != 0)
urlString += ":" + p_mbap.getHostPort();
/** General Parameters */
StringBuffer param = new StringBuffer(200);
// Merchant username and password.
param.append(createPair(MERCHANT_ID, p_mpp.getUserID(), 80))
.append(AMP).append(createPair(MERCHANT_PWD, p_mpp.getPassword(), 20))
.append(AMP).append(createPair(ACCOUNT_ID, p_mpp.getPartnerID(), 10));
param.append(createPair(MERCHANT_ID, p_mbap.getUserID(), 80))
.append(AMP).append(createPair(MERCHANT_PWD, p_mbap.getPassword(), 20))
.append(AMP).append(createPair(ACCOUNT_ID, p_mbap.getPartnerID(), 10));
// param.append(AMP).append(createPair(MERCHANT_DATA, "comment", 255));
/** Cipher supported : SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5

View File

@ -83,8 +83,8 @@ public final class PP_PayFlowPro extends PaymentProcessor
*/
public boolean processCC () throws IllegalArgumentException
{
log.fine(p_mpp.getHostAddress() + " " + p_mpp.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mpp.getProxyAddress() + " " + p_mpp.getProxyPort() + " " + p_mpp.getProxyLogon() + " " + p_mpp.getProxyPassword());
log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mbap.getProxyAddress() + " " + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword());
//
StringBuffer param = new StringBuffer();
// Transaction Type
@ -151,15 +151,15 @@ public final class PP_PayFlowPro extends PaymentProcessor
StringBuffer param = new StringBuffer(parameter);
// Usr/Pwd
param
.append("&PARTNER=").append(p_mpp.getPartnerID())
.append("&VENDOR=").append(p_mpp.getVendorID())
.append("&USER=").append(p_mpp.getUserID())
.append("&PWD=").append(p_mpp.getPassword());
.append("&PARTNER=").append(p_mbap.getPartnerID())
.append("&VENDOR=").append(p_mbap.getVendorID())
.append("&USER=").append(p_mbap.getUserID())
.append("&PWD=").append(p_mbap.getPassword());
log.fine("-> " + param.toString());
// Call the PayFlowPro client.
int rc = m_pp.CreateContext (p_mpp.getHostAddress(), p_mpp.getHostPort(), getTimeout(),
p_mpp.getProxyAddress(), p_mpp.getProxyPort(), p_mpp.getProxyLogon(), p_mpp.getProxyPassword());
int rc = m_pp.CreateContext (p_mbap.getHostAddress(), p_mbap.getHostPort(), getTimeout(),
p_mbap.getProxyAddress(), p_mbap.getProxyPort(), p_mbap.getProxyLogon(), p_mbap.getProxyPassword());
String response = m_pp.SubmitTransaction(param.toString());
m_pp.DestroyContext();
//

View File

@ -79,14 +79,14 @@ public final class PP_PayFlowPro4 extends PaymentProcessor
*/
public boolean processCC () throws IllegalArgumentException
{
log.fine(p_mpp.getHostAddress() + " " + p_mpp.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mpp.getProxyAddress() + " " + p_mpp.getProxyPort() + " " + p_mpp.getProxyLogon() + " " + p_mpp.getProxyPassword());
log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout()
+ "; Proxy=" + p_mbap.getProxyAddress() + " " + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword());
if ( p_mpp.getC_Currency_ID() != 0 && p_mpp.getC_Currency_ID() != p_mp.getC_Currency_ID() )
if ( p_mbap.getC_Currency_ID() != 0 && p_mbap.getC_Currency_ID() != p_mp.getC_Currency_ID() )
throw new IllegalArgumentException("Payment currency not supported by processor.");
if ( p_mpp.getMinimumAmt().compareTo(p_mp.getPayAmt()) > 0)
if ( p_mbap.getMinimumAmt().compareTo(p_mp.getPayAmt()) > 0)
throw new IllegalArgumentException("Payment amount is less than minimum accepted.");
if ( p_mpp.isRequireVV() && Util.isEmpty(p_mp.getCreditCardVV(), true) )
if ( p_mbap.isRequireVV() && Util.isEmpty(p_mp.getCreditCardVV(), true) )
throw new IllegalArgumentException("Credit card verification code required.");
@ -169,22 +169,22 @@ public final class PP_PayFlowPro4 extends PaymentProcessor
StringBuffer param = new StringBuffer(parameter);
// Usr/Pwd
param
.append("&PARTNER=").append(p_mpp.getPartnerID())
.append("&VENDOR=").append(p_mpp.getVendorID())
.append("&USER=").append(p_mpp.getUserID())
.append("&PWD=").append(p_mpp.getPassword());
.append("&PARTNER=").append(p_mbap.getPartnerID())
.append("&VENDOR=").append(p_mbap.getVendorID())
.append("&USER=").append(p_mbap.getUserID())
.append("&PWD=").append(p_mbap.getPassword());
// PCI DSS don't log private data
// log.fine("-> " + param.toString());
SDKProperties.setHostAddress(p_mpp.getHostAddress());
SDKProperties.setHostPort(p_mpp.getHostPort());
SDKProperties.setHostAddress(p_mbap.getHostAddress());
SDKProperties.setHostPort(p_mbap.getHostPort());
SDKProperties.setTimeOut(getTimeout());
SDKProperties.setProxyAddress(p_mpp.getProxyAddress());
SDKProperties.setProxyPort(p_mpp.getProxyPort());
SDKProperties.setProxyLogin(p_mpp.getProxyLogon());
SDKProperties.setProxyPassword(p_mpp.getProxyPassword());
SDKProperties.setProxyAddress(p_mbap.getProxyAddress());
SDKProperties.setProxyPort(p_mbap.getProxyPort());
SDKProperties.setProxyLogin(p_mbap.getProxyLogon());
SDKProperties.setProxyPassword(p_mbap.getProxyPassword());
//Logging is by default off. To turn logging on uncomment the following lines:
//SDKProperties.setLogFileName("payflow_java.log");

View File

@ -24,7 +24,6 @@ import org.compiere.model.MOrderLine;
import org.compiere.model.MOrderTax;
import org.compiere.model.MPOS;
import org.compiere.model.MPayment;
import org.compiere.model.MPaymentProcessor;
import org.compiere.model.MProduct;
import org.compiere.process.DocAction;
import org.compiere.util.DB;
@ -397,25 +396,24 @@ public class PosOrderModel extends MOrder {
{
try
{
MBankAccountProcessor[] m_mBankAccountProcessors = MPaymentProcessor.find (getCtx (), null, null,
MBankAccountProcessor[] m_mBankAccountProcessors = MBankAccountProcessor.find(getCtx (), null, null,
getAD_Client_ID (), getAD_Org_ID(), getC_Currency_ID (), amt, get_TrxName());
//
HashMap<String,ValueNamePair> map = new HashMap<String,ValueNamePair>(); // to eliminate duplicates
for (int i = 0; i < m_mBankAccountProcessors.length; i++)
{
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccountProcessor.getCtx(), bankAccountProcessor.getC_PaymentProcessor_ID(), bankAccountProcessor.get_TrxName());
if (paymentProcessor.isAcceptAMEX ())
if (bankAccountProcessor.isAcceptAMEX())
map.put (MPayment.CREDITCARDTYPE_Amex, getCreditCardPair (MPayment.CREDITCARDTYPE_Amex));
if (paymentProcessor.isAcceptDiners ())
if (bankAccountProcessor.isAcceptDiners())
map.put (MPayment.CREDITCARDTYPE_Diners, getCreditCardPair (MPayment.CREDITCARDTYPE_Diners));
if (paymentProcessor.isAcceptDiscover ())
if (bankAccountProcessor.isAcceptDiscover())
map.put (MPayment.CREDITCARDTYPE_Discover, getCreditCardPair (MPayment.CREDITCARDTYPE_Discover));
if (paymentProcessor.isAcceptMC ())
if (bankAccountProcessor.isAcceptMC())
map.put (MPayment.CREDITCARDTYPE_MasterCard, getCreditCardPair (MPayment.CREDITCARDTYPE_MasterCard));
if (paymentProcessor.isAcceptCorporate ())
if (bankAccountProcessor.isAcceptCorporate())
map.put (MPayment.CREDITCARDTYPE_PurchaseCard, getCreditCardPair (MPayment.CREDITCARDTYPE_PurchaseCard));
if (paymentProcessor.isAcceptVisa ())
if (bankAccountProcessor.isAcceptVisa())
map.put (MPayment.CREDITCARDTYPE_Visa, getCreditCardPair (MPayment.CREDITCARDTYPE_Visa));
} // for all payment processors
//

View File

@ -122,6 +122,8 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
Grid form;
Vlayout centerVLayout;
Vlayout westVLayout ;
private static final int POSSEQMULTIPLIER = 10000000;
public WTabEditor()
{
@ -351,7 +353,7 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
private void setLastCellProps(Cell lastCell, int actualxpos, int seqNo) {
lastCell.setDroppable("true");
lastCell.addEventListener(Events.ON_DROP, this);
int value = (actualxpos+1) * 10000000 + seqNo;
int value = (actualxpos+1) * POSSEQMULTIPLIER + seqNo;
mapEmptyCellField.put(lastCell, value);
}
@ -547,8 +549,8 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
MField field = getMField(fieldid);
if (field != null) {
setActiveMField(field);
setBackgroundField(field);
setProperties(field);
setBackgroundField(field);
}
}
}
@ -560,13 +562,14 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
MField field = getMField(gridField.getAD_Field_ID());
if (field != null) {
setActiveMField(field);
setBackgroundField(field);
setProperties(field);
}
// select the field on the visible list and set focus
for (Listitem item : visible.getItems()) {
if (field.getAD_Field_ID() == (Integer) item.getValue()) {
visible.setSelectedItem(item);
setBackgroundField(field);
// select the field on the visible list and set focus
for (Listitem item : visible.getItems()) {
if (field.getAD_Field_ID() == (Integer) item.getValue()) {
visible.setSelectedItem(item);
break;
}
}
}
}
@ -588,22 +591,17 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
} else {
field.setColumnSpan(field.getColumnSpan()+mult);
}
setProperties(field);
resortArrays();
setProperties(field); // seqno could change
updateLists(field);
repaintGrid();
if (field != null) {
setActiveMField(field);
setBackgroundField(field);
setProperties(field);
}
// select the field on the visible list and set focus
for (Listitem item : visible.getItems()) {
if (field.getAD_Field_ID() == (Integer) item.getValue()) {
visible.setSelectedItem(item);
break;
}
}
setActiveMField(field);
setProperties(field);
repaintGrid();
setBackgroundField(field);
}
}
@ -624,13 +622,12 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
// check empty cells
Integer posseq = mapEmptyCellField.get(me.getTarget());
if (posseq != null) {
int actualxpos = posseq / 10000000;
int seqno = posseq - (actualxpos * 10000000);
int actualxpos = posseq / POSSEQMULTIPLIER;
int seqno = posseq - (actualxpos * POSSEQMULTIPLIER);
MField field = getMField((Integer) startItem.getValue());
field.setSeqNo(seqno-5);
field.setIsDisplayed(true);
field.setXPosition(actualxpos);
setProperties(field);
resortArrays();
setProperties(field); // seqno could change
updateLists(field);
@ -646,17 +643,16 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
// item moved from visible to invisible
MField field = getMField((Integer) startItem.getValue());
setActiveMField(field);
setBackgroundField(field);
field.setSeqNo(0);
field.setIsDisplayed(false);
field.setXPosition(1);
setProperties(field);
resortArrays();
setProperties(field); // seqno could change
updateLists(field);
repaintGrid();
setBackgroundField(field);
}
else if (startItem.getListbox() == invisible && endItem.getListbox() == visible)
else if (startItem.getListbox() == invisible && endItem.getListbox() == visible && (Integer) startItem.getValue() != 0)
{
// item moved from invisible to visible
MField field = getMField((Integer) startItem.getValue());
@ -664,7 +660,6 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
field.setSeqNo(fieldTo.getSeqNo()-5);
field.setIsDisplayed(true);
field.setXPosition(fieldTo.getXPosition());
setProperties(field);
resortArrays();
setProperties(field); // seqno could change
updateLists(field);
@ -680,7 +675,6 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
field.setSeqNo(fieldTo.getSeqNo()-5);
field.setIsDisplayed(true);
field.setXPosition(fieldTo.getXPosition());
setProperties(field);
resortArrays();
setProperties(field); // seqno could change
updateLists(field);
@ -766,9 +760,10 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
visible.removeAllItems();
invisible.removeAllItems();
for(MField field : getMFields())
for (MField field : getMFields())
{
if (!field.isActive())
GridField gridField = getGridField(field);
if (!field.isActive() || gridField.isToolbarButton())
continue;
KeyNamePair pair = new KeyNamePair(field.getAD_Field_ID(), field.getName());
if (field.isDisplayed()) {
@ -781,6 +776,9 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
invisible.setSelectedKeyNamePair(pair);
}
}
if (invisible.getItems().isEmpty()){
invisible.addItem(new KeyNamePair(0, "..."));
}
}
@Override

View File

@ -155,29 +155,31 @@ public class WPaymentEditor extends WEditor implements ListDataListener {
@Override
public void setReadWrite(boolean readWrite) {
GridTab m_mTab = gridField.getGridTab();
String m_DocStatus = (String) m_mTab.getValue("DocStatus");
// DocStatus
if (m_DocStatus == null)
m_DocStatus = "";
// Is the Trx closed? Reversed / Voided / Cloased
if (m_DocStatus.equals("RE") || m_DocStatus.equals("VO") || m_DocStatus.equals("CL"))
{
getComponent().setEnabled(readWrite, false);
return;
}
boolean m_onlyRule = false;
// Document is not complete - allow to change the Payment Rule only
if (m_DocStatus.equals("CO") || m_DocStatus.equals("WP"))
m_onlyRule = false;
else
m_onlyRule = true;
boolean m_isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), gridField.getWindowNo(), "IsSOTrx"));
// PO only Rule
if (!m_onlyRule // Only order has Warehouse
&& !m_isSOTrx && m_mTab.getValue("M_Warehouse_ID") != null)
m_onlyRule = true;
if (m_mTab != null) {
String m_DocStatus = (String) m_mTab.getValue("DocStatus");
// DocStatus
if (m_DocStatus == null)
m_DocStatus = "";
// Is the Trx closed? Reversed / Voided / Cloased
if (m_DocStatus.equals("RE") || m_DocStatus.equals("VO") || m_DocStatus.equals("CL"))
{
getComponent().setEnabled(readWrite, false);
return;
}
// Document is not complete - allow to change the Payment Rule only
if (m_DocStatus.equals("CO") || m_DocStatus.equals("WP"))
m_onlyRule = false;
else
m_onlyRule = true;
boolean m_isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), gridField.getWindowNo(), "IsSOTrx"));
// PO only Rule
if (!m_onlyRule // Only order has Warehouse
&& !m_isSOTrx && m_mTab.getValue("M_Warehouse_ID") != null)
m_onlyRule = true;
}
getComponent().setEnabled(readWrite, readWrite && !m_onlyRule);
}

View File

@ -17,7 +17,9 @@ package org.compiere.apps.form;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.compiere.model.GridField;
import org.compiere.model.MField;
@ -40,10 +42,14 @@ public class TabEditor
public static CLogger log = CLogger.getCLogger(TabEditor.class);
private List<MField> fields = new ArrayList<MField>();
private MField m_activeField;
private List<GridField> gridFields = new ArrayList<GridField>();
private MField m_activeField;
private Map<Integer, MField> mapField = new HashMap<Integer, MField>();
private Map<Integer, GridField> mapGridField = new HashMap<Integer, GridField>();
public List<GridField> getGridFields() {
return gridFields;
@ -62,8 +68,10 @@ public class TabEditor
GridField[] l_gridFields = GridField.createFields(Env.getCtx(), windowNo, 0, tabid);
for (GridField gridField : l_gridFields) {
gridFields.add(gridField);
mapGridField.put(gridField.getAD_Field_ID(), gridField);
MField field = new MField(Env.getCtx(), gridField.getAD_Field_ID(), null);
fields.add(field);
mapField.put(field.getAD_Field_ID(), field);
gridField.getVO().IsReadOnly = true;
gridField.getVO().IsMandatory = false;
gridField.getVO().IsUpdateable = false;
@ -81,21 +89,11 @@ public class TabEditor
}
protected MField getMField(int fieldid) {
for (MField field : fields) {
if (field.getAD_Field_ID() == fieldid) {
return field;
}
}
return null;
return mapField.get(fieldid);
}
protected GridField getGridField(MField field) {
for (GridField gridfield : gridFields) {
if (gridfield.getAD_Field_ID() == field.getAD_Field_ID()) {
return gridfield;
}
}
return null;
return mapGridField.get( field.getAD_Field_ID());
}
public MField getActiveMField() {

View File

@ -25,7 +25,6 @@ import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.GridTab;
import org.compiere.model.MBankAccountProcessor;
import org.compiere.model.MPaymentProcessor;
import org.compiere.model.MSysConfig;
import org.compiere.model.PO;
import org.compiere.util.CLogger;
@ -237,10 +236,10 @@ public abstract class PaymentForm implements IPaymentForm {
protected boolean isBankAccountProcessorExist(Properties ctx, String tender, String CCType, int AD_Client_ID, int C_Currency_ID, BigDecimal PayAmt, String trxName)
{
MBankAccountProcessor[] m_mBankAccountProcessors = MPaymentProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, PayAmt, trxName);
MBankAccountProcessor[] m_mBankAccountProcessors = MBankAccountProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, PayAmt, trxName);
// Relax Amount
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Env.ZERO, trxName);
m_mBankAccountProcessors = MBankAccountProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Env.ZERO, trxName);
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
return false;
return true;
@ -248,10 +247,10 @@ public abstract class PaymentForm implements IPaymentForm {
protected MBankAccountProcessor getBankAccountProcessor(Properties ctx, String tender, String CCType, int AD_Client_ID, int C_Currency_ID, BigDecimal PayAmt, String trxName)
{
MBankAccountProcessor[] m_mBankAccountProcessors = MPaymentProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, PayAmt, trxName);
MBankAccountProcessor[] m_mBankAccountProcessors = MBankAccountProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, PayAmt, trxName);
// Relax Amount
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
m_mBankAccountProcessors = MPaymentProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Env.ZERO, trxName);
m_mBankAccountProcessors = MBankAccountProcessor.find(ctx, tender, CCType, AD_Client_ID, C_Currency_ID, Env.ZERO, trxName);
if (m_mBankAccountProcessors == null || m_mBankAccountProcessors.length == 0)
return null;
@ -260,8 +259,7 @@ public abstract class PaymentForm implements IPaymentForm {
for (int i = 0; i < m_mBankAccountProcessors.length; i++)
{
MBankAccountProcessor bap = m_mBankAccountProcessors[i];
MPaymentProcessor paymentProcessor = new MPaymentProcessor(bap.getCtx(), bap.getC_PaymentProcessor_ID(), bap.get_TrxName());
if (paymentProcessor.accepts (tender, CCType))
if (bap.accepts(tender, CCType))
{
m_mBankAccountProcessor = m_mBankAccountProcessors[i];
break;