com.elasticpath.domain.payment.impl
Class NullPaymentGatewayImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.payment.impl.AbstractPaymentGatewayImpl
              extended by com.elasticpath.domain.payment.impl.AbstractCreditCardPaymentGatewayImpl
                  extended by com.elasticpath.domain.payment.impl.NullPaymentGatewayImpl
All Implemented Interfaces:
EpDomain, CreditCardPaymentGateway, PaymentGateway, Transient, java.io.Serializable

public class NullPaymentGatewayImpl
extends AbstractCreditCardPaymentGatewayImpl
implements CreditCardPaymentGateway

Implements a payment gateway for testing and demonstration purposes that always authorizes all payments.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
NullPaymentGatewayImpl()
           
 
Method Summary
 void capture(OrderPayment payment)
          Captures a payment on a previously authorized card.
 PaymentType getPaymentType()
          Get the type of this payment gateway.
 void preAuthorize(OrderPayment payment, Address billingAddress)
          Pre-authorize a payment.
 void reversePreAuthorization(OrderPayment payment)
          Reverse a previous pre-authorization.
 void sale(OrderPayment payment, Address billingAddress)
          Captures a payment on a card.
 void voidCaptureOrCredit(OrderPayment payment)
          Void a previous capture or credit.
 
Methods inherited from class com.elasticpath.domain.payment.impl.AbstractCreditCardPaymentGatewayImpl
getSupportedCardTypes, setSupportedCardTypes, setValidateCvv2, validateCvv2
 
Methods inherited from class com.elasticpath.domain.payment.impl.AbstractPaymentGatewayImpl
getName, getProperties, getSupportedCurrencies, refund, setName, setProperties, setSupportedCurrencies
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.payment.CreditCardPaymentGateway
getSupportedCardTypes, setSupportedCardTypes, setValidateCvv2, validateCvv2
 
Methods inherited from interface com.elasticpath.domain.payment.PaymentGateway
getName, getProperties, getSupportedCurrencies, refund, setName, setProperties, setSupportedCurrencies
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

NullPaymentGatewayImpl

public NullPaymentGatewayImpl()
Method Detail

capture

public void capture(OrderPayment payment)
Captures a payment on a previously authorized card.

Specified by:
capture in interface PaymentGateway
Parameters:
payment - the payment to be captured

getPaymentType

public PaymentType getPaymentType()
Get the type of this payment gateway.

Specified by:
getPaymentType in interface PaymentGateway
Returns:
the payment type

preAuthorize

public void preAuthorize(OrderPayment payment,
                         Address billingAddress)
Pre-authorize a payment.

Specified by:
preAuthorize in interface PaymentGateway
Parameters:
payment - the payment to be preauthorized
billingAddress - the name and address of the person being billed

reversePreAuthorization

public void reversePreAuthorization(OrderPayment payment)
Reverse a previous pre-authorization. This can only be executed on Visas using the "Vital" processor and authorizations cannot be reversed using the test server and card info because the auth codes are not valid (Cybersource).

Specified by:
reversePreAuthorization in interface PaymentGateway
Parameters:
payment - the payment that was previously pre-authorized

sale

public void sale(OrderPayment payment,
                 Address billingAddress)
Captures a payment on a card.

Specified by:
sale in interface PaymentGateway
Parameters:
payment - the payment to be preauthorized
billingAddress - the name and address of the person being billed

voidCaptureOrCredit

public void voidCaptureOrCredit(OrderPayment payment)
Void a previous capture or credit. Can usually only be executed on the same day of the original transaction.

Specified by:
voidCaptureOrCredit in interface PaymentGateway
Parameters:
payment - the payment to be voided