• Resolved angelleye

    (@angelleye)


    After updating WooCommerce to 2.4 (and now 2.4.1) I’m finding some problems with some payment gateways.

    PayPal Standard and Bank Transfer seem to work fine for me, but when I try Cash on Delivery I end up with this error on the checkout page: https://fiber.angelleye.com/temp/woocommerce-checkout-error.png

    When I use Firebug to look at the response we’re getting at that point I see this…

    <br />
    <b>Notice</b>:  Trying to get property of non-object in <b>/home/angelley/sandbox_woocommerce/wp-content
    /themes/mystile/functions/classes/class-wf-meta.php</b> on line <b>142</b><br />
    {"result":"success","redirect":"http:\/\/woo.angelleye.com\/checkout\/order-received\/3316?key=wc_order_55c9c1468c26b"
    }

    I also tried with the Twenty Twelve theme and it failed with that, too.

    With the PayPal for WooCommerce plugin I’m noticing a failure at the same place, but with a different PHP notice in the JSON result at checkout. Again, I get stuck at the WC checkout page like the screenshot I posted above, except this time Firebug shows the following as the JSON result…

    <br />
    <b>Notice</b>: get_formatted_legacy is deprecated since version 2.4! Use Item Meta
    Data is being called with legacy arguments instead. in <b>/home/angelley/sandbox_woocommerce/wp-includes
    /functions.php</b> on line <b>3391</b>
    <br />
    {"redirect":"https:\/\/www.sandbox.paypal.com\/cgi-bin\/webscr?cmd=_express-checkout&useraction
    =continue&token=EC-0F760745X3891812T","result":"success"}

    So again the JSON is not valid with that PHP notice getting included in it, and I wind up stuck on the checkout page.

    When I revert back to WooCommerce 2.3 these problems do not occur.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    The class-wf-meta will be resolved in 2.4.2. The woo framework throws a notice which we’re correcting and working around.

    The other one (get_formatted_legacy) is due to the gateway. I’ve hidden this notice for ajax requests to work around the issue while the plugin developer updates. https://github.com/woothemes/woocommerce/commit/5b786261e1454e16fd2deb3acb3826750506e613

    So COD is the only one I can get to work. Paypal wont work, or any other gateway. They all throw the same error as listed above. Does anyone have any ideas?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    jrewald2000 turn off extensions and post your own thread.

    Thread Starter angelleye

    (@angelleye)

    @mike Jolley, thanks for the info. I’m a little confused about the get_formatted_legacy issue, though. The plugin/gateway does not make use of that function anywhere at all, and it does not happen with WC 2.3. Not sure how it could be the gateway..??

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Its the item meta class being called with unsupported args which triggers it.

    Thread Starter angelleye

    (@angelleye)

    @mike Jolley, thanks again for the responses.

    I’m not seeing anything in the 2.4 changelog that would reflect a change with the way item meta data is handled. Can you give me any clues why this is happening in 2.4 but not in 2.3?

    Thread Starter angelleye

    (@angelleye)

    The notice is specific to version 2.4, so it seems like something changed here, but I’m still confused because it says “get_formatted_legacy is deprecated” (which we’re not using) and then the part that would typically tell us which function to use instead says “Use Item Meta Data is being called with legacy arguments instead.”

    So it seems as though the data provided in the notice doesn’t actually follow the format of the notice itself..??

    We’re digging into the plugin code to see if we can track down exactly how we’re passing item meta data into the order to try and track down what would be invalid, but if you could give me a tip about what exactly changed in 2.4 that might help. We have done nothing to change the way we’re handling item meta data, and again this isn’t a problem in 2.3.

    Also, even in 2.4, it seems that all of the item data is getting included on the order as expected, but of course we’re still seeing the PHP notice in the server logs. Hiding the notice for AJAX requests resolved the issue that was keeping us from completing checkout, so that’s good, but this notice is really confusing me.

    Any other detail you can provide would be greatly appreciated. Thanks!

    Thread Starter angelleye

    (@angelleye)

    I think we may have gotten it worked out.

    Hello, Angelleye,

    Can you please advise how you made it work. I have some similar problem regarding the get_formatted_legacy which is kind of blocking the payment gateway.

    Thank you.

    Thread Starter angelleye

    (@angelleye)

    I wish I could provide better detail for you, but all I can say is that one of my developers found a hook or a function or something we were using that was triggering these errors. He made an adjustment that solved it.

    I’ll see if I can dig up better info for you, but you may just need to track the steps of your code to find when exactly that is getting triggered. Then you should be able to find info on adjustments you need to make.

    Hi,

    Thank you for your advise. No need to dig it deeper. This info is helpful enough and I don’t want to waste any of your time.
    Thanks again. I will have a look at the hooks that are used.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Payment gateway issues after 2.4.1 update..??’ is closed to new replies.