Return error if attach cant complete

I noticed something strange.

I ran tests in two web browsers (Firefox and SeaMonkey) on the following example code provided by the Square SDK (in public/examples/afterpay.html file) to try the afterpay system:

It seems things work in Firefox because the Afterpay button appears and when I click it, a new window pops up asking me to register for an Afterpay account.

But when I tried the same procedure in the latest Seamonkey brower, the attach function (before the return statement) never returns.

Is there a way to ensure that all functions return anything and not stall because of a web browser or a web browser version?

This is the problem fragment in the html file:

        async function initializeAfterpay(payments) {
        const paymentRequest = buildPaymentRequest(payments);
        const afterpay = await payments.afterpayClearpay(paymentRequest);
        await afterpay.attach('#afterpay-button');
        return afterpay;
      }

Did you inspect the page to see if there were any console or network errors? If there were error what’s the error message? :slightly_smiling_face:

I checked the console and saw no messages

Anything in the Network? :slightly_smiling_face:

It isn’t the network. When I did the tests on both browsers, they were done on the exact same computer no more than 5 minutes apart.

Right, but I’m wondering what network call isn’t working? :slightly_smiling_face:

As mentioned, this call does NOT work:

I cannot control the results of this call at my end unless I try to reverse-engineer the square.js file which I’m not about to do.

Is your page hosted? :slightly_smiling_face:

I load the following javascript file from a page on my server to use your functions and to display the google pay logo (when I use that payment option). But with AfterPay, the only time the logo appears is when I use Firefox, but when I use SeaMonkey, the logo does not appear…

https://web.squarecdn.com/v1/square.js

All other page components except for your functions are managed by my server.

Have you tried the SeaMonkey browser?

I’m using version 2.53.18.2 and it can be downloaded here:

https://www.seamonkey-project.org/

It might help you reproduce the issue at your end.