Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1752

Return error if attach cant complete

$
0
0

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;
      }

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1752

Trending Articles