#gewibu_code
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253704953235636374
π Have more to share? Add details, code, screenshots, videos, etc. below.
Do you error handle?
Try this:
if(result.token) {
// do something
} else if(result.error) {
// handle error
}
});```
we do this to handle potential errors:
console.dir('=== in result: ' + JSON.stringify(result)); const token = (result != undefined && result.token != undefined ? result.token : undefined); const error = (result != undefined && result.error != undefined ? result.error : undefined);
and you never see this log line? console.dir('=== in result: ' + JSON.stringify(result));
No that log line is never executed
What is this.card?
this.card = elements.create('card', cardElementStyle);
const cardElement = this.template.querySelector('.card-element');
this.card.mount(cardElement);
Hm weird
idk what's happening
Would need a published test page or something to help debug further
Can I just hand you a zip file or the .js file to look at? What would you suggest?
Yeah you can share your code here and I can see if anything stands out
But might need to see it live. We'll see
Hm can you share the plaintext actually
just the client-side code
Would rather not download zip for security reasons
oh sure, my bad!
One thing I forgot to suggest. Instead of doing:
const token = (result != undefined && result.token != undefined ? result.token : undefined);
const error = (result != undefined && result.error != undefined ? result.error : undefined);```
comment that all out
Then just have a basic console.log("test log") after the const result = await this.stripe.createToken(this.card); call
See if you see the log then
That will narrow down whether it actually is the createtoken call
or the JSON.stringify call getting stuck
So I'm not actually the one working on this code so you'll have to give me a little bit to let me coworker know and then I can report back with the results
So if you'll notice, that code was tried previously and I believe it is commented out further down in the file. Still, nothing in the try catch and no logs come through in the console output
Hi there π catching up on the context here as my teammate needed to step away.
import STRIPE_JS from '@salesforce/resourceUrl/StripeV3';
This line looks weird to me, is there a reason you aren't getting Stripe JS from us? I don't think we'll be able to speak to how a package provided by a third party is expected to function.
Some quick searching shows this seems to be the recommended way for adding Stripe JS to Salesforce integrations, where you save that as a static resource, but that directly contradicts our guidance of always getting the current version of stripe.js from us directly.
https://docs.stripe.com/js#:~:text=Include the Stripe.js script on each page of your siteβit should always be loaded directly from https%3A//js.stripe.com%2C rather than included in a bundle or hosted yourself
The only idea readily coming to mind here, is to regenerate your StripeV3 static resource to see if that pulls in a newer version of stripe.js and resolves this behavior.