O'Reilly logo

Zend Framework 2.0 by Example Beginner's Guide by Krishna Shasankar V

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – accepting payments using PayPal

Preform the following steps for accepting payments using PayPal:

  1. Now add a button on the Shopping Cart page (optionally with Checkout by PayPal Image). This button should link to the paypalExpressCheckoutAction() function.
  2. Add a method in the store controller which will be used to generate the PayPal request:
    protected function getPaypalRequest() { $config = $this->getServiceLocator()->get('config'); $paypalConfig = new \SpeckPaypal\Element\Config( $config['speck-paypal-api']); $adapter = new \Zend\Http\Client\Adapter\Curl(); $adapter->setOptions(array( 'curloptions' => array( CURLOPT_SSL_VERIFYPEER => false, ) )); $client = new \Zend\Http\Client; $client->setMethod('POST'); $client->setAdapter($adapter); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required