115 pointsSerious WPMU DEV-sterI'm helpful
Chris M.
Member
—
25th January 2012 (3 months ago)
I've been using Pro Sites for a while with PayPal Express, but I finally signed up for PayPal Pro. When I enable it and try to upgrade a site, I get the following error:
Whoops, looks like you may have tried to submit your payment twice. You may have already paid! Check your subscripton info below to confirm
(Note the typo: subscription is misspelled.)
Nothing shows in the Account History table in the Pro Sites admin, and nothing is showing in my PayPal history either.
I had previously set that account to permanent status, and revoked it specifically for testing. I saw one other person mention this error, but they never posted a resolution.
I've been using Pro Sites for a while with PayPal Express, but I finally signed up for PayPal Pro. When I enable it and try to upgrade a site, I get the following error:
Whoops, looks like you may have tried to submit your payment twice. You may have already paid! Check your subscripton info below to confirm
(Note the typo: subscription is misspelled.)
Nothing shows in the Account History table in the Pro Sites admin, and nothing is showing in my PayPal history either.
I had previously set that account to permanent status, and revoked it specifically for testing. I saw one other person mention this error, but they never posted a resolution.
After a little more digging, I've narrowed it down to the credit card checkout nonce field. I can't for the life of me figure out why yet, but when the credit card field is printed, the nonce field that's printed is different than the nonce field that's stored in the usermeta table. I'll continue debugging. Any idea what might be causing this?
OK—I figured out what's going on. I'm using a WooThemes theme that includes the "WooNews" widget. This widget lists recent posts include excerpts, and I'm guessing it uses The Loop to do so. Pro Sites apparently loads itself into every loop on the designated page, thus calling nonce_field() once each loop (in this case 9 loops—1 for the main page and 8 in my sidebar).
I've temporarily fixed the problem by removing that widget from my upgrade page. But it's definitely a bug, and is likely to affect other WooThemes users…
8202 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
WPMU DEV Fanatic
—
25th January 2012 (3 months ago)
#
Hi Chris,
Thanks for digging into that one, definitely helps to get this sorted as that's not something we'd have caught in our own testing. I'll flag one of the developers on this to have a look.
7026 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Lead Developer
—
25th January 2012 (3 months ago)
#
Good catch, unfortunately I don't know if there is any way to work around other code that does things strangely. The plugin clears all hooks tied to 'the_content' filter to try to avoid this. But it seems your widget is somehow adding those hooks back in way later than they should.
Is there any add_filter('the_content' in that widget code? And does the widget print in the html before or after the checkout form?
I haven't tested this, but on line 616 of pro-sites.php you currently have:
if (!$this->get_setting('checkout_page') || get_queried_object_id() != $this->get_setting('checkout_page'))
return;
What if you changed this to:
if (!$this->get_setting('checkout_page') || get_the_ID() != $this->get_setting('checkout_page'))
return;
In other words, rather than checking the ID of the queried page, check the ID of the current page in the The Loop. That should fix this problem, and actually would make Pro Sites a little more flexible to very specific edge cases.
7257 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Support Chimp
—
5th February 2012 (3 months ago)
#
Hey there! :-)
Just checking in to see how things are going with this one and if you need any further help. :-)
We haven't heard from you on this thread for a while, perhaps you got help over email. I'm going to presume your all fixed up now and don't need any further assistance.
However if you have more questions or need some more help then please feel free to respond in this thread or create a new one and we will be more than happy to offer assistance. :-)
Responses (7)
Member — 25th January 2012 (3 months ago) #
After a little more digging, I've narrowed it down to the credit card checkout nonce field. I can't for the life of me figure out why yet, but when the credit card field is printed, the nonce field that's printed is different than the nonce field that's stored in the usermeta table. I'll continue debugging. Any idea what might be causing this?
Member — 25th January 2012 (3 months ago) #
OK—I figured out what's going on. I'm using a WooThemes theme that includes the "WooNews" widget. This widget lists recent posts include excerpts, and I'm guessing it uses The Loop to do so. Pro Sites apparently loads itself into every loop on the designated page, thus calling
nonce_field()once each loop (in this case 9 loops—1 for the main page and 8 in my sidebar).I've temporarily fixed the problem by removing that widget from my upgrade page. But it's definitely a bug, and is likely to affect other WooThemes users…
WPMU DEV Fanatic — 25th January 2012 (3 months ago) #
Hi Chris,
Thanks for digging into that one, definitely helps to get this sorted as that's not something we'd have caught in our own testing. I'll flag one of the developers on this to have a look.
-David
Lead Developer — 25th January 2012 (3 months ago) #
Good catch, unfortunately I don't know if there is any way to work around other code that does things strangely. The plugin clears all hooks tied to 'the_content' filter to try to avoid this. But it seems your widget is somehow adding those hooks back in way later than they should.
Is there any add_filter('the_content' in that widget code? And does the widget print in the html before or after the checkout form?
Member — 26th January 2012 (3 months ago) #
I haven't tested this, but on line 616 of pro-sites.php you currently have:
What if you changed this to:
In other words, rather than checking the ID of the queried page, check the ID of the current page in the The Loop. That should fix this problem, and actually would make Pro Sites a little more flexible to very specific edge cases.
Lead Developer — 26th January 2012 (3 months ago) #
That's a good idea, unfortunately the process_checkout is not in the loop. We'll have to put that check in the checkout_page function.
Can you test this? Change line 3278 to:
if (!in_the_loop() || get_queried_object_id() != get_the_ID())Support Chimp — 5th February 2012 (3 months ago) #
Hey there! :-)
Just checking in to see how things are going with this one and if you need any further help. :-)
We haven't heard from you on this thread for a while, perhaps you got help over email. I'm going to presume your all fixed up now and don't need any further assistance.
However if you have more questions or need some more help then please feel free to respond in this thread or create a new one and we will be more than happy to offer assistance. :-)
Take care.
Become a member