Hi

I've been struggling with this for hours. I have a sandbox set up, the paypal payment goes through ok and then auto returns to my site, however the IPN debug email is not triggered and the orders are set to pending. From what I understand this happens when you leave the site to paypal. If I go directly to /paypal/IPN/ I do get a blank debug email so I know that works. I feel like I am missing something simple here. The only things I can think of is that paypal is not sending to the IPN page. What reasons are there for that? I have the correct url in the IPN preferences and it is enabled as is auto return. I have added a bank account to my sandbox seller account but it is not verified, could this be the cause?

I have tried with the 4.6 install, then with the updated CVS backports, and even tried all the patches I have found with no joy. I have currently gone back to the latest CVS backports.

Any help appreciated as I've put a lot of custom work into the products, I didn't think that paypal would be a major problem.

thanks
Andy

Comments

ñull’s picture

I've got it working here. The following tips might help you:

  • Don't forget to set the right URL in your sandbox account's IPN setting. Without that IPN will not contact your site.
  • Paypal module is not really prepared for testing with sandbox. There is a hardcoded domain name that needs to be changed before you can test it. If you don't change that, even though IPN is contacting your site, it will never change the transaction to paid and the debug email will keep saying that payment is not confirmed. Your site will verify with IPN and should do that with the Sandbox URL not the "life URL". Look around line 216 for
      $fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
    

    and change the domain to www.sandbox.paypal.com before you start testing.

  • There is a bug in Paypal module that incorrectly tests for shippable items. See description with my hack/patch here: http://drupal.org/node/36083
AstralP’s picture

Thanks for your help, however none of this has helped, still no joy.... If you have any more suggestions\avenues to try it would be much appreciated.

thanks
Andy

kae’s picture

i'm having a similar problem with paypal sub. you can track the suggestions at node 44295. please post there if you get this working. thanks. ae2005

ñull’s picture

Seems a very confusing discussion at node 44295. Refers more to problems with subsciption then to problems with IPN. What suggestion would help to get IPN going?

sanduhrs’s picture

Make shure the "PayPal Receiver Email" administer->settings->paypal matches the _main_ e-mail configured in your paypal account.
Hope that helps.

kae’s picture

there may be 2 other places where you need to change the url if you are using the sandbox
http://paypal.forums.liveworld.com/thread.jspa?threadID=1000002659
Your form action should be
https://www.sandbox.paypal.com/cgi-bin/webscr.

not
"https://www.sandbox.paypal.com/xclick"

kae’s picture

but the tech support could be wrong. as later in the thread someone used this.
https://www.sandbox.paypal.com/xclick/item_number=r_i_1:erwinschabulke

kae’s picture

http://www.3g.co.nz/2/?p=16
this page also has some syntax idea from xclick.

sanduhrs’s picture

My PayPal processing URL for the sandbox is:
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&

In real life im using:
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&

ñull’s picture

The URL that is successfully used here with a full functioning IPN in a life Drupal e-commerce site is:

https://www.paypal.com/xclick/

The Sandbox equivalent would be

https://www.sandbox.paypal.com/xclick/

The crucial thing is that IPN in the sandbox won't work when you don't change the PHP code of paypal.module, like I indicated in this thread (adding the sandbox subdomain) and for the life site you should not forget to change it back again.

kae’s picture

thanks sanduhrs and com2. I've got IPN working (though not the downloadable product part). I used sanduhrs syntax, though it sounds like com2's syntax would work also. There are 4 lines that need to be changed:
the libcurl one mentioned first in this thread
2 lines containing the word "xclick" in paypal.module
the paypal processing url setting in admin - settings - paypal.

gordon’s picture

Are these changes something that needs to be fixed in the paypal module or was it something to do with your setup.

If it is something that needs to be fixed please provide a patch.

kae’s picture

no patch is necessary, although it'd be nice to modify the readme.txt to include instructions for using with the sandbox. I can write that up if you want.

kae’s picture

Gordon, there is some code at 44932 that does need to be made into a patch. None of us know how to make one, but I can try to make a patch if you okay the code going in after reviewing it for security and any other issues.

gordon’s picture

What would be nice is a patch that will allow you to check a box to put paypal into the sandbox mode without a user needing to edit code.

ñull’s picture

It would be nice, but when Paypal decides to drastically change things, then you would need to bring out a new patch. I think it would be sufficient to have another field in the setup to add the validation URL or whatever it is called, which is presently hardcoded at www.paypal.com/cgi-bin/webscr. I considered doing this, but I postponed it because you would need to split the domain name from the URL which will be used in the fsockopen; I was just too busy to get into that.

ñull’s picture

Here I provided an untested patch that adds this configuration: http://drupal.org/node/50312 ae2005, could you help out and try it out for me in your sandbox setup?

Ogredude’s picture

Okay folks.

Please realize that paypal_framework module conflicts with the paypal module in ecommerce. Namely, they both try to take over the paypal/ipn path via hook_menu()

What this means is that if you have paypal_framework module enabled, then ecommerce paypal IPN *will not work*. Disable paypal_framework and all should be well.

If you're running on the sandbox, you will still need to edit paypal.module to specify sandbox everywhere, as said above.

I think that if we're going to continue using this module, we need to move the sandbox/live to the settings somewhere, and allow it to be site-specific. I'm running multisites here, and ecommerce is installed globally. So if I edit the paypal.module to put my current site in sandbox mode, then that means EVERYONE ELSE sharing the codebase is suddenly in sandbox mode as well. Not Good.

ñull’s picture

So if I edit the paypal.module to put my current site in sandbox mode, then that means EVERYONE ELSE sharing the codebase is suddenly in sandbox mode as well. Not Good.

Ogredude, do you have any suggestion how to solve it? If it is easy enough I could include it in the patch

skelly’s picture

I was having a similar problem with not processing the IPN postback from sandbox (after making all the appropriate changes to URL's to use Sandbox).

I noticed that the actual request was hitting the server logs but that the user agent was blank. It was at this point suspicion turned to the bad-behaviour module I had enabled.

Turning off bad-behaviour solved the problem! I don't know if bad-behaviour and PayPal IPN can co-exist in a production PayPal environment - I haven't got that far yet.

budda’s picture

I had the same problem, but my IPN path was never getting accessed by PayPals sandbox server.

In the end it was to do with me using only one paypal sandbox account to act as both the business and the user purchasing account.

Creating two accounts in the sandbox and using them as the buyer and seller suddenly kicked PayPal in to gear and the IPN worked!

Weird, as everything else was going through find using just a single PayPal account.

sime’s picture

Component: paypal.module » -- other --
Status: Active » Fixed

Considered fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)
Anonymous’s picture