• We are having problems with the checkout on our page. The placeholder for the payment iFrame isn’t removed. There are no errors in the web browser console. If I activate logging for Svea Checkout this is returned after the order information:


    2025-01-03T22:20:59+00:00 Info PID: #1455418 - Order creation resulted in the order 81905351
    2025-01-03T22:21:01+00:00 Info PID: #1455868 - Received push for order 81905351
    2025-01-03T22:21:01+00:00 Info PID: #1455868 - Received push for order we don't have yet. Standing by (81905351)

    We do not know how long this has been going on, but it might be all the way back in September.

    Setup:

    • Hosted on wordpress.com
    • Auto-updates on plugins
    • Only Norwegian API-keys

    Have tried:

    • Changing API-keys
    • Removing website cache
    • Reinstalling the plug-in
    • This topic was modified 2 months, 2 weeks ago by Kent Varmedal.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author The Generation

    (@thegeneration)

    Hi,

    The log is showing a typical example of the flow and isn’t necessary an issue in itself.

    However, it seems like the javascript that initializes the iframe isn’t being loaded on the checkout page. This is typically due to optimizing-plugins, are any such installed and active? If so, could you try disabling them all to see if the checkout loads again?

    Best regards

    Thread Starter Kent Varmedal

    (@kentav)

    There was one, have deavtivated it now without any change. This is hosted on wordpress.com, might that have anything to say?

    Plugin Author The Generation

    (@thegeneration)

    Hi,

    Svea reached out to us regarding your site with a bit more information and we could start to debug a bit.

    The underlying problem is that a part of the script that Svea responds with are being cut of before being injected on the checkout page. Our best guess is that it’s some kind of security measure but we’ve never encountered it before so we’re unsure on why it happens.

    On a local environment with your stores credentials we’re getting the complete response so it seems to be related to your environment.

    We’re unfortunately not able to debug much further since Automattic is managing parts of your website. Therefore we recommend that you reach out to them since we’re unable to further debug properly on your current setup.

    Best regards

    Thread Starter Kent Varmedal

    (@kentav)

    Automattic says that they can’t help us with third-party plugins, so we are currently in a difficult situation.

    I have a question, as I’m quite of a nerd. I have done a little digging. Should window.scoInitializeInjectedInstances() be called at any point in time? If I call this manually in the terminal, the window.scoApi becomes avalible and the iframe loads.

    Plugin Author The Generation

    (@thegeneration)

    Hi,

    Okay, it seems like it might’ve been a misunderstanding by Automattic on what you needed help with since it’s not really support for the plugin but rather why the script is being cut off.

    And you’re exactly right, that is the part that’s being cut off. This is the part that the Svea Checkout plugins injects to the checkout page (I’ve formatted the code and removed order IDs. This is also from a local environment using the staging API but the principle is the same)

    <div id="svea-checkout-container" data-sco-sveacheckout="" data-sco-sveacheckout-locale="en-IE" style="overflow-x: hidden; overflow-y: hidden;">

    <noscript> Please <a >enable JavaScript</a>. </noscript>

    <iframe id="svea-checkout-iframe" name="svea-checkout-iframe" data-sco-sveacheckout-iframeSrc="https://checkoutapistage.svea.com/b/index.html" scrolling="no" frameborder="0" style="display: none; width: 1px; min-width: 100%; max-width: 100%;"></iframe>

    </div>

    <script type="text/javascript" src="https://checkoutapistage.svea.com/merchantscript/index.js?v=2e39fc121a579822b165ccba4b88fe9a"></script>

    <script type="text/javascript">!function(e){var t=e.document,n=t.querySelectorAll("[".concat("data-sco-sveacheckout","]"));if(!n.length)throw new Error("No Svea checkout container exists on page");function c(){return!!e.scoInitializeInjectedInstances&&(e.scoInitializeInjectedInstances(),!0)}var o,i;c()||(o=0,e.setTimeout(i=function(){o+=1,c()||(o<150?e.setTimeout(i,20):[].slice.call(n).forEach(function(e){var n=t.createElement("div");n.innerHTML="Something went wrong, please refresh the page",e.appendChild(n)}))},20))}(window);</script>

    However in your case it seems like the last bit of inline script is being removed which we’re unable to debug since Automattic is preventing some plugins from being disabled.

    Please note that we can still see that the code is being returned by the Svea API on your site, it’s the checkout that simply won’t render it.

    Please ask Automattic to review this again and see why the inline script doesn’t work.

    Best regards

    Thread Starter Kent Varmedal

    (@kentav)

    I haven’t got any answer yet, but I am just doing some testing and found out that if I added a new line on line 323 in “inc/Template_Handler.php” (after the echo of this code):

    echo "<script></script>";

    Then the line you mentioned above and the one I added here are printed out. But it doesn’t work if it prints out any other html-tag. This is quite a weird bug.

    Plugin Author The Generation

    (@thegeneration)

    Hi,

    It sounds a bit strange, but I would still recommend you to wait for Automattic to review it again.

    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.