• Resolved alesel

    (@alesel)


    Hi, with some common and famous plugin for woocommerce (that enable checkout personalization), your plugin cannot work for a bug i found in the JS.

    assets/js/revolut.js?ver=3.0.1

    Line 170

    i see:

    function getAjaxURL(endpoint) {
            return wc_revolut.ajax_url.toString() + '=wc_revolut_' + endpoint;
        }
    

    this line is wrong because the base AJAX URL could be modified by other plugins that added some querystring VAR in the url.
    so, for example, if the base ajax_url became:

    "/?wc-ajax&wfacp_id=2784&wfacp_is_checkout_override=yes"

    then the getAjaxURL(“process_payment_result”) function will return

    “/?wc-ajax&wfacp_id=2784&wfacp_is_checkout_override=yes=wc_revolut_process_payment_result
    that obviously is an invalid url and is causing checkout to return an “INVALID RESPONSE” ERROR.

    Solution pourposed: split querystring of ajax_url or REGEX-replace wc_ajax querystring param in the ajax_url to inject your endpoint var.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter alesel

    (@alesel)

    I’ve tested a quick fix (very ugly) in revolut.js and it worked, so i can confirm the problem is here.

    function getAjaxURL(endpoint) {
            return wc_revolut.ajax_url.toString() + '&wc-ajax=wc_revolut_' + endpoint;
        }
    

    in this UGLY way, wc-ajax param in the querystring get duplicated and overwritten… but it is not a good practice. the best would be to add your endpoint where the wc-ajax param appear the first time in the url, checking also if it is already valued (in this case an error could be returned)

    Plugin Author revolutbusiness

    (@revolutbusiness)

    Hello @alesel

    Thanks for contacting our team and for your report!

    Our technical team reviewed this point and we will add a fix for this case on the next release.

    Best regards!

    Plugin Author revolutbusiness

    (@revolutbusiness)

    Hi @alesel

    The new version has been launched (3.0.2) which contains an update for the above case. Could you please test it and let us know the result? We will close this ticket based on your response.

    Best regards!

    Thread Starter alesel

    (@alesel)

    Yes it seems to work flawless!
    Great job!

    thanks much.

    Plugin Author revolutbusiness

    (@revolutbusiness)

    Dear Alesel,

    Would you consider rating our plugin and the effort of the support team?
    It will take only 60 seconds to go to the link below:

    https://www.ads-software.com/support/plugin/revolut-gateway-for-woocommerce/reviews/

    We really try our best in order to improve our payment extensions.Positive reviews from awesome users like you would motivate our support team and help others to feel confident about choosing our Payment gateway too.

    Please do not hesitate to write to us, if you have any questions.

    Best regards!

    Thread Starter alesel

    (@alesel)

    sure, did it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Important BUG in revolut.js – Checkout cannot work.’ is closed to new replies.