Merge 3d1c3abc6f59

This commit is contained in:
Heng Sin Low 2013-04-02 21:13:43 +08:00
commit eb8146112b
7 changed files with 369 additions and 224 deletions

View File

@ -0,0 +1,32 @@
-- Mar 25, 2013 6:11:15 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable,IsEncrypted) VALUES (0,'N',0,298,210214,'D','N','N','N',0,'N',10,'N',19,'N',1385,'N','Y','93cbf467-dbe3-4c00-b105-959b405e6106','Y','C_PaymentProcessor_ID','Payment processor for electronic payments','The Payment Processor indicates the processor to be used for electronic payments','Payment Processor','Y',TO_DATE('2013-03-25 18:11:13','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-03-25 18:11:13','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N','N')
;
-- Mar 25, 2013 6:11:16 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210214 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Mar 25, 2013 6:11:21 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
ALTER TABLE C_BP_BankAccount ADD C_PaymentProcessor_ID NUMBER(10) DEFAULT NULL
;
-- Mar 25, 2013 6:11:53 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',226,10,'N','N',210214,'Y',201894,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','bb23275a-069d-4436-8af3-d612e42dd4e6','Y','N',100,0,TO_DATE('2013-03-25 18:11:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2013-03-25 18:11:53','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Mar 25, 2013 6:11:54 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201894 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Mar 25, 2013 6:12:32 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
UPDATE AD_Field SET ColumnSpan=2, IsSameLine='Y', IsReadOnly='Y', XPosition=4,Updated=TO_DATE('2013-03-25 18:12:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201894
;
SELECT register_migration_script('201304021807_TICKET-1001984.sql') FROM dual
;

View File

@ -0,0 +1,32 @@
-- Mar 25, 2013 6:11:15 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable,IsEncrypted) VALUES (0,'N',0,298,210214,'D','N','N','N',0,'N',10,'N',19,'N',1385,'N','Y','93cbf467-dbe3-4c00-b105-959b405e6106','Y','C_PaymentProcessor_ID','Payment processor for electronic payments','The Payment Processor indicates the processor to be used for electronic payments','Payment Processor','Y',TO_TIMESTAMP('2013-03-25 18:11:13','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-03-25 18:11:13','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N','N')
;
-- Mar 25, 2013 6:11:16 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210214 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Mar 25, 2013 6:11:21 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
ALTER TABLE C_BP_BankAccount ADD COLUMN C_PaymentProcessor_ID NUMERIC(10) DEFAULT NULL
;
-- Mar 25, 2013 6:11:53 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',226,10,'N','N',210214,'Y',201894,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','bb23275a-069d-4436-8af3-d612e42dd4e6','Y','N',100,0,TO_TIMESTAMP('2013-03-25 18:11:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2013-03-25 18:11:53','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Mar 25, 2013 6:11:54 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201894 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Mar 25, 2013 6:12:32 PM SGT
-- Ticket #1001984: Avoiding Payment profile ID mess
UPDATE AD_Field SET ColumnSpan=2, IsSameLine='Y', IsReadOnly='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-03-25 18:12:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201894
;
SELECT register_migration_script('201304021807_TICKET-1001984.sql') FROM dual
;

View File

@ -36,16 +36,16 @@ public class PaymentUtil {
private static final CLogger logger = CLogger.getCLogger(PaymentUtil.class); private static final CLogger logger = CLogger.getCLogger(PaymentUtil.class);
public static MBPBankAccount[] getBankAccounts(MBPartner bpartner, public static MBPBankAccount[] getBankAccounts(MBPartner bpartner, String creditCardNo, int C_PaymentProcessor_ID) {
String creditCardNo) {
ArrayList<MBPBankAccount> list = new ArrayList<MBPBankAccount>(); ArrayList<MBPBankAccount> list = new ArrayList<MBPBankAccount>();
String sql = "SELECT * FROM C_BP_BankAccount WHERE C_BPartner_ID=? AND CREDITCARDNUMBER=? AND IsActive='Y' order by created"; String sql = "SELECT * FROM C_BP_BankAccount WHERE C_BPartner_ID=? AND CreditCardNumber=? AND C_PaymentProcessor_ID = ? AND IsActive='Y' ORDER BY Created";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
pstmt = DB.prepareStatement(sql, bpartner.get_TrxName()); pstmt = DB.prepareStatement(sql, bpartner.get_TrxName());
pstmt.setInt(1, bpartner.getC_BPartner_ID()); pstmt.setInt(1, bpartner.getC_BPartner_ID());
pstmt.setString(2, creditCardNo); pstmt.setString(2, creditCardNo);
pstmt.setInt(3, C_PaymentProcessor_ID);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
list.add(new MBPBankAccount(bpartner.getCtx(), rs, bpartner list.add(new MBPBankAccount(bpartner.getCtx(), rs, bpartner

View File

@ -41,19 +41,6 @@ public interface I_C_BP_BankAccount
/** Load Meta Data */ /** Load Meta Data */
/** Column name AccountNo */
public static final String COLUMNNAME_AccountNo = "AccountNo";
/** Set Account No.
* Account Number
*/
public void setAccountNo (String AccountNo);
/** Get Account No.
* Account Number
*/
public String getAccountNo();
/** Column name A_City */ /** Column name A_City */
public static final String COLUMNNAME_A_City = "A_City"; public static final String COLUMNNAME_A_City = "A_City";
@ -80,42 +67,6 @@ public interface I_C_BP_BankAccount
*/ */
public String getA_Country(); public String getA_Country();
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_User_ID */
public static final String COLUMNNAME_AD_User_ID = "AD_User_ID";
/** Set User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID);
/** Get User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID();
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
/** Column name A_EMail */ /** Column name A_EMail */
public static final String COLUMNNAME_A_EMail = "A_EMail"; public static final String COLUMNNAME_A_EMail = "A_EMail";
@ -207,6 +158,55 @@ public interface I_C_BP_BankAccount
*/ */
public String getA_Zip(); public String getA_Zip();
/** Column name AccountNo */
public static final String COLUMNNAME_AccountNo = "AccountNo";
/** Set Account No.
* Account Number
*/
public void setAccountNo (String AccountNo);
/** Get Account No.
* Account Number
*/
public String getAccountNo();
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_User_ID */
public static final String COLUMNNAME_AD_User_ID = "AD_User_ID";
/** Set User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID);
/** Get User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID();
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
/** Column name BankAccountType */ /** Column name BankAccountType */
public static final String COLUMNNAME_BankAccountType = "BankAccountType"; public static final String COLUMNNAME_BankAccountType = "BankAccountType";
@ -248,21 +248,6 @@ public interface I_C_BP_BankAccount
public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException; public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_BP_BankAccount_ID */ /** Column name C_BP_BankAccount_ID */
public static final String COLUMNNAME_C_BP_BankAccount_ID = "C_BP_BankAccount_ID"; public static final String COLUMNNAME_C_BP_BankAccount_ID = "C_BP_BankAccount_ID";
@ -285,6 +270,36 @@ public interface I_C_BP_BankAccount
/** Get C_BP_BankAccount_UU */ /** Get C_BP_BankAccount_UU */
public String getC_BP_BankAccount_UU(); public String getC_BP_BankAccount_UU();
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() 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();
public org.compiere.model.I_C_PaymentProcessor getC_PaymentProcessor() throws RuntimeException;
/** Column name Created */ /** Column name Created */
public static final String COLUMNNAME_Created = "Created"; public static final String COLUMNNAME_Created = "Created";

View File

@ -546,6 +546,8 @@ public final class MPayment extends X_C_Payment
Trx trx = Trx.get(Trx.createTrxName("ppt-"), true); Trx trx = Trx.get(Trx.createTrxName("ppt-"), true);
try
{
MPaymentTransaction m_mPaymentTransaction = createPaymentTransaction(trx.getTrxName()); MPaymentTransaction m_mPaymentTransaction = createPaymentTransaction(trx.getTrxName());
m_mPaymentTransaction.setIsApproved(approved); m_mPaymentTransaction.setIsApproved(approved);
if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment)) if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment))
@ -579,12 +581,20 @@ public final class MPayment extends X_C_Payment
history.setTextMsg(msg.toString()); history.setTextMsg(msg.toString());
history.saveEx(); history.saveEx();
}
catch (Exception e)
{
log.log(Level.SEVERE, "processOnline", e);
setErrorMessage(Msg.getMsg(Env.getCtx(), "PaymentNotProcessed") + ": " + e.getMessage());
}
finally
{
if (trx != null) if (trx != null)
{ {
trx.commit(); trx.commit();
trx.close(); trx.close();
} }
}
if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment)) if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment))
setIsVoided(approved); setIsVoided(approved);
@ -916,7 +926,7 @@ public final class MPayment extends X_C_Payment
*/ */
public boolean setPaymentProcessor () public boolean setPaymentProcessor ()
{ {
return setPaymentProcessor (getTenderType(), getCreditCardType()); return setPaymentProcessor (getTenderType(), getCreditCardType(), getC_PaymentProcessor_ID());
} // setPaymentProcessor } // setPaymentProcessor
/** /**
@ -925,7 +935,7 @@ public final class MPayment extends X_C_Payment
* @param CCType CC Type see CC_ * @param CCType CC Type see CC_
* @return true if found * @return true if found
*/ */
public boolean setPaymentProcessor (String tender, String CCType) public boolean setPaymentProcessor (String tender, String CCType, int C_PaymentProcessor_ID)
{ {
m_mBankAccountProcessor = null; m_mBankAccountProcessor = null;
// Get Processor List // Get Processor List
@ -944,11 +954,14 @@ public final class MPayment extends X_C_Payment
{ {
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i]; MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
if (bankAccountProcessor.accepts(tender, CCType)) if (bankAccountProcessor.accepts(tender, CCType))
{
if (C_PaymentProcessor_ID == 0 || bankAccountProcessor.getC_PaymentProcessor_ID() == C_PaymentProcessor_ID)
{ {
m_mBankAccountProcessor = m_mBankAccountProcessors[i]; m_mBankAccountProcessor = m_mBankAccountProcessors[i];
break; break;
} }
} }
}
if (m_mBankAccountProcessor != null) if (m_mBankAccountProcessor != null)
{ {
setC_BankAccount_ID (m_mBankAccountProcessor.getC_BankAccount_ID()); setC_BankAccount_ID (m_mBankAccountProcessor.getC_BankAccount_ID());

View File

@ -121,7 +121,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
public boolean setPaymentProcessor () public boolean setPaymentProcessor ()
{ {
return setPaymentProcessor (getTenderType(), getCreditCardType()); return setPaymentProcessor (getTenderType(), getCreditCardType(), getC_PaymentProcessor_ID());
} }
/** Temporary Bank Account Processors */ /** Temporary Bank Account Processors */
@ -129,7 +129,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
/** Temporary Bank Account Processor */ /** Temporary Bank Account Processor */
private MBankAccountProcessor m_mBankAccountProcessor = null; private MBankAccountProcessor m_mBankAccountProcessor = null;
public boolean setPaymentProcessor (String tender, String CCType) public boolean setPaymentProcessor (String tender, String CCType, int C_PaymentProcessor_ID)
{ {
m_mBankAccountProcessor = null; m_mBankAccountProcessor = null;
// Get Processor List // Get Processor List
@ -148,11 +148,14 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
{ {
MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i]; MBankAccountProcessor bankAccountProcessor = m_mBankAccountProcessors[i];
if (bankAccountProcessor.accepts(tender, CCType)) if (bankAccountProcessor.accepts(tender, CCType))
{
if (C_PaymentProcessor_ID == 0 || bankAccountProcessor.getC_PaymentProcessor_ID() == C_PaymentProcessor_ID)
{ {
m_mBankAccountProcessor = m_mBankAccountProcessors[i]; m_mBankAccountProcessor = m_mBankAccountProcessors[i];
break; break;
} }
} }
}
if (m_mBankAccountProcessor != null) if (m_mBankAccountProcessor != null)
{ {
setC_BankAccount_ID (m_mBankAccountProcessor.getC_BankAccount_ID()); setC_BankAccount_ID (m_mBankAccountProcessor.getC_BankAccount_ID());
@ -320,20 +323,17 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
{ {
Trx trx = Trx.get(Trx.createTrxName("ppt-"), true); Trx trx = Trx.get(Trx.createTrxName("ppt-"), true);
boolean ok = false;
try
{
MPaymentTransaction m_mPaymentTransaction = copyFrom(this, new Timestamp(System.currentTimeMillis()), TRXTYPE_Void, getR_PnRef(), trx.getTrxName()); MPaymentTransaction m_mPaymentTransaction = copyFrom(this, new Timestamp(System.currentTimeMillis()), TRXTYPE_Void, getR_PnRef(), trx.getTrxName());
m_mPaymentTransaction.setIsApproved(false); m_mPaymentTransaction.setIsApproved(false);
m_mPaymentTransaction.setIsVoided(false); m_mPaymentTransaction.setIsVoided(false);
m_mPaymentTransaction.setIsDelayedCapture(false); m_mPaymentTransaction.setIsDelayedCapture(false);
boolean ok = m_mPaymentTransaction.processOnline(get_TrxName()); ok = m_mPaymentTransaction.processOnline(get_TrxName());
m_mPaymentTransaction.setRef_PaymentTransaction_ID(getC_PaymentTransaction_ID()); m_mPaymentTransaction.setRef_PaymentTransaction_ID(getC_PaymentTransaction_ID());
m_mPaymentTransaction.saveEx(); m_mPaymentTransaction.saveEx();
if (trx != null)
{
trx.commit();
trx.close();
}
if (ok) if (ok)
{ {
setIsVoided(true); setIsVoided(true);
@ -342,6 +342,20 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
} }
else else
setErrorMessage(m_mPaymentTransaction.getErrorMessage()); setErrorMessage(m_mPaymentTransaction.getErrorMessage());
}
catch (Exception e)
{
log.log(Level.SEVERE, "voidOnlineAuthorizationPaymentTransaction", e);
setErrorMessage(Msg.getMsg(Env.getCtx(), "PaymentNotProcessed") + ": " + e.getMessage());
}
finally
{
if (trx != null)
{
trx.commit();
trx.close();
}
}
return ok; return ok;
} }
@ -355,6 +369,9 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
{ {
Trx trx = Trx.get(Trx.createTrxName("ppt-"), true); Trx trx = Trx.get(Trx.createTrxName("ppt-"), true);
boolean ok = false;
try
{
MPaymentTransaction m_mPaymentTransaction = copyFrom(this, new Timestamp(System.currentTimeMillis()), TRXTYPE_DelayedCapture, getR_PnRef(), trx.getTrxName()); MPaymentTransaction m_mPaymentTransaction = copyFrom(this, new Timestamp(System.currentTimeMillis()), TRXTYPE_DelayedCapture, getR_PnRef(), trx.getTrxName());
m_mPaymentTransaction.setIsApproved(false); m_mPaymentTransaction.setIsApproved(false);
m_mPaymentTransaction.setIsVoided(false); m_mPaymentTransaction.setIsVoided(false);
@ -363,16 +380,10 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
if (C_Invoice_ID != 0) if (C_Invoice_ID != 0)
m_mPaymentTransaction.setC_Invoice_ID(C_Invoice_ID); m_mPaymentTransaction.setC_Invoice_ID(C_Invoice_ID);
boolean ok = m_mPaymentTransaction.processOnline(get_TrxName()); ok = m_mPaymentTransaction.processOnline(get_TrxName());
m_mPaymentTransaction.setRef_PaymentTransaction_ID(getC_PaymentTransaction_ID()); m_mPaymentTransaction.setRef_PaymentTransaction_ID(getC_PaymentTransaction_ID());
m_mPaymentTransaction.saveEx(); m_mPaymentTransaction.saveEx();
if (trx != null)
{
trx.commit();
trx.close();
}
if (ok) if (ok)
{ {
if (C_Invoice_ID != 0) if (C_Invoice_ID != 0)
@ -382,6 +393,20 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
} }
else else
setErrorMessage(m_mPaymentTransaction.getErrorMessage()); setErrorMessage(m_mPaymentTransaction.getErrorMessage());
}
catch (Exception e)
{
log.log(Level.SEVERE, "delayCaptureOnlineAuthorizationPaymentTransaction", e);
setErrorMessage(Msg.getMsg(Env.getCtx(), "PaymentNotProcessed") + ": " + e.getMessage());
}
finally
{
if (trx != null)
{
trx.commit();
trx.close();
}
}
return ok; return ok;
} }

View File

@ -30,7 +30,7 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
/** /**
* *
*/ */
private static final long serialVersionUID = 20121031L; private static final long serialVersionUID = 20130325L;
/** Standard Constructor */ /** Standard Constructor */
public X_C_BP_BankAccount (Properties ctx, int C_BP_BankAccount_ID, String trxName) public X_C_BP_BankAccount (Properties ctx, int C_BP_BankAccount_ID, String trxName)
@ -39,8 +39,8 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
/** if (C_BP_BankAccount_ID == 0) /** if (C_BP_BankAccount_ID == 0)
{ {
setA_Name (null); setA_Name (null);
setC_BPartner_ID (0);
setC_BP_BankAccount_ID (0); setC_BP_BankAccount_ID (0);
setC_BPartner_ID (0);
setIsACH (false); setIsACH (false);
} */ } */
} }
@ -73,23 +73,6 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
return sb.toString(); return sb.toString();
} }
/** Set Account No.
@param AccountNo
Account Number
*/
public void setAccountNo (String AccountNo)
{
set_Value (COLUMNNAME_AccountNo, AccountNo);
}
/** Get Account No.
@return Account Number
*/
public String getAccountNo ()
{
return (String)get_Value(COLUMNNAME_AccountNo);
}
/** Set Account City. /** Set Account City.
@param A_City @param A_City
City or the Credit Card or Account Holder City or the Credit Card or Account Holder
@ -124,34 +107,6 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
return (String)get_Value(COLUMNNAME_A_Country); return (String)get_Value(COLUMNNAME_A_Country);
} }
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
{
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getAD_User_ID(), get_TrxName()); }
/** Set User/Contact.
@param AD_User_ID
User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID)
{
if (AD_User_ID < 1)
set_Value (COLUMNNAME_AD_User_ID, null);
else
set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
}
/** Get User/Contact.
@return User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Account EMail. /** Set Account EMail.
@param A_EMail @param A_EMail
Email Address Email Address
@ -279,6 +234,51 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
return (String)get_Value(COLUMNNAME_A_Zip); return (String)get_Value(COLUMNNAME_A_Zip);
} }
/** Set Account No.
@param AccountNo
Account Number
*/
public void setAccountNo (String AccountNo)
{
set_Value (COLUMNNAME_AccountNo, AccountNo);
}
/** Get Account No.
@return Account Number
*/
public String getAccountNo ()
{
return (String)get_Value(COLUMNNAME_AccountNo);
}
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
{
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getAD_User_ID(), get_TrxName()); }
/** Set User/Contact.
@param AD_User_ID
User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID)
{
if (AD_User_ID < 1)
set_Value (COLUMNNAME_AD_User_ID, null);
else
set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
}
/** Get User/Contact.
@return User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** BankAccountType AD_Reference_ID=216 */ /** BankAccountType AD_Reference_ID=216 */
public static final int BANKACCOUNTTYPE_AD_Reference_ID=216; public static final int BANKACCOUNTTYPE_AD_Reference_ID=216;
/** Checking = C */ /** Checking = C */
@ -363,34 +363,6 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
return ii.intValue(); return ii.intValue();
} }
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** Set Business Partner .
@param C_BPartner_ID
Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Business Partner .
@return Identifies a Business Partner
*/
public int getC_BPartner_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Partner Bank Account. /** Set Partner Bank Account.
@param C_BP_BankAccount_ID @param C_BP_BankAccount_ID
Bank Account of the Business Partner Bank Account of the Business Partner
@ -428,6 +400,62 @@ public class X_C_BP_BankAccount extends PO implements I_C_BP_BankAccount, I_Pers
return (String)get_Value(COLUMNNAME_C_BP_BankAccount_UU); return (String)get_Value(COLUMNNAME_C_BP_BankAccount_UU);
} }
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** Set Business Partner .
@param C_BPartner_ID
Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Business Partner .
@return Identifies a Business Partner
*/
public int getC_BPartner_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_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)
.getPO(getC_PaymentProcessor_ID(), get_TrxName()); }
/** 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_Value (COLUMNNAME_C_PaymentProcessor_ID, null);
else
set_Value (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 Exp. Month. /** Set Exp. Month.
@param CreditCardExpMM @param CreditCardExpMM
Expiry Month Expiry Month