The so called "request back" URL, that comes in to play with IPN, cannot be configured in the Paypal setup. This means that when someone needs to test the Paypal module with IPN operational, he would need to change this URL to sandbox mode in the PHP code. To make life a bit easier this patch provides an extra configuration especially for this URL.

Although there seems to be no syntax error and the configuration seems to have changed, I had no time to actually test it functioning with a real IPN "request back". Could someone please apply the patch and see if IPN still works afterwards?

I added the facility to use a SSL URL although in the hardcoded version this was not enabled. I don't know if Paypal supports SSL for "request back". Could someone with more time test this as well?

Comments

neclimdul’s picture

Version: 4.6.x-1.x-dev » master
StatusFileSize
new6.89 KB

Bump!
This is a good feature. Here's a patch against cvs that does the same thing. I also too the liberty of fixing the spacing in the settings hook.

coupet’s picture

Thanks for a good contribs!

Confirm works well in sandbox.

ñull’s picture

Including in SSL mode, by putting the https:// ??

coupet’s picture

neclimdul’s picture

Yes, previously if you where to use the url https://example.com/paypal-return/ as your return url, it would end up looking like http://example.com/https://example.com/paypay-return/ or https://example.com/https://example.com/paypay-return/ depending on your base_url. This is because it used the string http:// to determine if it was an absolute url. So instead, I changed it to look for http at the begining of the given url which will match both http:// and https:// At least that's what it looked like from my examination of the code.

neclimdul’s picture

Woops, sorry. That was this thread http://drupal.org/node/51707 for the return url issues. Yeah this one lets you use different paypal urls.

ñull’s picture

Status: Needs review » Reviewed & tested by the community

On the basis of this test I changed status, with the hope it will be included in HEAD.

alexis’s picture

I am also looking for this feature. Being able to test Paypal using the Sandbox is a must.

Regards!

ñull’s picture

Another innocent user running into this problem: http://drupal.org/node/62123. Administrator, please submit this to 4.6 and head!!!

mass0ud’s picture

Hi, I am the "innocent user" in the above post. I am still having problems after applying the patch, please see this thread:

http://drupal.org/node/62123

For an explanation of the problem.

Thanks,
Massoud

mass0ud’s picture

The other thread that I was posting to is marked "duplicate" and I received no further replies on it, so I am posting here. I hope this is the right thing to do.

Anyway, here is my problem as it stands and after trying two patches as suggested by com2.

When I try applying the paypal-localisation patch I receive this error:

patching file paypal.module
Hunk #1 FAILED at 1.
Hunk #3 FAILED at 97.
2 out of 7 hunks FAILED -- saving rejects to file paypal.module.rej

I have tried applying to 4.6.0 as distributed and also to CVS HEAD. Which version of paypal.module am I supposed to patch?

Regards,
Massoud

ñull’s picture

Sorry, I am very busy here and answering here is not always possible.

The two warning messages normally mean that this part of patch could not be applied for some reason. As can read in the text only a part of my patch was accepted and applied to HEAD and that must be the reason for the two messages. You can check yourself in the file that was written paypal.module.rej, where you must find the localization patches.

The question is if the paypal module works for you now?

gordon’s picture

Status: Reviewed & tested by the community » Needs work

This will no longer apply. Can someone please update this to the current cvs.

neclimdul’s picture

Status: Needs work » Needs review
StatusFileSize
new3.17 KB

Ok this patch is up to date and adds the sandbox functionality. there are still some bugs but they aren't related to this thread.

gordon’s picture

Status: Needs review » Fixed

Fixed in cvs.

Thanks.

mass0ud’s picture

Here is my current situation after applying the paypal sandbox patch. Users checkout and pay via PayPal (sandbox), PayPal sandbox servers hit my server back with the IPN. There is no error whatsoever in the IPN debug E-mail, but the payment status is still set to 'pending', I have to go in manually and set it to completed.

Running the cron.php in my browser (as suggested in the forum) doesn't help either.

What else can I do?

Regards,
Massoud

ñull’s picture

Are you using the localised (french) version? Change to english and try it again. If it works in English, defenitely it has to do with the errors in payment.module that are discussed in this long confusing thread: http://drupal.org/node/32896. Localisation errors in the payment_get_status_id function are causing your problem.

I miss the time to check out the last presented patches there and noone else seems to be interested, so it never moved to "ready to be committed" status. May be you could try it out and report back there (not here)?

Anonymous’s picture

Status: Fixed » Closed (fixed)