• Hello,

    since using Polylang the express button on the product page leads to an 404 error.
    The paypal window open up, disappears after some seconds and one get this error with a massive amount of html code after that:
    Error: Request to post https://example.com/wc-api/yith_paypal_ec/?yith_paypal_set_express_checkout=1 failed with 404 error. Correlation id: unknown

    Putting the /language/ slug like
    https://example.com/language/wc-api/yith_paypal_ec/?yith_paypal_set_express_checkout=1
    the link works.

    The website url configuration is like this:
    example.com/en/
    example.com/de/

    When I disable Polylang the express button works like expected also.
    Polylang is set to show /language/ for every page. I think the Yith plugin is not knowing about the new path structure as I had it installed and configured before I installed Polylang.

    De-installing the Yith plugin didn’t fix the issue and it seems it Yith keeps the seetings store somewhere even after deinstalling. Anyone have a hint how to fix this wrong fetching of the url?

    • This topic was modified 3 years, 6 months ago by mike8040.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Salvatore Strano

    (@salvostrano)

    Hi @mike8040
    We will check about this issue and in case we will an update to fix the problem

    Thread Starter mike8040

    (@mike8040)

    Just to be more specific. The Express button itself isn’t working on all pages that are selected in the settings but the regular checkout with Paypal as gateway does work. One gets redirected correctly in this case.

    Its seems I’m not the only one. There is a issue posted on github about this behavior with language slugs.

    https://github.com/hyyan/woo-poly-integration/issues/218

    A fix would be much appreciated. For now I disabled all Express buttons.

    Plugin Support Emanuela Castorina

    (@kreamweb)

    Hello there,
    the plugin sends to PayPal the “return_url” that is get calling this WooCommerce method

    WC()->api_request_url( 'yith_paypal_ec' );

    that you can find inside the class-woocommerce.php ( line 734 ).
    This url can be filtered using this filter ‘woocommerce_api_request_url’.

    I think that Polilang should fix it this issue with WooCommerce Api Url then automatically also the issue with Express Checkout will be fixed

    Thread Starter mike8040

    (@mike8040)

    Hey thanks for your feedback. Unfortunately this is out of my php knowledge what you are saying. Is there maybe any fix posted already I could try in the meantime till there is a permanent solution?

    Right now I get a strange behavior. Express button works with

    example.com/en/….

    but not with

    example.com/de/….

    where the last lang is most important. I get the popup window saying:

    “Since you were inactive for some time, we have logged you out for your safety. Go back to the dealer and start the checkout again.”

    The url for the /de/
    https://www.paypal.com/checkoutnow?locale.x=de_DE&fundingSource=paypal&sessionID=60a6333433_mji6ndk6mte&buttonSessionID=5dd0635251_mji6nte6mdq&env=production&fundingOffered=paypal&logLevel=warn&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWxvYmplY3RzLmNvbS9hcGkvY2hlY2tvdXQuanMifQ&uid=f78857e8XX&version=4&token=EC-REMOVED55S000141L&xcomponent=1#/checkout/genericError?code=SU5WQUxJRF9SRVNPVVJDRV9JRA%3D%3D

    Console errors:
    ppxo_unhandled_error
    (“RESOURCE_NOT_FOUND\ncallGraphQL/<@https://www.paypalobjects.com/api/xo/button.js?date=2021-4-25:2741:23\npromise_ZalgoPromise</_proto.dispatch@https://…)
    Uncaught Error: RESOURCE_NOT_FOUND
    callGraphQL https://www.paypalobjects.com/api/xo/button.js?date=2021-4-25:2741, ….
    ppxo_xc_ppbutton_error

    I don’t post the full error logs but can send them on request. This is with the sandbox mode.
    I had success in live mode with this code snippet in the function.php but it seems to not make a difference in sandbox mode.

    /** Fix PAYPAL IPN URL translated by polylang */
    function custom_rewrite_basic_wc() {
        add_rewrite_rule('^wc-api/(.+)/?', 'index.php?wc-api=$matches[1]', 'top');
    	}
    	add_action('init', 'custom_rewrite_basic_wc');

    Most important I would need to get it running with the /de/ language. I don’t need it for the /en/ language.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘404 error yith_paypal_set_express_checkout’ is closed to new replies.