public interface MerchantServicesProvider
This set of functions may be provided by a specific merchant services provider/bank.
 Not all of the functions will be supported by all providers.
- Author:
- AO Industries, Inc.
- 
Method SummaryModifier and TypeMethodDescriptionauthorize(TransactionRequest transactionRequest, CreditCard creditCard) Authorizes a sale.booleanQueries the provider to see if they support retrieving the list of cards from the secure storage of credit cards.booleanQueries the provider to see if they support the secure storage of credit cards.capture(AuthorizationResult authorizationResult) Captures the funds from a previous call toauthorize.credit(TransactionRequest transactionRequest, CreditCard creditCard) Requests a credit.voiddeleteCreditCard(CreditCard creditCard) Deleted the credit card from the provider's secure storage.Gets the unique identifier for this provider.getTokenizedCreditCards(Map<String, CreditCard> persistedCards, PrintWriter verboseOut, PrintWriter infoOut, PrintWriter warningOut) Gets all stored credit cards, with optional replacement masked card numbers and/or expiration dates.sale(TransactionRequest transactionRequest, CreditCard creditCard) Performs an immediate sale, effectively a combination ofauthorizeandcapture.storeCreditCard(CreditCard creditCard) Stores a credit card securely for later reuse, returning its providerUniqueId.voidupdateCreditCard(CreditCard creditCard) Updates the credit card details, all except the card number and expiration.voidupdateCreditCardExpiration(CreditCard creditCard, byte expirationMonth, short expirationYear) Updates the credit card expiration in the secure storage, card expiration oncreditCardare not changed.voidupdateCreditCardNumberAndExpiration(CreditCard creditCard, String cardNumber, byte expirationMonth, short expirationYear, String cardCode) Updates the credit card number, expiration, and (optionally) card code in the secure storage, card number, expiration, and card code oncreditCardare not changed.voidTransaction(Transaction transaction) Voids a previous transaction.
- 
Method Details- 
getProviderIdString getProviderId()Gets the unique identifier for this provider. The persistence layer may enforce unique IDs per each provider. Also, each credit, void, capture, and stored credit card transaction must be performed by the same provider. The identifier is compared to test this equality.
- 
salePerforms an immediate sale, effectively a combination ofauthorizeandcapture. No exceptions should ever be thrown, the CommunicationResult should be set to the appropriate error instead.- See Also:
 
- 
authorizeAuthorizes a sale. The funds are reserved but not captured until a later call to capture.- See Also:
 
- 
captureCaptures the funds from a previous call toauthorize.- See Also:
 
- 
voidTransactionVoids a previous transaction.- See Also:
 
- 
creditRequests a credit.- See Also:
 
- 
canStoreCreditCardsQueries the provider to see if they support the secure storage of credit cards.- Throws:
- IOException- when unable to contact the bank
- See Also:
 
- 
storeCreditCardStores a credit card securely for later reuse, returning its providerUniqueId.- Throws:
- UnsupportedOperationException- when not supported
- IOException- when unable to contact the bank
- See Also:
 
- 
updateCreditCardUpdates the credit card details, all except the card number and expiration.- Throws:
- UnsupportedOperationException- when not supported
- IOException
- See Also:
 
- 
updateCreditCardNumberAndExpirationvoid updateCreditCardNumberAndExpiration(CreditCard creditCard, String cardNumber, byte expirationMonth, short expirationYear, String cardCode) throws UnsupportedOperationException, IOException Updates the credit card number, expiration, and (optionally) card code in the secure storage, card number, expiration, and card code oncreditCardare not changed. This information is stored by local persistence, but some providers also have a copy of this information. This is used to keep the two systems in sync.- Throws:
- UnsupportedOperationException- when not supported
- IOException- when unable to contact the bank
- See Also:
 
- 
updateCreditCardExpirationvoid updateCreditCardExpiration(CreditCard creditCard, byte expirationMonth, short expirationYear) throws UnsupportedOperationException, IOException Updates the credit card expiration in the secure storage, card expiration oncreditCardare not changed.- Throws:
- UnsupportedOperationException- when not supported
- IOException- when unable to contact the bank
- See Also:
 
- 
deleteCreditCardDeleted the credit card from the provider's secure storage.- Throws:
- UnsupportedOperationException- when not supported
- IOException- when unable to contact the bank
- See Also:
 
- 
canGetTokenizedCreditCardsQueries the provider to see if they support retrieving the list of cards from the secure storage of credit cards.- Throws:
- IOException- when unable to contact the bank
- See Also:
 
- 
getTokenizedCreditCardsMap<String,TokenizedCreditCard> getTokenizedCreditCards(Map<String, CreditCard> persistedCards, PrintWriter verboseOut, PrintWriter infoOut, PrintWriter warningOut) throws UnsupportedOperationException, IOExceptionGets all stored credit cards, with optional replacement masked card numbers and/or expiration dates.The returned map must be unmodifiable. - Returns:
- The unmodifiable mapping of stores cards from TokenizedCreditCard.getProviderUniqueId()toTokenizedCreditCard.
- Throws:
- UnsupportedOperationException- when not supported
- IOException- when unable to contact the bank
- See Also:
 
 
- 

