#harshiliroid_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1248626218555805876
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Sorry I don't understand the question
That request id you provided is just a customer creation request
wait a minute i will explain you in brief
currently i am creating stripe payment testing api's for learning in this potion of time customer payment is sended but every time status is requires_action. managing status sending in server side so why status is not succeeded and and front end i using ejs.
attach code for batter understanding :
Can you share the request id where this is happening
server side api :
router.post("/chackout", async (req, res) => {
const { email, name, amount, token, PaymentMethodId } = req.body
try {
const customer = await stripe.customers.create({
email: email || 'testUser@gmail.com',
name: name || "123"
})
await stripe.paymentMethods.attach(PaymentMethodId, {
customer: customer.id,
});
await stripe.customers.update(customer.id, {
invoice_settings: {
default_payment_method: PaymentMethodId,
},
});
console.log(customer.id);
console.log(PaymentMethodId);
const payment = await stripe.paymentIntents.create({
payment_method_types: ['card'],
amount: 200,
currency: 'usd',
description: 'Example charge',
customer: customer.id,
payment_method: PaymentMethodId,
confirm: true,
description:"testing",
})
const intenteId = payment.id
console.log(intenteId);
const paymentIntent = await stripe.paymentIntents.retrieve(intenteId);
console.log(payment);
// if (error) {
// console.log(error);
// }
// else{
// console.log(paymentIntent);
// }
// console.log(stripe.charges);
// console.log(payment);
console.log({ client_secret: payment.client_secret });
return res.json({ client_secret: payment.client_secret })
} catch (error) {
res.send(error.message)
console.log(error);
}
})
which request id ?
Is there a guide you're following?
This flow isn't very common
Generally we recommend confirming payment intent client side
So that customer can handle any required actions like 3ds
(i bet that's what's happening here)
But I need to see the payment intent creation/confirmation's request id
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
yes sure
id: "req_DXiV1IdA71ay0Q"
Is there a guide you're following?
Yeah this is exactly what I thought
Payment required 3ds, which is extremely common
Is there a particular reason you need to finalize payment on the server? If not, I don't recommend you do this
@rough lynx
@rough lynx this is your thread
Keep messages in here
You keep messaging in somebody else's thread
No
I help run this server
You're the one who keeps messaging in the wrong thread
@rough lynx are you there?
Can I share my project with your help?
I don't need to see your project
I already see your code above
My question is the same
Is there a particular reason you need to finalize payment on the server? If not, I don't recommend you do this
no
Ok
It's much much easier to do this instead: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements