#Ayberk

1 messages ยท Page 1 of 1 (latest)

sharp nymphBOT
verbal steppe
#

๐Ÿ‘‹ How can we help?

nocturne idol
#

hi

#

i'll explain need 1 min :D

#

yesterday i have a problem about status parameter. And i follow your tuttorial or information link and i add this commands:

app.post('/create-checkout-session', async (req, res) => {
const session = await stripe.checkout.sessions.create({
line_items: [
{
// Provide the exact Price ID (for example, pr_1234) of the product you want to sell
price: req.body.bookid,
quantity: 1,
},
],
mode: 'payment',
success_url: "www.google.com",
cancel_url: "www.youtube.com",
});

      res.redirect(303, session.url);
    });

    app.listen(4242, () => console.log('Running on port 4242'));

the google and youtube link is just for example. I'm developing mobil application so i don't have a domain or website url. When purchase was successfully or not doesn't matter the status parameter still like ''requires_source''. I need to basicly if the purchase successfully it should be succeed and if not it should be declined or something. Whats my wrong right here?

And the second question, i already give feedback about the purchase progress on my front end should I have to use success_url and cancel_url parameter?

verbal steppe
#

When purchase was successfully or not doesn't matter the status parameter still like ''requires_source'
Can you share the payment intent?

#

should I have to use success_url and cancel_url parameter?
success_url and cancel_url are required in Checkout Session creation

nocturne idol
verbal steppe
#

You can't use PaymentIntent and Checkout Session together. They are two different integrations and you can only choose one

#

They have no relationship with one another, so that's the reason why your PaymentIntent is not processed

nocturne idol
#

hmm yesterday i don't had this command lines but its still like was now so u mean i should delete i deleted it okey. Basicly i need to when customers purchase to something from my app with paymentIntent i need to check the purchase progress and if its success do something, if its not do someting so i have to check the status parameter. But the status parameter still giving ''requires_source''. Why is like this?

verbal steppe
#

The PaymentIntent you created here is never used to make a payment. Instead, the payment is made on the Checkout Session. That's why the PaymentIntent is still requires_source state, i.e. need payment methods.

If you wish to find out the payment outcome, you should use webhook and listen to checkout.session.completed event: https://stripe.com/docs/payments/checkout/fulfill-orders

nocturne idol
#

Okey I guess got it, I should delete of my frontend and revise the nodejs then I should get information to frontend from nodejs right?

verbal steppe
#

I'll be stepping away and my coworker @indigo torrent will be taking over

nocturne idol
#

Okey hi @indigo torrent

vapid pawn
#

Hi! I'm taking over this thread.

#

Could you try to summarize your question while I catchup?

nocturne idol
#

I already did it but i can do it for you again

#

Could you see my docs about node js?