#josh_api

1 messages ยท Page 1 of 1 (latest)

wary baneBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1347350399920898059

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

winter patio
#

Hello! Can you link me to a test case page where you're trying to load these so I can take a look?

pseudo echo
#

It's local development at the moment, so I don't I can at the moment, but I can share code

winter patio
#

Are there any errors in the web browser's console when you load the page?

pseudo echo
#

None at all it's so strange

winter patio
#

Go ahead and share your code here (make sure you redact your secret key if present) and I'll see if anything jumps out at me.

pseudo echo
#

This is the frontend javascript, the important HTML:

<main>
        <h1>Payments</h1>
        <div id="pgw" data-spk="{{ .StripePublishableKey }}">
            <div id="pgw-notify"></div>
            <div id="pgw-accmgmt"></div>
        </div>
        <div id="error" hidden></div>


   </main>
winter patio
#

What are you seeing in the console as far as the logs from the code above?

pseudo echo
winter patio
#

Try adding some additoinal log lines to follow the process. For example, above return clientSecret; add console.log('Returning clientSecret:', clientSecret);

pseudo echo
#

I have done that and I do get a client secret on refresh

winter patio
#

You can sprinkle in several more in various places to see where it's getting stuck and narrow down the issue.

#

Like if you log first thing inside StripeConnect.onLoad you can determine if that code is even being called or not.

pseudo echo
#

Both get called, do I need to call the authenticate method by any chance, I just assumed it would automatically open a window to authenticate a user

winter patio
#

I don't think so. Can you share your loadConnectAndInitialize code?

pseudo echo
#
window.StripeConnect = window.StripeConnect || {};
            StripeConnect.onLoad = () => {

                const stripeConnectInstance = StripeConnect.init({
                    // This is your test publishable API key.
                    publishableKey: pgw.dataset.spk,
                    fetchClientSecret: fetchClientSecret,
                });

                console.log('stripe connect onLoad called: ', stripeConnectInstance);
                /*
                const notificationBanner = stripeConnectInstance.create('notification-banner');
                notificationBanner.setCollectionOptions({
                    fields: 'eventually_due',
                    futureRequirements: 'include',
                })
                notificationBanner.setOnLoadError((loadError) => {
                    const componentName = loadError.elementTagName
                    const error = loadError.error

                    console.log(componentName + " failed to load")
                    console.log(`${error.type}: ${error.message}`);
                });
                notificationBanner.appendChild(pgwNotify);
                */

                const accManagement = stripeConnectInstance.create('account-management');
                accManagement.setCollectionOptions({
                    fields: 'eventually_due',
                    futureRequirements: 'include',
                })
                accManagement.setOnLoadError((loadError) => {
                    const componentName = loadError.elementTagName
                    const error = loadError.error

                    console.log(componentName + " failed to load")
                    console.log(`${error.type}: ${error.message}`);
                });
                accManagement.appendChild(pgwMgmt);
            };
#

I'm using Use Connect.js without npm