Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Compendium of Paypal Standard Fiddly Settings
Posted: 27 May 2010 03:25 PM   [ Ignore ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

I’m just getting started on this, so don’t take this as the be-all end all. If I don’t start somewhere, it’ll never get posted, so bear with me.

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 M.y 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.


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.

[ Edited: 17 June 2011 11:25 AM by Rob Sanchez ]
 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 21 March 2011 01:59 AM   [ Ignore ]   [ # 1 ]
Wallflower
Rank
Total Posts:  10
Joined  2010-11-08

There is one thing I really don’t get.

How do you specify the URL in Cartthrob that you want PayPal Standard to return you to.
I look in the Module and there is some line of code but no box to input a return URL?
Is it input somewhere else like a form.

Thanks for any help.
Virgil…

Profile
 
 
Posted: 21 March 2011 03:09 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

Use the return parameter in the checkout form.

{exp:cartthrob:checkout_form return = "your_group/your_template" }

etc
 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile