Package org.compiere.model
Class PaymentProcessor
- java.lang.Object
-
- org.compiere.model.PaymentProcessor
-
- Direct Known Subclasses:
PP_Authorize,PP_Optimal,PP_PayFlowPro,PP_PayFlowPro4,PP_PayPal
public abstract class PaymentProcessor extends Object
Payment Processor Abstract Class- Version:
- $Id: PaymentProcessor.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static charAMPAmpersandstatic StringENCODINGEncoding (ISO-8859-1 - UTF-8)static charEQEqualsprotected CLoggerlogLoggerprotected MBankAccountProcessorp_mbapprotected PaymentInterfacep_mp
-
Constructor Summary
Constructors Constructor Description PaymentProcessor()Public Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringconnectPost(String urlString, String parameter)Connect via Poststatic PaymentProcessorcreate(MBankAccountProcessor mbap, PaymentInterface mp)Factoryprotected StringcreatePair(String name, int value, int maxLength)Check for delimiter fields &= and add length of not encodedprotected StringcreatePair(String name, String value, int maxLength)Check for delimiter fields &= and add length of not encodedprotected StringcreatePair(String name, BigDecimal value, int maxLength)Check for delimiter fields &= and add length of not encodedprotected PropertiesgetConnectPostProperties(String urlString, String parameter)Get Connect Post PropertiesintgetTimeout()Get Timeoutvoidinitialize(MBankAccountProcessor mbap, PaymentInterface mp)booleanisEncoded()Is Encodedabstract booleanisProcessedOK()Payment is processed successfullyabstract booleanprocessCC()Process CreditCard (no date check)voidsetEncoded(boolean doEncode)Set EncodedvoidsetTimeout(int newTimeout)Set TimeoutStringvalidate()Validate payment before process.StringvalidateAccountNo()Standard account validation.StringvalidateCheckNo()StringvalidateCreditCard()
-
-
-
Field Detail
-
log
protected CLogger log
Logger
-
ENCODING
public static final String ENCODING
Encoding (ISO-8859-1 - UTF-8)- See Also:
- Constant Field Values
-
AMP
public static final char AMP
Ampersand- See Also:
- Constant Field Values
-
EQ
public static final char EQ
Equals- See Also:
- Constant Field Values
-
p_mbap
protected MBankAccountProcessor p_mbap
-
p_mp
protected PaymentInterface p_mp
-
-
Method Detail
-
initialize
public void initialize(MBankAccountProcessor mbap, PaymentInterface mp)
- Parameters:
mbap-mp-
-
create
public static PaymentProcessor create(MBankAccountProcessor mbap, PaymentInterface mp)
Factory- Parameters:
mbap-mp-- Returns:
- initialized PaymentProcessor or null
-
processCC
public abstract boolean processCC() throws IllegalArgumentExceptionProcess CreditCard (no date check)- Returns:
- true if processed successfully
- Throws:
IllegalArgumentException
-
isProcessedOK
public abstract boolean isProcessedOK()
Payment is processed successfully- Returns:
- true if OK
-
validate
public String validate() throws IllegalArgumentException
Validate payment before process.- Returns:
- "" or Error AD_Message.
- Throws:
IllegalArgumentException
-
validateAccountNo
public String validateAccountNo()
Standard account validation.- Returns:
-
validateCheckNo
public String validateCheckNo()
-
validateCreditCard
public String validateCreditCard() throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
setTimeout
public void setTimeout(int newTimeout)
Set Timeout- Parameters:
newTimeout- timeout
-
getTimeout
public int getTimeout()
Get Timeout- Returns:
- timeout
-
createPair
protected String createPair(String name, BigDecimal value, int maxLength)
Check for delimiter fields &= and add length of not encoded- Parameters:
name- namevalue- valuemaxLength- maximum length- Returns:
- name[5]=value or name=value
-
createPair
protected String createPair(String name, int value, int maxLength)
Check for delimiter fields &= and add length of not encoded- Parameters:
name- namevalue- valuemaxLength- maximum length- Returns:
- name[5]=value or name=value
-
createPair
protected String createPair(String name, String value, int maxLength)
Check for delimiter fields &= and add length of not encoded- Parameters:
name- namevalue- valuemaxLength- maximum length- Returns:
- name[5]=value or name=value
-
setEncoded
public void setEncoded(boolean doEncode)
Set Encoded- Parameters:
doEncode- true if encode
-
isEncoded
public boolean isEncoded()
Is Encoded- Returns:
- true if encoded
-
getConnectPostProperties
protected Properties getConnectPostProperties(String urlString, String parameter)
Get Connect Post Properties- Parameters:
urlString- POST url stringparameter- parameter- Returns:
- result as properties
-
-