Class GatewayRequest
java.lang.Object
org.apache.ofbiz.accounting.thirdparty.eway.GatewayRequest
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
Modifier and TypeFieldDescriptionstatic final int
Constant value to be used with the Beagle (GeoIP) payment methodstatic final int
Constant value to be used with the CVN payment methodstatic final int
Constant value to be used with the Refund methodstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptionGets card expiry month.Gets card expiry year.Gets card holders name.Gets card number.Gets customer address.Gets customer billing country.Gets customer email address.Gets customer first name.Gets customer id.Gets customer invoice description.Gets customer invoice ref.Gets customer ip address.Gets customer last name.Gets customer postcode.getCVN()
Gets cvn.Gets option 1.Gets option 2.Gets option 3.Gets refund password.int
Gets the request method given when constructing the object.Gets total amount.Gets trxn number.getUrl()
Gets the URL for the configured requestboolean
Is test mode boolean.void
setCardExpiryMonth
(String value) Sets card expiry month.void
setCardExpiryYear
(String value) Sets card expiry year.void
setCardHoldersName
(String value) Sets card holders name.void
setCardNumber
(String value) Sets card number.void
setCustomerAddress
(String value) Sets customer address.void
setCustomerBillingCountry
(String value) Sets customer billing country.void
setCustomerEmailAddress
(String value) Sets customer email address.void
setCustomerFirstName
(String value) Sets customer first name.void
setCustomerID
(String value) Sets customer id.void
Sets customer invoice description.void
setCustomerInvoiceRef
(String value) Sets customer invoice ref.void
setCustomerIPAddress
(String value) Sets customer ip address.void
setCustomerLastName
(String value) Sets customer last name.void
setCustomerPostcode
(String value) Sets customer postcode.void
Sets cvn.void
setOption1
(String value) Sets option 1.void
setOption2
(String value) Sets option 2.void
setOption3
(String value) Sets option 3.void
setRefundPassword
(String value) Sets refund password.void
setTestMode
(boolean b) Sets test mode.void
setTotalAmount
(BigDecimal value) Sets total amount.void
setTrxnNumber
(String value) Sets trxn number.toXml()
Gives the xml representation of this object.
-
Field Details
-
REQUEST_URL_REFUND_TEST
- See Also:
-
REQUEST_URL_REFUND
- See Also:
-
REQUEST_URL_BEAGLE_TEST
- See Also:
-
REQUEST_URL_BEAGLE
- See Also:
-
REQUEST_URL_CVN_TEST
- See Also:
-
REQUEST_URL_CVN
- See Also:
-
REQUEST_URL_RT_TEST
- See Also:
-
REQUEST_URL_RT
- See Also:
-
REQUEST_METHOD_CVN
public static final int REQUEST_METHOD_CVNConstant value to be used with the CVN payment method- See Also:
-
REQUEST_METHOD_BEAGLE
public static final int REQUEST_METHOD_BEAGLEConstant value to be used with the Beagle (GeoIP) payment method- See Also:
-
REQUEST_METHOD_REFUND
public static final int REQUEST_METHOD_REFUNDConstant value to be used with the Refund method- See Also:
-
-
Constructor Details
-
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 Details
-
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
Gets the URL for the configured request -
getCustomerID
Gets customer id.- Returns:
- the customer id
-
setCustomerID
Sets customer id.- Parameters:
value
- the value
-
getRefundPassword
Gets refund password.- Returns:
- the refund password
-
setRefundPassword
Sets refund password.- Parameters:
value
- the value
-
getTotalAmount
Gets total amount.- Returns:
- the total amount
-
setTotalAmount
Sets total amount.- Parameters:
value
- the value
-
getCardHoldersName
Gets card holders name.- Returns:
- the card holders name
-
setCardHoldersName
Sets card holders name.- Parameters:
value
- the value
-
getCardNumber
Gets card number.- Returns:
- the card number
-
setCardNumber
Sets card number.- Parameters:
value
- the value
-
getCardExpiryMonth
Gets card expiry month.- Returns:
- the card expiry month
-
setCardExpiryMonth
Sets card expiry month.- Parameters:
value
- the value
-
getCardExpiryYear
Gets card expiry year.- Returns:
- the card expiry year
-
setCardExpiryYear
Sets card expiry year.- Parameters:
value
- the value
-
getTrxnNumber
Gets trxn number.- Returns:
- the trxn number
-
setTrxnNumber
Sets trxn number.- Parameters:
value
- the value
-
getCustomerFirstName
Gets customer first name.- Returns:
- the customer first name
-
setCustomerFirstName
Sets customer first name.- Parameters:
value
- the value
-
getCustomerLastName
Gets customer last name.- Returns:
- the customer last name
-
setCustomerLastName
Sets customer last name.- Parameters:
value
- the value
-
getCustomerEmailAddress
Gets customer email address.- Returns:
- the customer email address
-
setCustomerEmailAddress
Sets customer email address.- Parameters:
value
- the value
-
getCustomerAddress
Gets customer address.- Returns:
- the customer address
-
setCustomerAddress
Sets customer address.- Parameters:
value
- the value
-
getCustomerPostcode
Gets customer postcode.- Returns:
- the customer postcode
-
setCustomerPostcode
Sets customer postcode.- Parameters:
value
- the value
-
getCustomerInvoiceRef
Gets customer invoice ref.- Returns:
- the customer invoice ref
-
setCustomerInvoiceRef
Sets customer invoice ref.- Parameters:
value
- the value
-
getCustomerInvoiceDescription
Gets customer invoice description.- Returns:
- the customer invoice description
-
setCustomerInvoiceDescription
Sets customer invoice description.- Parameters:
value
- the value
-
getCVN
Gets cvn.- Returns:
- the cvn
-
setCVN
Sets cvn.- Parameters:
value
- the value
-
getOption1
Gets option 1.- Returns:
- the option 1
-
setOption1
Sets option 1.- Parameters:
value
- the value
-
getOption2
Gets option 2.- Returns:
- the option 2
-
setOption2
Sets option 2.- Parameters:
value
- the value
-
getOption3
Gets option 3.- Returns:
- the option 3
-
setOption3
Sets option 3.- Parameters:
value
- the value
-
getCustomerIPAddress
Gets customer ip address.- Returns:
- the customer ip address
-
setCustomerIPAddress
Sets customer ip address.- Parameters:
value
- the value
-
getCustomerBillingCountry
Gets customer billing country.- Returns:
- the customer billing country
-
setCustomerBillingCountry
Sets customer billing country.- Parameters:
value
- the value
-
isTestMode
public boolean isTestMode()Is test mode boolean.- Returns:
- the boolean
-
setTestMode
public void setTestMode(boolean b) Sets test mode.- Parameters:
b
- the b
-
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.
-