Forums / PayPal Express Checkout support / Error after paypal redirect - Array([0]=>This transaction has already been captured

Error after paypal redirect - Array([0]=>This transaction has already been captured

Views: 3,158

Results 1 to 10 of 10
12 Jul 2014, 5:12 PM
#1
luke_galyan avatar

luke_galyan

New Zenner

Join Date:
Jun 2014
Location:
Las Vegas, Nevada, United States
Posts:
47
Plugin Contributions:
0

Error after paypal redirect - Array([0]=>This transaction has already been captured

Using ZenCart 1.5.3 (clean install), Paypal Express module (built in), Taxcloud (latest github version), and USPS module.

When testing purchases I am running into an issue. After adding an item to the cart I proceed with checkout which goes smoothly. I am taken to Paypal to make payment. After making the payment on paypal the website redirects me back to my store (BG-Gear.com). This is where the problem is.

When redirected back to my store from paypal I am presented with a blank page with an error that reads
Array([0]=>This transaction has already been captured (ordered:#))

At this point I leave the blank page with the error showing and…
-----look at paypal and see that the charges have been processed properly.
-----check my zencart admin and see the order is there with the charges accepted form paypal.
-----The number in the error message for the order# reflects the correct order number that is associated with the order in my admin.
-----Emails from both paypal and my store are sent to the customer
So in a nut shell it all appears to have processed properly except for the error page.

If I hit the back button a few times to get to the store again, I find the item(s) that I had ordered are still in the cart even though the purchase appears to have processed properly.

When a customer sees the error they will think something failed and either leave the store permanently or go back and see the items in their cart and try to purchase again. Not good in either case.

I had read in a ZenCart forum thread about having the wrong TaxCloud ID and API Key caused this for someone.
http://www.zen-cart.com/showthread.php?208135-Checkout-successful-but-customer-gets-error-message-amp-products-stay-in-shopping-cart
However I have triple checked to be sure I have the correct entries.

As a side note I also noticed I can not do a refund on the transaction form within ZenCart. I can do a refund by going to Paypal and do it there.
I also noticed that when I view the specific order in my ZenCart Admin it has the items and shipping address etc. But what is missing is all the information that should be located in the grey boxes like payer ID, Payment type, etc. I assume the error message I am seeing indicates that this information is not being passed back to my store from paypal? I tried to attach an image to this post but can not seem to get that function to work for me.

From what I can tell I think this is a paypal express issue? But the thread referenced above makes me wonder if it is a taxcloud issue.

Any help would be appreciated
Luke

13 Jul 2014, 1:54 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

I can't recreate your symptoms using a fresh clean install of v1.5.3 without taxcloud or any other modules added.

Guessing the taxcloud code isn't built for ZC v1.5.3 yet

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

14 Jul 2014, 5:57 PM
#3
luke_galyan avatar

luke_galyan

New Zenner

Join Date:
Jun 2014
Location:
Las Vegas, Nevada, United States
Posts:
47
Plugin Contributions:
0

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

Thanks for trying to recreate.

Would you know what portion of code / files have changed in zencart 1.5.3 that would effect the taxcloud module?

Im not a coder but would like to see if it is something i could figure out. Or possibly point the taxcloud guys at to help me solve this.

I would prefer to stick with the new version zencart if possible. This error is the only issue i have left to figure out an im up and running.

Thoughts?
Luke

14 Jul 2014, 9:59 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

The TaxCloud folks can download the latest version of Zen Cart and compare their code against the Zen Cart files, and see where their conflicts occur (such as where they've replaced a core ZC file with their own, based on an older version of ZC).
You could do the same. WinMerge is a very handy tool for that sort of thing. It'll take them half as long as you only because they're already familiar with the code.

The last time I looked at the TaxCloud code was quite awhile ago, but I recall it being messy, and also thinking it was unnecessarily messy in terms of overwriting lots of core code where notifiers/observers could have done the same thing. Not expecting you to deal with that, but they should.

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

14 Jul 2014, 10:55 PM
#5
luke_galyan avatar

luke_galyan

New Zenner

Join Date:
Jun 2014
Location:
Las Vegas, Nevada, United States
Posts:
47
Plugin Contributions:
0

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

I hope they are somewhat responsive. I had emailed them before I started posting here but have not yet gotten a reply.

So to be clear on what youre saying is the problem would likely be in one of the core overwrite files of theirs? I will start playing with some things to try and narrow it down to which file.

If I find a solution for this I will post it here so others wanting to use TaxCloud with Zencart 1.5.3 can maybe benefit. I assume there will be people wanting to do this.

Thanks for your time
Luke

14 Jul 2014, 11:54 PM
#6
luke_galyan avatar

luke_galyan

New Zenner

Join Date:
Jun 2014
Location:
Las Vegas, Nevada, United States
Posts:
47
Plugin Contributions:
0

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

DrByte,
I tried a test.
I left the TaxCould module installed on my store and touched no files.
Then I set the module to Enabled = False to turn off the TaxCloud module (still installed though).
Made a test purchase and the error is gone and all my invoice stuff shows up in the admin area.
I can also do refunds.
In other words all works perfect with the TaxCloud Module installed but just not enabled.

This makes me wonder if it is faulty code in the core files they replace or maybe it is something faulty in ANY part or file of the TaxCloud files?
Can you offer any pointers on how to determine which file is the culprit?

My thought WAS to see if the error was still there with taxcloud installed but just not enabled. If the error was still there then I would feel safe to assume it was in a core file replacement. However the error goes away with the taxcloud core files in place but just not calling any taxcloud functions (since it was switched to off). With this being the case I don't think I can just swap core files out and see which one is causing the error.

Any ideas on how to narrow this down?
Luke

15 Jul 2014, 1:04 AM
#7
luke_galyan avatar

luke_galyan

New Zenner

Join Date:
Jun 2014
Location:
Las Vegas, Nevada, United States
Posts:
47
Plugin Contributions:
0

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

Ok one more update.

Anyone following this thread looking for the same solution may be interested to hear.......
It seems the issue is in the general.php file found in the folder - - admin\includes\functions

I tried comparing the general.php file from the ZenCart 1.5.3 files and the general.php from the TaxCloud Files
I could not find anything that stood out as a coding addition that TaxCloud wanted added.
There was code in the ZenCart version that appeared to be left out of the TaxCloud Version.
There were lots of things that seemed to be just written slightly different but basically being the same concept as far as the code went.

So I took a leap and just got rid of the TaxCloud version of the general.php file and put back the general.php file from the ZenCart 1.5.3 download.
And well everything seems to work as expected.

No more errors
The order shows in the admin area.
Customers get emails
I can do refunds from the admin area
The transactions show on paypal (both customer act. and the store act.)
The transactions show on the TaxCloud site
Taxes are calculated and charged.

Oh and the TaxCloud version I am using is the github version from 06-23-14 - the latest at the time of this post.

I am not qualified in any way to say I know what I am talking about and do not intend to imply this is definitely the fix.
However after doing this everything appears to be working perfectly.
Maybe I will find a hiccup down the road later? who knows?

Thought I would pass this on in case it helps someone.

Luke

17 Jul 2014, 3:34 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

Thanks for updating with the details of the solution :)

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

17 Jul 2014, 4:06 AM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

To also possibly chase things further if desired, knowing that the error was gone when the module was turned off, one could follow the code to see what path is taken when the module is on as compared to when it is off. Would need to identify the database constant that relates to the on/off feature, then search through the code using the developer's toolkit (assuming that the application installs files only in the location(s) searched by the same utility) and then trace through the differences. While I won't pretend to know every aspect of ZC1.5.3 that changed I have identified that database communication uses mysqli_ commands in place of mysql_ commands. Fyi, not all commands are a one-for-one swap. It is possible that even with the general.php file restored that other aspects of the program may not be obtaining the desired/expected result(s) if using the incorrect function. While this may/may not generate an error/warning in your log files, things may appear to be working properly. But at least there is no longer an error message on screen and the remaining actions occur. So, you may have completely fixed it, couldn't tell you, though I wonder if this also solves your address issue. :) (sorry for the "cross thread" post)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Mar 2015, 11:07 PM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,721
Plugin Contributions:
56

Re: Error after paypal redirect - Array([0]=>This transaction has already been captured

I know I'm late to this party but I thought I'd chime in. There are mucho changes required to Taxcloud for newer versions of ZenCart. The PR I submitted to them works for Paypal but not for Check/Money Order (*** sometimes!!***) - I'm still investigating. See https://github.com/taxcloud/ZenCart/pull/5

Update: you can read my wild-eyed conspiracy theory at the bottom of my PR.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.