com.elasticpath.domain.payment.impl
Class PaypalExpressPaymentGatewayImpl

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.PaypalExpressPaymentGatewayImpl
All Implemented Interfaces:
EpDomain, PaymentGateway, PayPalExpressPaymentGateway, Transient, java.io.Serializable

public class PaypalExpressPaymentGatewayImpl
extends AbstractPaymentGatewayImpl
implements PayPalExpressPaymentGateway

The default implementation of PaypalExpressPaymentService.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
PaypalExpressPaymentGatewayImpl()
           
 
Method Summary
 void capture(OrderPayment orderPayment)
          Captures a payment on a previously authorized card.
 PaymentType getPaymentType()
          Get the type of this payment gateway.
 void preAuthorize(OrderPayment orderPayment, Address billingAddress)
          Pre-authorize a payment.
 void reversePreAuthorization(OrderPayment orderPayment)
          Reverse a previous pre-authorization.
 void sale(OrderPayment orderPayment, Address billingAddress)
          Make a payment without pre-authorization.
 java.lang.String setExpressCheckout(ShoppingCart shoppingCart, java.lang.String returnUrl, java.lang.String cancelUrl)
          Start the ExpressCheckout for Authorization.
 void setProperties(java.util.Properties properties)
          Set the properties of the payment gateway (e.g.
 void voidCaptureOrCredit(OrderPayment orderPayment)
          Void a previous capture or credit.
 
Methods inherited from class com.elasticpath.domain.payment.impl.AbstractPaymentGatewayImpl
getName, getProperties, getSupportedCurrencies, refund, setName, 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.PaymentGateway
getName, getProperties, getSupportedCurrencies, refund, setName, 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

PaypalExpressPaymentGatewayImpl

public PaypalExpressPaymentGatewayImpl()
Method Detail

capture

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

Specified by:
capture in interface PaymentGateway
Parameters:
orderPayment - the payment to be captured
Throws:
PaymentGatewayException - if the payment processing fails

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 orderPayment,
                         Address billingAddress)
Pre-authorize a payment.

Specified by:
preAuthorize in interface PaymentGateway
Parameters:
orderPayment - the order payment to be preauthorized
billingAddress - the name and address of the person being billed
Throws:
PaymentGatewayException - if the payment processing fails

reversePreAuthorization

public void reversePreAuthorization(OrderPayment orderPayment)
Reverse a previous pre-authorization.

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

sale

public void sale(OrderPayment orderPayment,
                 Address billingAddress)
Make a payment without pre-authorization.

Specified by:
sale in interface PaymentGateway
Parameters:
orderPayment - the payment to be preauthorized
billingAddress - the name and address of the person being billed
Throws:
PaymentGatewayException - if the payment processing fails

setExpressCheckout

public java.lang.String setExpressCheckout(ShoppingCart shoppingCart,
                                           java.lang.String returnUrl,
                                           java.lang.String cancelUrl)
Start the ExpressCheckout for Authorization. Redirect customer to paypal site to log in and select fund source.

Specified by:
setExpressCheckout in interface PayPalExpressPaymentGateway
Parameters:
shoppingCart - the shopping cart
returnUrl - the url to return from paypal upon completion the payment action.
cancelUrl - the url to return to if the user decide to cancel the payment action.
Returns:
the token string.
Throws:
PaymentGatewayException - if anything goes wrong.

setProperties

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

Specified by:
setProperties in interface PaymentGateway
Overrides:
setProperties in class AbstractPaymentGatewayImpl
Parameters:
properties - the gateway properties

voidCaptureOrCredit

public void voidCaptureOrCredit(OrderPayment orderPayment)
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:
orderPayment - the payment to be voided