java.lang.Object
com.aoapps.payments.usaepay.USAePay
- All Implemented Interfaces:
MerchantServicesProvider
Provider for the USAePay system.
Configuration parameters:
- providerId - the unique name of the processor
- postUrl - the URL used for HTTP POST
- key - the source key
- pin (optional) - the pin used for MD5 hash transaction verification
TODO: Get this code listed at http://wiki.usaepay.com/developer/3rdparty
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addMaxLengthParameter
(Map<String, String> request, String name, String value, int maxLength, TransactionResult.ErrorCode errorCode) Adds a parameter to the request after checking its length.protected static void
Adds a parameter to the request.authorize
(TransactionRequest transactionRequest, CreditCard creditCard) boolean
boolean
capture
(AuthorizationResult authorizationResult) credit
(TransactionRequest transactionRequest, CreditCard creditCard) void
deleteCreditCard
(CreditCard creditCard) getKey()
Gets the source key.getPin()
Gets the PIN used for MD5 request and response validation.Gets the post URL.protected static String
getStreetAddress
(String line1, String line2) Combines the two street address lines into a single String.getTokenizedCreditCards
(Map<String, CreditCard> persistedCards, PrintWriter verboseOut, PrintWriter infoOut, PrintWriter warningOut) sale
(TransactionRequest transactionRequest, CreditCard creditCard) storeCreditCard
(CreditCard creditCard) submitTransaction
(Map<String, String> request, boolean testMode) Submits a transaction (a Map of name/value pairs), and returns the result as a Map of name/value pairs.void
updateCreditCard
(CreditCard creditCard) void
updateCreditCardExpiration
(CreditCard creditCard, byte expirationMonth, short expirationYear) void
updateCreditCardNumberAndExpiration
(CreditCard creditCard, String cardNumber, byte expirationMonth, short expirationYear, String cardCode) voidTransaction
(Transaction transaction)
-
Constructor Details
-
USAePay
Creates a new USAePay provider. -
USAePay
Creates a new USAePay provider.
-
-
Method Details
-
getProviderId
- Specified by:
getProviderId
in interfaceMerchantServicesProvider
-
getPostUrl
Gets the post URL. -
getKey
Gets the source key. -
getPin
Gets the PIN used for MD5 request and response validation. http://wiki.usaepay.com/developer/transactionapi#source_pin_code -
submitTransaction
protected Map<String,String> submitTransaction(Map<String, String> request, boolean testMode) throws ErrorCodeExceptionSubmits a transaction (a Map of name/value pairs), and returns the result as a Map of name/value pairs.- Throws:
ErrorCodeException
-
addMaxLengthParameter
protected static void addMaxLengthParameter(Map<String, String> request, String name, String value, int maxLength, TransactionResult.ErrorCode errorCode) throws ErrorCodeExceptionAdds a parameter to the request after checking its length. If longer, throws an ErrorCodeException with the providedTransactionResult.ErrorCode
, otherwise appends the value.- Throws:
ErrorCodeException
-
addTrimmedParameter
protected static void addTrimmedParameter(Map<String, String> request, String name, String value, int maxLength) Adds a parameter to the request. If the value is too long, the firstmaxLength
characters are used and the rest are discarded. -
getStreetAddress
Combines the two street address lines into a single String. -
sale
- Specified by:
sale
in interfaceMerchantServicesProvider
-
authorize
- Specified by:
authorize
in interfaceMerchantServicesProvider
-
capture
- Specified by:
capture
in interfaceMerchantServicesProvider
-
voidTransaction
- Specified by:
voidTransaction
in interfaceMerchantServicesProvider
-
credit
- Specified by:
credit
in interfaceMerchantServicesProvider
-
canStoreCreditCards
public boolean canStoreCreditCards()- Specified by:
canStoreCreditCards
in interfaceMerchantServicesProvider
-
storeCreditCard
- Specified by:
storeCreditCard
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-
updateCreditCard
- Specified by:
updateCreditCard
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-
updateCreditCardNumberAndExpiration
public void updateCreditCardNumberAndExpiration(CreditCard creditCard, String cardNumber, byte expirationMonth, short expirationYear, String cardCode) throws UnsupportedOperationException - Specified by:
updateCreditCardNumberAndExpiration
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-
updateCreditCardExpiration
public void updateCreditCardExpiration(CreditCard creditCard, byte expirationMonth, short expirationYear) throws UnsupportedOperationException - Specified by:
updateCreditCardExpiration
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-
deleteCreditCard
- Specified by:
deleteCreditCard
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-
canGetTokenizedCreditCards
public boolean canGetTokenizedCreditCards()- Specified by:
canGetTokenizedCreditCards
in interfaceMerchantServicesProvider
-
getTokenizedCreditCards
public Map<String,TokenizedCreditCard> getTokenizedCreditCards(Map<String, CreditCard> persistedCards, PrintWriter verboseOut, PrintWriter infoOut, PrintWriter warningOut) throws UnsupportedOperationException- Specified by:
getTokenizedCreditCards
in interfaceMerchantServicesProvider
- Throws:
UnsupportedOperationException
-