#morteza_webhooks

1 messages ¡ Page 1 of 1 (latest)

vague tulipBOT
#

👋 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/1313088152046534666

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

paper jackal
#

hi there!

#

if you want to know when the payment is successful, you should listen to payment_intent.succeeded

tired gust
#

even for tap to pay

#

?

paper jackal
#

for all integrations, if a payment is successful, you get payment_intent.succeeded

tired gust
#

ok, by the way I have another question

#

in react antive stripe when we make a purchase we have error and if it's null then it's considered as a success, can we consider it really as a success or we should wait for the webhook to get the real result ?

paper jackal
#

we have error and if it's null
what do you mean by this? what exact API call you made? what's the exact response you received from Stripe?

tired gust
#

we are using sdk

#

export default function CheckoutScreen() {
// continued from above

const openPaymentSheet = async () => {
const { error } = await presentPaymentSheet();

if (error) {
  Alert.alert(`Error code: ${error.code}`, error.message);
} else {
  Alert.alert('Success', 'Your order is confirmed!');
}

};

return (
<Screen>
<Button
variant="primary"
disabled={!loading}
title="Checkout"
onPress={openPaymentSheet}
/>
</Screen>
);
}

#

used like this

#

in else block can we say that payment was 100% successful or our backend should wait for webhook to know if it was really successful

vague tulipBOT
paper jackal
#

yes payment is successful in the else. but to actually fulfill your order, you should do that in your webhook endpoint

tired gust
#

what's the common way to handle this ? our front-end team check if payment was asuucessfull every 10 seconds and then announces payment as successful!!

mellow trail
#

It's fine to use the code you shared above. But I would still send a final email to the customer when you received the webhook and started fulfilling the order.

tired gust
#

nice

#

how can i know the success event was sent for pi_3QMtx3LmjdnG8GX01280lfh2

#

this is a payment done using tap to pay but we didn't receive success event from the webhooks

mellow trail
tired gust
#

yes we have

mellow trail
#

I am checking now and I don't see any webhook endpoints on your account listening to payment_intent.succeeded.

tired gust
#

what are available endpoints ?

mellow trail
tired gust
#

it's weired that tap to pay events used to be successful even with charge.succeeded

mellow trail
mellow trail
tired gust
#

I mean we didn't have payment_intent.succeeded

#

but it used to work

mellow trail
tired gust
#

and by the way charge.succeed has also been sent for this payment

mellow trail
#

Yes, that's expected to receive both types of events.

tired gust
#

ok then, we should check our webhoook

#

thank you