#just4skiillz-paymentsheet

1 messages · Page 1 of 1 (latest)

shadow belfryBOT
#

Hello! We'll be with you shortly. 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.

blissful mesa
#

Can you clarify what you're really trying to do?

tame echo
#

Hi, I have my webhooks and stripe cli on vscode working well
Im receiving my console.log in my stripe serverbut can I setup a useEffect when the event is realise like payment.intent.succeeded

#

to be as clear as possible since im french canadian,
I need to do some action in my frontend after the confirmation that payment event.type succeeded here is my code:
app.post("/stripe", async (req, res) => {
const sig = req.headers["stripe-signature"];
let event;
try {
event = await stripe.webhooks.constructEvent(
req.body,
sig,
process.env.STRIPE_WEBHOOK_SECRET
);
} catch (err) {
console.error(err);
res.status(400).json({ message: err.message });
}

// Event when a payment is initiated
if (event.type === "payment_intent.created") {
console.log("initated payment!");
}

// Event when a payment is succeeded
if (event.type === "payment_intent.succeeded") {
console.log(" succeeded payment!");
}
// Event when a setup is succeeded
if (event.type === "setup_intent.succeeded") {
console.log("paiement method registered!");
}
res.json({ allo: "allo", ok: true });
});

blissful mesa
#

You could do a websocket if you really want to, but is there a specific reason you need to do that? If you're using Payment Sheet then typically once the payment was completed you'd know that the sheet closed and you can re-retrieve the intent to confirm that the intent succeeded

tame echo
#

oh ok so after the payment.intent is pass I retrieve it to look at his status?

#

I tought the efficient way was to use the confirmation from the webhook

#

to tell all the story, I need to update a woocommerce order when the payment is confirmed, so i need to make an update request of my woocommerce resp api after the confirmation of the stripe pmt

#

i cannot use like the pluggin from the wordpress because im in react native mobile app

blissful mesa
#

If you just need to update your woocommerce order, why can't you do that directly from your webhook handler? Why do you also need to send that information back client-side?

tame echo
#

yes that is true i dontneed but what if i need the confirmation for the navigation to the thank you page?

#

then i use the retrieve pmt?

blissful mesa
#

Yeah, you could retrieve the payment

tame echo
#

ok ill try that thank you

blissful mesa
#

just4skiillz-paymentsheet