Forums / Managing Customers and Orders / PayPal IPN issues with Auto Return

PayPal IPN issues with Auto Return

Locked

Views: 23,646

Results 21 to 40 of 53
This thread is locked. New replies are disabled.
31 May 2008, 7:07 AM
#21
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

PayPal IPN issues with Auto Return

ssp711:

i download it the page is more than 100 pages....Looks like the Paypal module version you are using does not delete the session data after the transaction has been completed. I think Zen Cart 1.3.8a does delete those sessions. So you would normally not have that many in your database, only the ones that need attention.

31 May 2008, 7:30 PM
#22
espai avatar

espai

New Zenner

Join Date:
May 2008
Posts:
3
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

same problem here!! :cry: IPN is not working for me.....!!!!!!!!!!!!!!

order lost !!!!.........:( tired of fight with Zencart and Paypal.....

1 Jun 2008, 9:45 AM
#23
ssp711 avatar

ssp711

New Zenner

Join Date:
Aug 2006
Posts:
11
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

paulm:

Looks like the Paypal module version you are using does not delete the session data after the transaction has been completed. I think Zen Cart 1.3.8a does delete those sessions. So you would normally not have that many in your database, only the ones that need attention.

hi, can you tell me which file i should look for to check if my 1.3.8.a did delete the session or not?

as i don't know which function or file control this.

2 Jun 2008, 6:04 PM
#24
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: PayPal IPN issues with Auto Return

ssp711:

hi, can you tell me which file i should look for to check if my 1.3.8.a did delete the session or not?

as i don't know which function or file control this.Over a 100 pages of sessions show, so it didn't delete lots of sessions. After a quick look at the code I assumed 1.3.8a would delete the sessions, but maybe it only deletes the sessions if the PDT token is being used? Or maybe it just does not work, I never really checked.

7 Jun 2008, 5:52 AM
#25
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

Hello,

I am having same issues and would like to pose this question.
Why does zen cart have to wait for user to return from paypal website in order to post the order as confirmed?

From the debug IPN logs I notice that paypal sends an IPN as soon as customer commits payment (pay $####.## now).

Why cant zencart use this IPN payment confirmation to clear the order and make it visible?

Sorry if this sounds like a naive question.

8 Jun 2008, 3:55 AM
#26
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

Following up on my prior post about possible bug in zen cart and auto return.

It seems that zen cart is relying on PDT (payment data transfer) that is sent with auto return to fullfill order completion. However this data is soley intended for use to display transaction details to your customer on your webpage after they return. Not for orderfullment. IPN should be used for order confirmation, which does not require auto return...

I found this excerpt in the paypal documentation:

https://www.paypal.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/intro.html#1016964
[quote]
Differences between Payment Data Transfer (PDT) and Instant Payment Notification (IPN)
PDT's primary function is to display payment transaction details to buyers when they are automatically redirected back to your site upon payment completion; however, there are cases where you will not receive notification of all transactions, such as with pending transactions, refunds, and reversals. For these reasons, or if you are using this data to fulfill orders, PayPal strongly recommends that you also enable Instant Payment Notification (IPN).
Both IPN and PDT send back the same data; however, there are several important differences.
PDT:
l

Is available only to merchants who integrate PayPal with their websites by using Website Payments Standard.
l

Requires Auto Return to be enabled.
l

Auto Return will include an ID that can be used to query PayPal for the complete transaction details.
l

It is possible to miss a notification if the user closes the browser before the redirection is complete.
IPN:
l

Does not require Auto Return to be enabled.
l

At the end of the website payment flow, PayPal POSTs the IPN data asynchronously (i.e. not as part of the website payment flow).
l

IPNs will also POST for eCheck clearings, reversals, and refunds.
[end quote]

Unless I hear someone has already code mod, I will start looking for a way to hack zencart implement IPN confirmation instead of PDT.

8 Jun 2008, 12:37 PM
#27
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: PayPal IPN issues with Auto Return

Zen Cart does use IPN, however should you read further up paypal has had issues with the IPN now for a while

and the reason that it waits till the order comes back is due to the number of people that go to paypal then dont complete the order,
that leaves a large number of open unpaid tickets.

Zen cart PCI compliant Hosting

8 Jun 2008, 12:52 PM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal IPN issues with Auto Return

If you have PDT configured, Zen Cart will use it to activate the paid order immediately, without waiting for the IPN to be received.
However, if the IPN is received before the customer clicks to return to the site, the order will be released anyway, and Zen Cart will recognize this and prevent any clashes.
If PDT is not configured, or if the customer does not click to return to the site, the IPN will still take care of activating the order.

If you're having problems with orders being activated after being paid via Website Payments Standard, verify that PayPal's servers aren't having a problem, and that your server is fully configured to receive IPNs reliably.
http://www.zen-cart.com/wiki/index.php/PayPal

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Jun 2008, 11:24 PM
#29
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

I believe the issue is in the store/ipn_main_handler.php file.

For payments standard, when customer commits payment, paypal is sending an IPN with transaction id of "web_accept" which is currently not handled by the script.

I modified the script abit and it seems to work now for at least one of the scenarios..
A nonpaypal customer who is just using a credit card to make the purchase.
This is under the beta sandbox environment.

On the good chance I broke the logic for other scenarios, are there any volunteers who could help test?

Also, where's the ideal place to post the modified script?

regards

9 Jun 2008, 1:18 AM
#30
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

Sorry folks,

I did not see the file attachments button before.

Enclosed is the modified ipn handler script to allow "web_accept" transactions.

From my end, it seems to fix the issue of zencart (1.3.8) not getting order confirmation for customers who place orders without auto return. But it could definetly use more testing.

the script should replace the one under the main root directory of zencart.

any feedback appreciated.

9 Jun 2008, 3:01 AM
#31
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

Small flub,

I meant to say "transaction type" (txn_type) contains the value "web_accept",
not "transaction id" in the last couple of postings.

9 Jun 2008, 6:52 PM
#32
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

I found one minor issue, if the customer does not return from paypal (auto or othewise), the order is confirmed, however the cart is not reset.

actually, ipn_main_handler() tries to reset it via the _SESSION variable, but I suspect this fails because its actually a new session initiated by paypal server, not by the customer's browser.

the only workaround i see right now is to set a flag in the database that can be checked when the customer returns to store. not sure if its worth doing at this point, because for practical scenario, if the customer hasnt returned via auto/optional return from paypal, by the time he does return, the cart may well have expired anyways.

however, i am concerned about the fact that IPN transactions are not being recorded as they are sent from paypal prior to processing.
I believe this should be a requirement from a mission critical point of view.

Currently, in normal operation, the debugging is turned off and the paypal/logs directory may not have write permission for the web process userid (apache) to allow writing of the incoming data. As in the case of "web_accept" if the script cant recognize the transaction or aborts otherwise, there is little evidence that paypal actually sent the IPN to zencart.

The result is that paypal gets blamed for not sending the IPN when in reality it has.
The other dire scenario is if there a fraudualent IPN transaction is sent, little evidence is available.

So the next set of proposed modifications to the ipn handler is to write out the IPN data as an xml file prior to processing. This will allow for manual review and better yet, automated reconciling of IPN transactions in the future.

10 Jun 2008, 2:42 PM
#33
ivanixdev avatar

ivanixdev

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

attached is 2nd mod to update order when paypal sends a "web_accept" IPN.
This mod resets the cart when/if the customer returns to zencart and redirects to checkout_sucess page.

18 Jun 2008, 9:23 AM
#34
trappersam avatar

trappersam

New Zenner

Join Date:
Jun 2007
Posts:
16
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

I have just recieved a payment with no order. So I made a test order using a different paypal account, was directed back to my site, but still no order inf. rec on my admin.
Most of my customers use direct ccard payment, thank goodness, but i have had several ppal transactions in the past, so i must be set up ok
Trappersam

22 Jun 2008, 11:24 PM
#35
tick avatar

tick

New Zenner

Join Date:
Jun 2007
Location:
Phoenix, AZ
Posts:
66
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

ivanixdev:

however, i am concerned about the fact that IPN transactions are not being recorded as they are sent from paypal prior to processing.
I believe this should be a requirement from a mission critical point of view.

Currently, in normal operation, the debugging is turned off and the paypal/logs directory may not have write permission for the web process userid (apache) to allow writing of the incoming data. As in the case of "web_accept" if the script cant recognize the transaction or aborts otherwise, there is little evidence that paypal actually sent the IPN to zencart.

The result is that paypal gets blamed for not sending the IPN when in reality it has.

After an hour of looking through logs trying to troubleshoot the Direct Payment Error (discussed in http://www.zen-cart.com/forum/showthread.php?t=85903), it looks like this is the cause of that error as well. After turning on all possible logging, the "web_accept" payment type is clearly showing up in the IPN log. Thanks to ivanixdev for the patch. Has anyone tested it? I'm not quite brave enough to just push it up to my production site. Otherwise, does anyone know how to get the PayPal sandbox to issue a "web_accept" rather than a "cart" order? I'd be happy to help test.

Generations Crafting (Our Zen-Cart storefront)
"
And that's just it, Doc - my mind has always been my Achilles' heel!" -- The Tick

24 Jun 2008, 9:33 PM
#36
mortenjan avatar

mortenjan

New Zenner

Join Date:
Jun 2008
Posts:
18
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

i got the same problem, anyone found a soluton?

28 Jun 2008, 4:30 AM
#37
seamstobesew avatar

seamstobesew

Zen Follower

Join Date:
Nov 2005
Location:
Germany
Posts:
110
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

I am having this issue in 2 of my web clients carts at the moment. Both are in 1.37 however.

Would it not be feasible as a solution to the problem to do like other carts have started doing and have zencart create a "pending order" to be sent to admin upon starting the confirm to checkout once they enter at paypal... This at the very least allows the admin to know there is a pending order without it ever getting to paypal, and at the same time if they don't receive the confirm of payment, then they can check there paypal accounts or have the paypal receipt to know there was a payment that went thru. Thus allowing downloadable sites to go in and set the download so customer can retreive there orders and cart still has a process of the order which could then be changed to confirmed or completed.

I think this would easily get around the issues paypal has with ipn and such and allows the business owner to save face, because they can resolve the issue quickly and easily before a customer gets upset. Yes they'd still have to write customer, but the cart could send that "completed" notification with a download url after login.

Just my thoughts here,

Marian
http://www.seamstobesew.com
Tip: Always place your zen-cart version in your messages.

30 Jun 2008, 12:19 AM
#38
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: PayPal IPN issues with Auto Return

Hi there
I would like to support Seamstobesew idea. What a simple but yet excellent solution to support us shop owners.

Wolf Skafte-Zauss
http://e-commerce-pros.com
Tools for E-commerce Professionals

30 Jun 2008, 1:34 AM
#39
sonyat avatar

sonyat

New Zenner

Join Date:
May 2006
Posts:
83
Plugin Contributions:
0

Re: PayPal IPN issues with Auto Return

How would you go about setting that up? Is it in the admin : Configuration area?

30 Jun 2008, 1:57 AM
#40
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: PayPal IPN issues with Auto Return

Hi there
The core code will have to be changed by the developers

Wolf Skafte-Zauss
http://e-commerce-pros.com
Tools for E-commerce Professionals