org.broadleafcommerce.core.payment.service.module
Class NullCreditCardPaymentModule
java.lang.Object
org.broadleafcommerce.core.payment.service.module.AbstractModule
org.broadleafcommerce.core.payment.service.module.NullCreditCardPaymentModule
- All Implemented Interfaces:
- PaymentModule
public class NullCreditCardPaymentModule
- extends AbstractModule
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NullCreditCardPaymentModule
public NullCreditCardPaymentModule()
authorize
public PaymentResponseItem authorize(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
reverseAuthorize
public PaymentResponseItem reverseAuthorize(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
authorizeAndDebit
public PaymentResponseItem authorizeAndDebit(PaymentContext paymentContext)
throws PaymentException
- The following method:
validates a credit card number against the Apache Commons CreditCardValidator.
validates the expiration date.
validates that the cvv != "000" in order to demonstrate a PaymentException
This method will set the TransactionSuccess to false on the PaymentResponseItem
if any of the conditions above are invalid.
This does NOT integrate with any Payment Gateway and should not be used in any production environment.
This class is for demonstration purposes only.
- Parameters:
paymentContext - - the payment context injected from the workflow (see: blAuthorizeAndDebitWorkflow in bl-framework-applicationContext-workflow.xml)
- Returns:
- PaymentResponseItem - the response item
- Throws:
PaymentException
debit
public PaymentResponseItem debit(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
credit
public PaymentResponseItem credit(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
voidPayment
public PaymentResponseItem voidPayment(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
balance
public PaymentResponseItem balance(PaymentContext paymentContext)
throws PaymentException
- Throws:
PaymentException
isValidCandidate
public Boolean isValidCandidate(PaymentInfoType paymentType)
Copyright © 2012. All Rights Reserved.