com.elasticpath.domain.payment
Interface PaymentGateway

All Superinterfaces:
EpDomain, java.io.Serializable, Transient
All Known Subinterfaces:
CreditCardPaymentGateway, PayPalExpressPaymentGateway
All Known Implementing Classes:
AbstractCreditCardPaymentGatewayImpl, AbstractPaymentGatewayImpl, AuthorizeNetPaymentGatewayImpl, CyberSourcePaymentGatewayImpl, NullPaymentGatewayImpl, PayflowProPaymentGatewayImpl, PaypalExpressPaymentGatewayImpl

public interface PaymentGateway
extends Transient

Represents a payment processing gateway such as Verisign or Cybersource.


Method Summary
 void capture(OrderPayment payment)
          Captures a payment on a previously authorized card.
 java.lang.String getName()
          Get the name of the payment gateway (e.g.
 PaymentType getPaymentType()
          Get the type of this payment gateway.
 java.util.Properties getProperties()
          Get the properties of the payment gateway (e.g.
 java.util.List getSupportedCurrencies()
          Get the currencies supported by this payment gateway.
 void preAuthorize(OrderPayment payment, Address billingAddress)
          Pre-authorize a payment.
 void refund(OrderPayment payment)
          Refunds a previous capture.
 void reversePreAuthorization(OrderPayment payment)
          Reverse a previous pre-authorization.
 void sale(OrderPayment payment, Address billingAddress)
          Marks a transaction for immediate fund transfer without any pre-authorization.
 void setName(java.lang.String name)
          Set the name of the payment gateway (e.g.
 void setProperties(java.util.Properties properties)
          Set the properties of the payment gateway (e.g.
 void setSupportedCurrencies(java.util.List currencies)
          Set the currencies supported by this payment gateway.
 void voidCaptureOrCredit(OrderPayment payment)
          Void a previous capture or credit.
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Method Detail

capture

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

Parameters:
payment - the payment to be captured
Throws:
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails

getName

java.lang.String getName()
Get the name of the payment gateway (e.g. CyberSource).

Returns:
the gateway name

getPaymentType

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

Returns:
the payment type

getProperties

java.util.Properties getProperties()
Get the properties of the payment gateway (e.g. merchantID, keysDirectory).

Returns:
the gateway properties

getSupportedCurrencies

java.util.List getSupportedCurrencies()
Get the currencies supported by this payment gateway.

Returns:
a List of currency code strings (e.g. CAD)

preAuthorize

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

Parameters:
payment - the payment to be preauthorized
billingAddress - the name and address of the person being billed
Throws:
CardDeclinedException - if the card is declined
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails

refund

void refund(OrderPayment payment)
Refunds a previous capture.

Parameters:
payment - the payment to be refunded
Throws:
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails

reversePreAuthorization

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).

Parameters:
payment - the payment that was previously pre-authorized
Throws:
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails

sale

void sale(OrderPayment payment,
          Address billingAddress)
Marks a transaction for immediate fund transfer without any pre-authorization. Note that Visa and Mastercard regulations prohibit capturing CC transaction funds until a product or service has been shipped to the buyer.

Parameters:
payment - the payment to be immediately processed
billingAddress - the name and address of the person being billed
Throws:
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails

setName

void setName(java.lang.String name)
Set the name of the payment gateway (e.g. CyberSource).

Parameters:
name - the gateway name

setProperties

void setProperties(java.util.Properties properties)
Set the properties of the payment gateway (e.g. merchantID, keysDirectory).

Parameters:
properties - the gateway properties

setSupportedCurrencies

void setSupportedCurrencies(java.util.List currencies)
Set the currencies supported by this payment gateway.

Parameters:
currencies - a List of currency code strings (e.g. CAD)

voidCaptureOrCredit

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

Parameters:
payment - the payment to be voided
Throws:
CardExpiredException - if the card has expired
CardErrorException - if there was an error processing the given information
PaymentGatewayException - if the payment processing fails