How to use PayPal Express instead of PayPal Standard
CFWebstore includes two different types of PayPal integration: PayPal Standard which is the original PayPal transaction method which redirects the customer to the PayPal site at the end of the checkout process, completes the payment on their site and uses IPN behind the scenes to finish the order. The newer PayPal checkout is PayPal Pro. This includes a PayPal transaction method that behaves similar to a normal gateway where the customer stays on your site and completes a credit card order from your checkout area. However, PayPal also requires that merchants that use PayPal Pro include PayPal Express integration. This is a payment method where the customer leaves your site at the beginning of the checkout process, selects their address and payment method at PayPal, and then returns to your site to complete the order. Both have their advantages and disadvantages both for the user and for the merchant. Customers that are regular PayPal users like not having to re-enter their address and payment information, but it may be confusing to some customers to leave and then return to the site. For merchants, it has the disadvantage of hiding all the billing address information, but Express has shown to be more reliable for most as it does not have the same possibility of a payment at PayPal completing, but nothing returning to your site. So many merchants that use Standard have considered switching to using Express for the better experience for the customer and greater reliability. So in this article, I'll show you how you can do this on version 6 of CFWebstore.
There are two ways that people tend to use PayPal Standard. One is as a stand-alone single payment method. In this case, customers wishing to checkout have only the PayPal payment method. In the other scenario, PayPal is being used simply as an alternate payment method for those customers that prefer it over giving an unknown merchant their credit card information. If you wish to use PayPal Express as your only checkout method, ideal is to place the PayPal Express button at the bottom of the Shopping Cart as a replacement for the checkout button. This does require a bit more recoding than I can address easily here, but I will be making it easier for you in a future update with some code changes so will re-post to this blog when that is available, or you can also email me directly if you would like help in doing this. For now, let's just look at how we can switch the store over to using PayPal Express as an alternate checkout method.
The main issue in doing this is that currently the settings needed for PayPal Express are saved in the database table that saves your credit card settings (as these are used for PayPal Pro as well.) So if you want to use Express along with another credit card payment method (online or offline card processing), you'll need to save the data elsewhere. You can hard-code it into the paypal express pages, but an easier method may be just to make a copy of the table (CCProcess) and enter in your payment settings for Express directly. You will need to request API credentials at the PayPal site and obtain an API Signature, after which you will have a username, password and Signature Key. You'll find this under Profile - API Access after logging into your PayPal account. Enter the username in the Username field in your new table, password under Password and the signature into the Setting1 field. Your TransType would typically be set to "Sale" to immediately capture the funds. You will also need to enter the API address into the CCServer field: to test on the development sandbox first, you would use https://api.sandbox.paypal.com/2.0/ or if you want to go right to the live PayPal server, use https://api-3t.paypal.com/2.0/
Next you will need to update the files that use these settings to redirect them to your new table. You will find all the PayPal code in the shopping\checkout\paypal directory. The files you will need to update are:
- act_complete_ppexpress.cfm
- act_pp_express.cfm
- act_process_ppexpress.cfm
In each of these, you will find a query at the top that retrieves the settings. Change the database name from #Request.DB_Prefix#CCProcess to whatever your new table name is. Save your changes and ideally add a comment so you can easily find them again in the future.
Now we just need to update the checkout to show our new PayPal Express button. Open up the shopping/checkout/customer/dsp_addresses.cfm page. Around line 77 you will see the code used to output the Express Checkout button. Just remove the CFIF statement around it so it will be turned on for your site. Next open up the shopping/checkout/dsp_payment_options.cfm page. This is the page that displays the various payment options at the end of the checkout process. Around line 43 you will find the setting that determines if the customer has used PayPal Express. Remove the first part of the statement so it simply reads:
Then on line 51, make sure the normal PayPal Standard button is turned off:
Your PayPal Express integration should now be complete! Test it out on the PayPal Sandbox first to make sure you did everything right!








There are no comments for this entry.
[Add Comment]