#gewibu_code

1 messages Β· Page 1 of 1 (latest)

sharp needleBOT
#

πŸ‘‹ 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.

thin saffron
#

Do you error handle?

#

Try this:

  if(result.token) {
    // do something
  } else if(result.error) {
    // handle error
  }
});```
halcyon osprey
#

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

thin saffron
#

and you never see this log line? console.dir('=== in result: ' + JSON.stringify(result));

halcyon osprey
#

No that log line is never executed

thin saffron
#

What is this.card?

halcyon osprey
#

this.card = elements.create('card', cardElementStyle);

#

const cardElement = this.template.querySelector('.card-element');
this.card.mount(cardElement);

thin saffron
#

Hm weird

#

idk what's happening

#

Would need a published test page or something to help debug further

halcyon osprey
#

Can I just hand you a zip file or the .js file to look at? What would you suggest?

thin saffron
#

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

halcyon osprey
sharp needleBOT
thin saffron
#

Hm can you share the plaintext actually

#

just the client-side code

#

Would rather not download zip for security reasons

halcyon osprey
thin saffron
#

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

halcyon osprey
#

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

halcyon osprey
#

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

timid willow
#

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.

sharp needleBOT
timid willow
#

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.