Configuring Paypal Standard for CartThrob

Setting up PayPal is a pain. PayPal requires some attention to detail to get their settings to work well with CartThrob, or any other cart system for that matter. Below we have compiled a list of PayPal notes & settings to help you get your system set up and working as quickly as possible.

NOTES

Paypal’s transactions are not done in real time

When a customer pays through Paypal, they make sure the customer has the money to pay, either in their Paypal Account (fast), through their bank (very slow), or through their credit card (if they also have a bank account, this will be very slow indeed). You should not trust that your customer’s transaction is complete until Paypal verifies that it is. The way they notify you of this verification is through the Instant Payment Notification system. Once they discover that a payment will be successful they notify you. Unfortunately, this could take up to a week in some instances. So make sure that if you are selling software, you’re aware of this. Your payment is not guaranteed until Paypal says it is.

A complete transaction is not really complete

Paypal will return a customer when the transaction is complete. That doesn’t mean that they’ve confirmed payment and updated your site with the IPN though. Basically a complete status with Paypal means that they’ve successfully taken information. If you want to protect yourself tell your customers that their order will be processing until paypal confirms payment. Wait to ship, or provide downloads until the IPN updates you.

CartThrob updates orders and purchased items when…

When Paypal notifies CartThrob of a successful purchase, CartThrob will set orders to their completed status (Open, Completed, whatever you have set on the backend) and will convert Purchased_items to “Open”. If either one of these things do not happen, there is probably a problem with how you’ve configured PayPal (or a CartThrob bug, hey, who knows). When CartThrob gets an error via the IPN for an order, it will update the order, and convert its status to your declined or failed status, and record the error message returned by PayPal.

SETTINGS

Make sure you have enabled Auto Return in your Paypal settings

Auto-return must be set to on so that completed transactions are automatically taken back to your site. There are a few cleanup functions that happen after the user is driven back to your site, so it’s important that auto-return be ON.

Turning On Auto Return

Auto Return is turned off by default. To turn on Auto Return:

  1. Login to your PayPal account at https://www.paypal.com. The My Account Overview page appears.
  2. Click the Profile subtab. The Profile Summary page appears.
  3. Under the Selling Preferences column, click the Website Payment Preferences link. The Website Payment Preferences page appears.
  4. Under Auto Return for Website Payments, click the On radio button to enable Auto Return.
  5. In the Return URL field, enter the URL to which you want your payers redirected after they complete their payments.
    (just put in your website’s main url… CT overrides this value)
    N O T E : If the Return URL you enter is invalid, PayPal displays the standard payment confirmation page after people complete their payments.
  6. Scroll to the bottom of the page, and click the Save button.

With Auto Return turned on in your account profile, the return HTML variable set by CartThrob on individual transactions will be used, which overrides the value of the return URL that you stored on PayPal as part of the Auto Return feature.

Turn On Payment Data Transfer (PDT)

Payment Data Transfer will send the Paypal transaction id back to your site when a purchase is made. This will update the customer’s order, and will set the {transaction_id} variable in the submitted_order_info tag. Without PDT active, the customer will not see PayPal’s transaction id. Follow the directions for turning on Auto Return above. When on the Website Payment Preferences page, set Payment Data Transfer to “on”.

NOTE: Auto-Return must be turned on for PDT to work.

Custom Statuses & Orders

If you use custom statuses (Processing, Completed, etc) in addition to Open for your orders weblog, make sure that you keep this in mind when outputting data. With PayPal, at a minimum, your orders will be processing for at least a few minutes, even if paypal’s IPN is working quickly. In the meantime if you display weblog entries data about the order, it will need to take into account your custom statuses.

{exp:weblog:entries weblog="orders" status="open|Processing|Completed|Etc"}

This affects email notifications as well, if you’re using weblog entries tags.

Instant Payment Notification IPN

IPN by default is OFF. That’s fine, it is my understanding that based on the parameters we send to PayPal it will still use IPN, and send update data back to your site. We automatically send a “notify_url” every time we post an order, so you do not need to set these values in PayPal itself. According to PayPal, the only setting that will disallow IPN is the “disabled” setting.

The default setting of “off” is overridden on the fly when CartThrob automatically sends the notify_url. Any specific URL configured in Paypals’ settings for the notify_url is also overridden on the fly. When the IPN is set to “disabled” in Paypal’s settings, IPN is truly disabled. So don’t disable it.

Paypal will also stop sending notifications to bad urls. So if for some reason you’re doing a bunch of testing on a website behind a firewall that Paypal can’t reach, it will eventually blacklist the notify_url you have given them.

Get Verified

Even sandbox accounts need to be verified to use the IPN (see above). If your account is not verified, IPN won’t work.

Return URLs

When Paypal directs someone back to your site after a successful transaction, it will return visitors to a url like this:

http://yoursite.com/index.php?ACT=44&gateway=paypal_standard&method=paypal_success 

If you are using .htaccess to remove index.php from your URLs AND you have also added a static HTML page as the default for your site, many “cleanup functions” won’t happen, including sending of email notifications, clearing the cart, updating order statuses, and more. Basically THIS is the url that paypal will try to hit:

http://yoursite.com/?ACT=44&gateway=paypal_standard&method=paypal_success 

And it will be sending that data to your HTML page. So, don’t put a static HTML page AND try to use htaccess to hide index.php. Using EE, you can always create a “coming soon” index page and create an index2 page to test on until you are ready to launch.

Notes for Internationalization

By default if, if you try to send Umlauts (äöü) captured in the checkout_form to PayPal then those Umlauts won’t get transformed correctly depending on your charset setting (meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8” ). By default the charset in PayPal is set to “windows-1250”. Many sites will have their own charsets set to “utf-8”. You’ll need to change the settings in PayPal to match your charset so that umlauts and other characters are correctly converted. You can find these settings in your PayPal account: Profile » Language Encoding » More Options » Encoding (dropdown box).

{examples_channel_configuration}

{/examples_channel_configuration}

Top of Page