Hello,
I remarked that if someone use checkout paypal but doesn't click on the button to go back to the gallery after payment (transaction status), the order is not confirmed in checkout orders.
I had one case like that and had to manually search which temporary order it was, then edit client's details and change the order status to paid.
I think this problem can be avoided with an automatic forward to the transaction status from the gallery.
In paypal, there's a preference to automatically redirect the user after payment.
How can we use it to redirect to user to his transaction?
Thank you for your suggestions
Posts: 4342
The order status doesn't depend on the user returning to the website - it's triggered by the automatic IPN from Paypal. So there's no need to change the order to paid, it's automatic.
It's already used. Paypal redirects to the gallery site after 10 seconds. You can't stop the user closing his/her browser, however, which is why checkoutpaypal doesn't need the user to return to the website.
EDIT: just to clarify: the PAID status doesn't depend on the user returning to the website; the CONFIRMED status does, but CONFIRMED is not significant. What is significant is that the IPN reaches the website - which is independent of whether the user returns to the website. The IPN (and not the user's return to the website) fills in the customer details, and sets the status to PAID.
Posts: 55
Ok. Thank you for the explanation.
It seems I have a problem with IPN. Can you tell me how preferences should be configured in Paypal to make the IPN work?
Posts: 4342
HI Benoit,
in your Paypal IPN preferences set "Instant Payment Notification (IPN)" to "off" as described here
http://codex.gallery2.org/Gallery2:Modules:checkout#checkoutpaypal_-_the_.27paypal.27_payment_plugin
as far as I know, there are no other special settings required.
Posts: 55
Hi Alec,
My preferences for IPN in Paypal are set to "off" and payment is not recorded into checkout orders.
I can see the payment in the Paypal account (I'm made these test in sandbox mode).
As soon as I click on the "return to gallery" button, the transaction is recorded into checkout orders, but It's marked "not paid".
That was working 2-3 weeks before, orders paid with Paypal were notified and marked as paid, but the automatic redirection wasn't working.
I know my host changed something on the server. It's maybe that. At my side, I didn't changed anything. Is there anything special to make IPN work at server side?
Do you have an idea?
Here's what I have in system info:
Gallery version = 2.2.5 core 1.2.0.7
PHP version = 5.2.4-2ubuntu5.3 apache2handler
Webserver = Apache
Database = mysqli 5.0.51a-3ubuntu5.1, lock.system=flock
Toolkits = Gd
Acceleration = none, none
Operating system = Linux plesk.unity-web.ch 2.6.18.8-xenU #3 SMP Mon Aug 18 13:39:03 CEST 2008 i686
Default theme = galerie
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; fr; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3
Rows in GalleryAccessMap table = 17
Rows in GalleryAccessSubscriberMap table = 156
Rows in GalleryUser table = 2
Rows in GalleryItem table = 155
Rows in GalleryAlbumItem table = 8
Rows in GalleryCacheMap table = 0
Posts: 4342
Hi Benoit,
IPNs are made to the following url:
http://<your-website>/.../main.php?g2_view=checkoutpaypal.IPN
if you visit that url directly yourself, you should just see the word 'Invalid' on screen. (That's good.) If you see 'Unable to Connect' that means your webserver can't contact Paypal directly to verify the IPN.
Also check your webserver log for accesses to this url.
Posts: 55
Hi Alec,
Unfortunately, I have 'Unable to Connect'.
Here's what I have in the access log ; I don't know what to do with that info
Posts: 4342
Actually you should be looking in the log for the equivalent line but triggered by an IPN from paypal (i.e. in the seconds following your payment of a sandbox order) to verify that the IPN call was made to your website. Although it's good to verify that your own test of the IPN system also generated a log entry.
That's a bad sign. Assuming you have the latest version of checkoutpaypal, put this line in the file modules/checkoutpaypal/IPN.inc at line 74:
Then go back to the ...g2_view=checkoutpaypal.IPN page and post what it says on the screen.
Posts: 55
Here's what I have in the page source on the screen. It didn't changed anything, except a <br> tag
I didn't found anything from paypal in the access log, even in the error log. Every log to ...?g2_view=checkoutpaypal.IPN is from my IP address
Posts: 4342
HI Benoit,
it's tricky to know what to suggest then, sorry.
Posts: 55
Hi Alec,
Thank you again for your help.
I tried to uninstall and reinstall the module, but that doesn't change anything.
I'll have a look at that problem with my host and keep you informed if we found a solution.
Posts: 55
Hi Alec,
My host has disabled some PHP functions ; that's why its not working normally...
Do you know which PHP function is used by IPN ?
Thank you again
Posts: 4342
Hi Benoit,
The most obvious candidate is the fsockopen(...) function which is used (not directly, but by the WebHelperSimple.class) to open a connection to Paypal to verify the IPN contents. If it *is* that, then you can't access Paypal for verification and checkoutpaypal won't work.
Posts: 1
how do you make your paypal have the timer so it goes back to your site after 10 seconds?
Posts: 4342
It already does.