#morteza_webhooks
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/1359119355685638388
๐ 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.
- morteza_webhooks, 33 minutes ago, 41 messages
Hi again Team
How can I help?
Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes, and malicious clients could manipulate the response. Setting up your integration to listen for asynchronous events is what enables you to accept different types of payment methods with a single integration.
this part
What am I checking?
What about it?
I'm not sure how that block of text is relevant to your Tap to Pay integration. That's what you're building, right? You said Tap to Pay in the last thread
this is for react native stripe, we use it in our online ordering platfom
I'd recommend being explicit about what it is you're building then when you ask us questions
Then yes you want to leverage webhooks for payment/order fulfilment
The critical difference between you don't control the buying surface (the app). The user could quit etc, as noted, so any critical logic shouldn't run in a callback
You'd just render a order confirmation UI or something in the callback, but do the actual order fulfilment in the webhook handler when you receive the payment_intent.* event
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>
);
}
in here and in else block, can we say that payment was successful ??
Alert.alert('Success', 'Your order is confirmed!');
this part
As I said, I wouldn't recommend fulfilling the order there, but just show a UI that says the payment was successful yes
not fulfilling, just wanna know if in that block payment is successful or nor
business say that they have had situations in which in client app they have got success but webhook was pending and finally reponded with failure
Yes, you can infer that payment was successful
but we don't fulfill order, because its status might change ?
Sounds like an async/delayed payment method (not a card) which can happen
The 'confirmation' succeeds, the intent transition to pending/processing, and can succeed/fail async. Which is why you need webhooks
https://docs.stripe.com/payments/payment-methods#payment-notification
so in our scenario, we should't send the order to a shop untill the webhook responds with success ?
by shop I mean restaurant
Exactly, yes
so that success in SDK is not %100 success. it can be anything later failure, success,
Well as I said, it depends on the payment methods that was used to pay. If it's card then it can't fail async. If it's SEPA or another banking method, it can
right
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
so what do u suggest , should I check payment method on the client side and in sdk success do something about it or for all payment methods I should do business login in webhook response ?
Hi Tarzan
pleas help me understand this
you see this, this is part of React Native Stripe SDK integration
in here we have a success and error, in our food ordering platform, when we get a success , can we truest that payment was %100 successful or we should still check the webhooks and do order confirmation, fulfilment there
@distant moss
in all cases you should rely on the webhook events for confirmation and fulfilment
but as my colleague explained there are some payment methods that can succeed/fail asynchronously
so you need make sure that the order is pending the async success/failure
if this is case, what we should do for tap to pay application ?
users get a service at the barber for example and then make a purchase and leave the barber,
then what if payment status changes
tap to pay is a sync payment method
we are using react native stripe terminal
and app is installed on the cellphone
even that is sync ?
card_present is a sync payment method
meaning that when the customer taps their card on your mobile phone
the information is sent to the card network and we check whether the issuing bank authorizes the transaction or not
so when we get success in sdk , it's 100% success
if it's a terminal transaction then yes
unless you're accepting offline payments https://docs.stripe.com/terminal/features/operate-offline/overview
which isn't available for tap to pay
ok, so to wrap up, for online payments like food ordering platform we have to rely on webhooks
and for tap to pay sdk response is enough
am ?I right ?
yes
great
in food ordering scenario
user enters their cards detail, we get success from sdk, we just show user that their order placed, we then get response from webhook and send an email to user that their order is being procced right /
you need to check whether the payment method is sync or async
let's say your customer choose to pay using SEPA
https://docs.stripe.com/payments/sepa-debit/accept-a-payment?web-or-mobile=web&payment-ui=elements#web-confirm-success
the PI would still be in processing status
if you don't want to handle async payment methods you can pass allowsDelayedPaymentMethods: false, in your initPaymentSheet call
instead of doing this, isn't a better to rely on webhook for all payment methods ?
yes it is