#just4skiillz

1 messages · Page 1 of 1 (latest)

prisma marlinBOT
turbid steeple
#

You create a PaymentIntent, pass in the PaymentMethod's ID to the payment_method parameter and also pass confirm=true, this doc demonstrates how to do that

pallid zenith
#

and after the payment succeed event I update the order status to paid...but how to link the paiement to the order in the woocommerce?

#

are you still there?

turbid steeple
#

Apologies. Still there but talking to a bunch of people, server is a bit busy this morning

#

Unfortunately we don't develop Woo's integration so I don't know how to interact with their ideas of payments and orders. If you reach out to Woo's support they should be able to advise you on that

pallid zenith
#

ok ty

#

but you didn"t link me the doc for the paiement intent

#

I have this:
const payment = async () => {
try {
const response = await fetch(http://${IP_Address}:4000/pay, {
method: "POST",
body: JSON.stringify({ name, amount: roundedTotal }),
headers: {
"Content-Type": "application/json",
},
});
const data = await response.json();
if (!response.ok) return Alert.alert(data.message);
const clientSecret = data.clientSecret;
const initSheet = await stripe.initPaymentSheet({
paymentIntentClientSecret: clientSecret,
customFlow: true,

    merchantDisplayName: "Merchant Name",
  });
  if (initSheet.error) return Alert.alert(initSheet.error.message);
  const presentSheet = await stripe.presentPaymentSheet({
    clientSecret,
  });
  if (presentSheet.error) return Alert.alert(presentSheet.error.message);
  Alert.alert("Payment complete, thank you");
} catch (err) {
  console.error(err);
  Alert.alert("Something went wrong, try again later!");
}

};
but How can I update it to pay with the pmt method id?

turbid steeple