org.broadleafcommerce.vendor.paypal.web.controller
Class BroadleafPayPalController

java.lang.Object
  extended by org.broadleafcommerce.common.web.controller.BroadleafAbstractController
      extended by org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
          extended by org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController
              extended by org.broadleafcommerce.vendor.paypal.web.controller.BroadleafPayPalController

public class BroadleafPayPalController
extends org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController

Created with IntelliJ IDEA. User: elbertbautista Date: 6/13/12 Time: 4:41 PM This is a default controller to handle the most common PayPal Express Checkout use cases. This was created to make integration with PayPal seamless and a matter of configuring your properties file. For custom implementations, this class should not be used. Re-implement and extend PayPalCheckoutService. To use, this class must be auto-scanned in your application context. This controller supports the following: - Single Payment Type flow using the PayPal Express Checkout API - Using Broadleaf to collect shipping information (default) or use PayPal to collect shipping information. - Forward to a verification screen or order confirmation screen upon redirect from PayPal This controller depends on the following properties being set: - paypal.return.url = PayPal redirects the user back to here once the customer has completed everything on PayPal's side. - paypal.order.verify.url = set this property in order to redirect to a Verification Page first before completing checkout - paypal.order.confirm.url = set this to the location of the confirmation page - paypal.order.confirm.identifier = this is the request parameter variable that you can pass to the confirmation page so it can look up your order. - paypal.order.confirm.useOrderNumber = this is a boolean to use order.getOrderNumber() to pass to the confirmation page, otherwise it uses order.getOrderId()


Field Summary
protected  PayPalCheckoutService payPalCheckoutService
           
 
Fields inherited from class org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController
baseConfirmationView, cartPageRedirect, checkoutPageRedirect, checkoutView, multishipAddAddressSuccessView, multishipAddAddressView, multishipSuccessView, multishipView
 
Fields inherited from class org.broadleafcommerce.core.web.controller.checkout.AbstractCheckoutController
addressService, billingInfoFormValidator, checkoutService, countryService, creditCardPaymentInfoFactory, customerAddressService, customerService, fulfillmentGroupService, fulfillmentOptionService, fulfillmentPricingService, multishipAddAddressFormValidator, orderInfoFormValidator, orderMultishipOptionService, orderService, securePaymentInfoService, shippingInfoFormValidator, stateService
 
Constructor Summary
BroadleafPayPalController()
           
 
Method Summary
 String paypalCheckout(javax.servlet.http.HttpServletRequest request)
          The default endpoint to initiate a PayPal Express Checkout.
 String paypalProcess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String token, String payerID)
          The default endpoint that PayPal redirects to on callback.
 
Methods inherited from class org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController
checkout, completeCheckout, completeSecureCreditCardCheckout, convertToSingleship, copyShippingAddressToBillingAddress, getBaseConfirmationView, getCartPageRedirect, getCheckoutPageRedirect, getCheckoutView, getConfirmationView, getMultishipAddAddressSuccessView, getMultishipAddAddressView, getMultishipSuccessView, getMultishipView, hasValidOrderInfo, hasValidShippingAddresses, initBinder, initializeOrderForCheckout, populateExpirationMonths, populateExpirationYears, populateModelWithShippingReferenceData, processFailedOrderCheckout, putFulfillmentOptionsAndEstimationOnModel, saveGlobalOrderDetails, saveMultiship, saveMultishipAddAddress, saveMultiShipInstruction, savePaymentForm, saveSingleShip, showMultiship, showMultishipAddAddress
 
Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
isAjaxRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

payPalCheckoutService

protected PayPalCheckoutService payPalCheckoutService
Constructor Detail

BroadleafPayPalController

public BroadleafPayPalController()
Method Detail

paypalCheckout

public String paypalCheckout(javax.servlet.http.HttpServletRequest request)
                      throws org.broadleafcommerce.core.payment.service.exception.PaymentException
The default endpoint to initiate a PayPal Express Checkout. To use: Create a controller in your application and extend this class.

Parameters:
request - - The Http request
Returns:
ModelAndView
Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException

paypalProcess

public String paypalProcess(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            org.springframework.ui.Model model,
                            @RequestParam
                            String token,
                            @RequestParam(value="PayerID")
                            String payerID)
                     throws org.broadleafcommerce.core.checkout.service.exception.CheckoutException,
                            org.broadleafcommerce.core.pricing.service.exception.PricingException
The default endpoint that PayPal redirects to on callback. This is the ${paypal.return.url} configured in your properties file To use: Create a controller in your application and extend this class. Note: assumes there is already a Payment Info of Type PAYPAL on the order. This should have already been created before redirecting to PayPal (i.e. initiateExpressCheckout())

Parameters:
request - - The Http request
token - - A PayPal variable sent back as a request parameter
payerID - - A PayPal variable sent back as a request parameter
Returns:
ModelAndView
Throws:
org.broadleafcommerce.core.checkout.service.exception.CheckoutException
org.broadleafcommerce.core.pricing.service.exception.PricingException


Copyright © 2013. All Rights Reserved.