Thứ Năm, 24 tháng 4, 2014

Payments with PayPal [Creating a Simple Store]

PayPal is the most commonly used payment processor across the world; one of the kecontributors to PayPal's success is its easy-to-use API and exhaustive documentation thasupports this payment gateway. For any new merchant,PayPal offers a wide range of options for setting up their payment processor, the most important being the types of integrations thaare offered. PayPal offers various products under Payment Processing; some of them include:

        Express Checkout
        PayPal Payments Standards (WebsitPayments Standards)
        PayPal Payments Pro (WebsitPayments Pro)

We will be working with Express Checkout in this chapter, since it is the most basic implementation method of PayPal.


PayPal and Zend Framework 2.0

At the time of writing this book, therwere no native packages thawere offered bZend Framework which supported PayPal integration. There are always third-party options that support this integration. In this example, we have made use of one such third party packagcalled SpeckPaypal.
Perform the following stepfor setting up PayPal:

1.       Open https://packagist.org/, search for speckpaypal.
2.       Get the repository details.
3.       Modify the application's Composer configuration file to include the speckpaypal
repository:
"require": {
"php": ">=5.3.3", "zendframework/zendframework": "2.0.*", "webino/webino-image-thumb": "1.0.0", "zendframework/zendgdata": "2.*","speckcommerce/speck-paypal": "dev-master"
}

4.       Update the project dependencies using the Composer update:
.
Loading composer repositories with package information Updating dependencies
-  Removing zendframework/zendframework (2.0.7)
-  Installing zendframework/zendframework (2.0.8) Downloading: 100%


-  Installing speckcommerce/speck-paypal (dev-master d951518) Cloning d951518fd2c98148da5609e23a41697e6cfca06e


Writing lock file Generating autoload files
5.       Nowe will need API credentials for accessing PayPal Express Checkout.
This can be accessed by logging inthttps://developer.paypal.com
with your PayPal credentials.
6.       Open Sandbox Accounts from Applications.
7.       Choose the appropriate merchant account and select API Credentials in Profile.


8.       Make a note of the API credentials.
9.       Now create a neconfiguration in the config file (CommunicationApp/module/ Users/config/module.config.php) in the module's configuration file and name the array indespeck-paypal-api:
'speck-paypal-api' => array( 'username'   => '', 'password'  => '', 'signature' => '',
'endpoint'  => 'https://api-3t.sandbox.paypal.com/nvp'
)

10.   Different PayPal services have different end points. For Express Checkout in Sandbox this is https://api-3t.sandbox.paypal.com/nvp; if you arswitching live/ production environment, this needs to be changedthttps://api-3t.paypal. com/nvp.


What just happened?
Nowe havconfigured PayPal and SpeckPaypal in our application, our nexstep is ttesreceiving payments using PayPal Express Checkout.

Không có nhận xét nào:

Đăng nhận xét