#morteza_webhooks

1 messages ยท Page 1 of 1 (latest)

static tuskBOT
#

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

static socket
#

Hi again Team

stiff violet
#

How can I help?

static socket
#

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

stiff violet
#

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

static socket
#

no

#

forget about Tap to Pay

stiff violet
static socket
#

this is for react native stripe, we use it in our online ordering platfom

stiff violet
#

I'd recommend being explicit about what it is you're building then when you ask us questions

static socket
#

we have a food ordering platform

#

and it's a react native app

stiff violet
#

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

static tuskBOT
stiff violet
#

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

static socket
#

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

stiff violet
#

As I said, I wouldn't recommend fulfilling the order there, but just show a UI that says the payment was successful yes

static socket
#

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

stiff violet
static socket
#

but we don't fulfill order, because its status might change ?

stiff violet
static socket
#

so in our scenario, we should't send the order to a shop untill the webhook responds with success ?

#

by shop I mean restaurant

stiff violet
#

Exactly, yes

static socket
#

so that success in SDK is not %100 success. it can be anything later failure, success,

stiff violet
#

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

static socket
#

right

distant moss
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

static socket
#

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

static socket
#

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

distant moss
#

in all cases you should rely on the webhook events for confirmation and fulfilment

distant moss
#

so you need make sure that the order is pending the async success/failure

static socket
#

users get a service at the barber for example and then make a purchase and leave the barber,

#

then what if payment status changes

distant moss
static socket
#

we are using react native stripe terminal

#

and app is installed on the cellphone

#

even that is sync ?

distant moss
#

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

static socket
#

so when we get success in sdk , it's 100% success

distant moss
#

if it's a terminal transaction then yes

#

which isn't available for tap to pay

static socket
#

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 ?

distant moss
#

yes

static socket
#

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 /

distant moss
#

you need to check whether the payment method is sync or async

#

let's say your customer choose to pay using SEPA

#

if you don't want to handle async payment methods you can pass allowsDelayedPaymentMethods: false, in your initPaymentSheet call

static socket
distant moss
#

yes it is