#Jordy

1 messages · Page 1 of 1 (latest)

open smeltBOT
thorn path
#

This chat is focused on developers and technical questions related to Stripe products. Is your question related to Stripe?

abstract stone
#

Yes

#

It's in regards to this message from Toby

thorn path
#

If there is an error with the request sending to Stripe API, you should wrap Stripe's functions with try-catch block. Are you implementing Stripe API directly or through third party?

abstract stone
#

Right now, third party but I'm famililar with the stripe api

#

It's being built through stripe.js in a no-code platform called bubble.io

thorn path
#

If you're using third-party (in this case bubble.io), you probably don't have the access to Stripe API functions for you to handle try-catch block directly. In the event if you do have the access, the example of try-catch on Payment Intents API on Node (https://stripe.com/docs/api/payment_intents/create?lang=node):

try {
  const paymentIntent = await stripe.paymentIntents.create({
    amount: 2000,
    currency: 'jpy',
    automatic_payment_methods: {enabled: true},
  });
} catch (error) {
  // Handle error
}

For Stripe.js (frontend/client side), here's an example code about how you can handle the error with stripe.confirmPayment: https://stripe.com/docs/js/payment_intents/confirm_payment