Package org.compiere.model
Class PaymentProcessor
java.lang.Object
org.compiere.model.PaymentProcessor
- Direct Known Subclasses:
PP_Authorize
,PP_Dummy
,PP_Optimal
,PP_PayFlowPro
,PP_PayFlowPro4
,PP_PayPal
Abstract Payment Processor base class
- Version:
- $Id: PaymentProcessor.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
Ampersandstatic final String
Encoding (ISO-8859-1 - UTF-8)static final char
Equalsprotected CLogger
Loggerprotected MBankAccountProcessor
protected PaymentInterface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
connectPost
(String urlString, String parameter) Connect via Poststatic PaymentProcessor
create
(MBankAccountProcessor mbap, PaymentInterface mp) Static Factory methodprotected String
createPair
(String name, int value, int maxLength) Check for delimiter fields &= and add length of not encodedprotected String
createPair
(String name, String value, int maxLength) Check for delimiter fields &= and add length of not encodedprotected String
createPair
(String name, BigDecimal value, int maxLength) Check for delimiter fields &= and add length of not encodedprotected Properties
getConnectPostProperties
(String urlString, String parameter) Get Properties from URLint
Get Timeoutvoid
initialize
(MBankAccountProcessor mbap, PaymentInterface mp) boolean
Is Encodedabstract boolean
Is payment processed successfullyabstract boolean
Process CreditCard (no date check)void
setEncoded
(boolean doEncode) Set Encodedvoid
setTimeout
(int newTimeout) Set Timeoutvalidate()
Validate payment before process.Standard account validation.Validate check noValidate credit card
-
Field Details
-
log
Logger -
ENCODING
Encoding (ISO-8859-1 - UTF-8)- See Also:
-
AMP
public static final char AMPAmpersand- See Also:
-
EQ
public static final char EQEquals- See Also:
-
p_mbap
-
p_mp
-
-
Constructor Details
-
PaymentProcessor
public PaymentProcessor()Public Constructor
-
-
Method Details
-
initialize
- Parameters:
mbap
-mp
-
-
create
Static Factory method- Parameters:
mbap
-mp
-- Returns:
- PaymentProcessor instance or null
-
processCC
Process CreditCard (no date check)- Returns:
- true if processed successfully
- Throws:
IllegalArgumentException
-
isProcessedOK
public abstract boolean isProcessedOK()Is payment processed successfully- Returns:
- true if OK
-
validate
Validate payment before process.- Returns:
- "" or Error AD_Message.
- Throws:
IllegalArgumentException
-
validateAccountNo
Standard account validation.- Returns:
- "" or Error AD_Message.
-
validateCheckNo
Validate check no- Returns:
- "" or Error AD_Message.
-
validateCreditCard
Validate credit card- Returns:
- "" or Error AD_Message.
- Throws:
IllegalArgumentException
-
setTimeout
public void setTimeout(int newTimeout) Set Timeout- Parameters:
newTimeout
- timeout
-
getTimeout
public int getTimeout()Get Timeout- Returns:
- timeout
-
createPair
Check for delimiter fields &= and add length of not encoded- Parameters:
name
- namevalue
- valuemaxLength
- maximum length- Returns:
- name[5]=value or name=value
-
createPair
Check for delimiter fields &= and add length of not encoded- Parameters:
name
- namevalue
- valuemaxLength
- maximum length- Returns:
- name[5]=value or name=value
-
createPair
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
Get Properties from URL- Parameters:
urlString
- POST url stringparameter
- parameter- Returns:
- result as properties
-
connectPost
Connect via Post- Parameters:
urlString
- url destination (assuming https)parameter
- parameter- Returns:
- response or null if failure
-