Class GatewayRequest
- java.lang.Object
-
- org.apache.ofbiz.accounting.thirdparty.eway.GatewayRequest
-
public class GatewayRequest extends java.lang.Object
A class representing a payment request. It holds the fields of the request, provides setters and getters to manipulate them. It also holds information about the type of the request: the request can be of Real-time, CVN, and Beagle type, or the combination of the latter two. You set the request type in the constructor of the object. Based on public domain sample code provided by eWay.com.au
-
-
Field Summary
Fields Modifier and Type Field Description static int
REQUEST_METHOD_BEAGLE
Constant value to be used with the Beagle (GeoIP) payment methodstatic int
REQUEST_METHOD_CVN
Constant value to be used with the CVN payment methodstatic int
REQUEST_METHOD_REFUND
Constant value to be used with the Refund methodstatic java.lang.String
REQUEST_URL_BEAGLE
static java.lang.String
REQUEST_URL_BEAGLE_TEST
static java.lang.String
REQUEST_URL_CVN
static java.lang.String
REQUEST_URL_CVN_TEST
static java.lang.String
REQUEST_URL_REFUND
static java.lang.String
REQUEST_URL_REFUND_TEST
static java.lang.String
REQUEST_URL_RT
static java.lang.String
REQUEST_URL_RT_TEST
-
Constructor Summary
Constructors Constructor Description GatewayRequest()
Default constructor to be used with the Real-Time payment method.GatewayRequest(int method)
Constructor to be used with the CVN and Beagle payment methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCardExpiryMonth()
java.lang.String
getCardExpiryYear()
java.lang.String
getCardHoldersName()
java.lang.String
getCardNumber()
java.lang.String
getCustomerAddress()
java.lang.String
getCustomerBillingCountry()
java.lang.String
getCustomerEmailAddress()
java.lang.String
getCustomerFirstName()
java.lang.String
getCustomerID()
java.lang.String
getCustomerInvoiceDescription()
java.lang.String
getCustomerInvoiceRef()
java.lang.String
getCustomerIPAddress()
java.lang.String
getCustomerLastName()
java.lang.String
getCustomerPostcode()
java.lang.String
getCVN()
java.lang.String
getOption1()
java.lang.String
getOption2()
java.lang.String
getOption3()
java.lang.String
getRefundPassword()
int
getRequestMethod()
Gets the request method given when constructing the object.java.math.BigDecimal
getTotalAmount()
java.lang.String
getTrxnNumber()
java.lang.String
getUrl()
Gets the URL for the configured requestboolean
isTestMode()
void
setCardExpiryMonth(java.lang.String value)
void
setCardExpiryYear(java.lang.String value)
void
setCardHoldersName(java.lang.String value)
void
setCardNumber(java.lang.String value)
void
setCustomerAddress(java.lang.String value)
void
setCustomerBillingCountry(java.lang.String value)
void
setCustomerEmailAddress(java.lang.String value)
void
setCustomerFirstName(java.lang.String value)
void
setCustomerID(java.lang.String value)
void
setCustomerInvoiceDescription(java.lang.String value)
void
setCustomerInvoiceRef(java.lang.String value)
void
setCustomerIPAddress(java.lang.String value)
void
setCustomerLastName(java.lang.String value)
void
setCustomerPostcode(java.lang.String value)
void
setCVN(java.lang.String value)
void
setOption1(java.lang.String value)
void
setOption2(java.lang.String value)
void
setOption3(java.lang.String value)
void
setRefundPassword(java.lang.String value)
void
setTestMode(boolean b)
void
setTotalAmount(java.math.BigDecimal value)
void
setTrxnNumber(java.lang.String value)
java.lang.String
toXml()
Gives the xml representation of this object.
-
-
-
Field Detail
-
REQUEST_URL_REFUND_TEST
public static final java.lang.String REQUEST_URL_REFUND_TEST
- See Also:
- Constant Field Values
-
REQUEST_URL_REFUND
public static final java.lang.String REQUEST_URL_REFUND
- See Also:
- Constant Field Values
-
REQUEST_URL_BEAGLE_TEST
public static final java.lang.String REQUEST_URL_BEAGLE_TEST
- See Also:
- Constant Field Values
-
REQUEST_URL_BEAGLE
public static final java.lang.String REQUEST_URL_BEAGLE
- See Also:
- Constant Field Values
-
REQUEST_URL_CVN_TEST
public static final java.lang.String REQUEST_URL_CVN_TEST
- See Also:
- Constant Field Values
-
REQUEST_URL_CVN
public static final java.lang.String REQUEST_URL_CVN
- See Also:
- Constant Field Values
-
REQUEST_URL_RT_TEST
public static final java.lang.String REQUEST_URL_RT_TEST
- See Also:
- Constant Field Values
-
REQUEST_URL_RT
public static final java.lang.String REQUEST_URL_RT
- See Also:
- Constant Field Values
-
REQUEST_METHOD_CVN
public static final int REQUEST_METHOD_CVN
Constant value to be used with the CVN payment method- See Also:
- Constant Field Values
-
REQUEST_METHOD_BEAGLE
public static final int REQUEST_METHOD_BEAGLE
Constant value to be used with the Beagle (GeoIP) payment method- See Also:
- Constant Field Values
-
REQUEST_METHOD_REFUND
public static final int REQUEST_METHOD_REFUND
Constant value to be used with the Refund method- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GatewayRequest
public GatewayRequest()
Default constructor to be used with the Real-Time payment method. The same as callingGatewayRequest(0)
;
-
GatewayRequest
public GatewayRequest(int method)
Constructor to be used with the CVN and Beagle payment methods.- Parameters:
method
- Logical combination of the REQUEST_METHOD_CVN and REQUEST_METHOD_BEAGLE constants.
-
-
Method Detail
-
getRequestMethod
public int getRequestMethod()
Gets the request method given when constructing the object.- Returns:
- the request method as a logical combination of the REQUEST_METHOD_CVN and REQUEST_METHOD_BEAGLE constants.
-
getUrl
public java.lang.String getUrl()
Gets the URL for the configured request
-
getCustomerID
public java.lang.String getCustomerID()
-
setCustomerID
public void setCustomerID(java.lang.String value)
-
getRefundPassword
public java.lang.String getRefundPassword()
-
setRefundPassword
public void setRefundPassword(java.lang.String value)
-
getTotalAmount
public java.math.BigDecimal getTotalAmount()
-
setTotalAmount
public void setTotalAmount(java.math.BigDecimal value)
-
getCardHoldersName
public java.lang.String getCardHoldersName()
-
setCardHoldersName
public void setCardHoldersName(java.lang.String value)
-
getCardNumber
public java.lang.String getCardNumber()
-
setCardNumber
public void setCardNumber(java.lang.String value)
-
getCardExpiryMonth
public java.lang.String getCardExpiryMonth()
-
setCardExpiryMonth
public void setCardExpiryMonth(java.lang.String value)
-
getCardExpiryYear
public java.lang.String getCardExpiryYear()
-
setCardExpiryYear
public void setCardExpiryYear(java.lang.String value)
-
getTrxnNumber
public java.lang.String getTrxnNumber()
-
setTrxnNumber
public void setTrxnNumber(java.lang.String value)
-
getCustomerFirstName
public java.lang.String getCustomerFirstName()
-
setCustomerFirstName
public void setCustomerFirstName(java.lang.String value)
-
getCustomerLastName
public java.lang.String getCustomerLastName()
-
setCustomerLastName
public void setCustomerLastName(java.lang.String value)
-
getCustomerEmailAddress
public java.lang.String getCustomerEmailAddress()
-
setCustomerEmailAddress
public void setCustomerEmailAddress(java.lang.String value)
-
getCustomerAddress
public java.lang.String getCustomerAddress()
-
setCustomerAddress
public void setCustomerAddress(java.lang.String value)
-
getCustomerPostcode
public java.lang.String getCustomerPostcode()
-
setCustomerPostcode
public void setCustomerPostcode(java.lang.String value)
-
getCustomerInvoiceRef
public java.lang.String getCustomerInvoiceRef()
-
setCustomerInvoiceRef
public void setCustomerInvoiceRef(java.lang.String value)
-
getCustomerInvoiceDescription
public java.lang.String getCustomerInvoiceDescription()
-
setCustomerInvoiceDescription
public void setCustomerInvoiceDescription(java.lang.String value)
-
getCVN
public java.lang.String getCVN()
-
setCVN
public void setCVN(java.lang.String value)
-
getOption1
public java.lang.String getOption1()
-
setOption1
public void setOption1(java.lang.String value)
-
getOption2
public java.lang.String getOption2()
-
setOption2
public void setOption2(java.lang.String value)
-
getOption3
public java.lang.String getOption3()
-
setOption3
public void setOption3(java.lang.String value)
-
getCustomerIPAddress
public java.lang.String getCustomerIPAddress()
-
setCustomerIPAddress
public void setCustomerIPAddress(java.lang.String value)
-
getCustomerBillingCountry
public java.lang.String getCustomerBillingCountry()
-
setCustomerBillingCountry
public void setCustomerBillingCountry(java.lang.String value)
-
isTestMode
public boolean isTestMode()
-
setTestMode
public void setTestMode(boolean b)
-
toXml
public java.lang.String toXml()
Gives the xml representation of this object. This xml will be sent to the gateway. This method is public only for debugging purposes, you might wish to examine the xml content. The special fields of the CVN and Beagle requests are added only if the request belongs to the CVN or Beagle types, respectively.- Returns:
- The GatewayRequest object as an xml string.
-
-