In this third part of a five-part series on building the checkout and order processing components of an ecommerce website with Ruby-on-Rails, we'll focus on integrating PayPal into the application's capabilities. This article is excerpted from chapter nine of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
Online Order Processing: Using PayPal - Creating API Credentials (Page 3 of 4 )
Next, we’ll create the credentials that Active Merchant needs when communicating with PayPal. Follow these steps:
From the business account display (Figure 9-7), click the Profile tab. Then click Request API Credentials.
On the next page, select API SSL Client-Side Certificate, agree to the terms by selecting the appropriate option, and click the Submit button.
On the following page, you should see the API username and API password, as shown in Figure 9-8. Click the Download Certificate button. This will download a file (cert_key_pem.txt) containing the private key and the certificate, in the following format:
Figure 9-8.The download or Remove API Certificate page
Select and copy the private key, including the start and end tags, and save it inconfig/paypal/sandbox.key.
Select and copy the certificate and save it inconfig/paypal/sandbox.crt.
Download one of the PayPal Software Development Kits (SDKs), such as the PHP SDK, fromhttp://developer.paypal.com. Then copy the server certificate (api_cert_chain.crt) toconfig/paypal/api_cert_chain.crt.
This completes the PayPal signup and account configuration process. Now we’re ready to use Active Merchant and the PayPal account.