#josh_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- josh_unexpected, 2 days ago, 21 messages
Hello! Can you link me to a test case page where you're trying to load these so I can take a look?
It's local development at the moment, so I don't I can at the moment, but I can share code
Are there any errors in the web browser's console when you load the page?
None at all it's so strange
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.
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>
Also I include the connect js script:
<script src="https://connect-js.stripe.com/v1.0/connect.js" async></script>
What are you seeing in the console as far as the logs from the code above?
Try adding some additoinal log lines to follow the process. For example, above return clientSecret; add console.log('Returning clientSecret:', clientSecret);
I have done that and I do get a client secret on refresh
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.
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
I don't think so. Can you share your loadConnectAndInitialize code?
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