#Ayberk
1 messages ยท Page 1 of 1 (latest)
๐ How can we help?
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?
I'm developing mobil application so i don't have a domain or website url
You can use universal link for your mobile app: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
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
- Have we any universel link for android?
2.) You mean from frontend?
My paymentIntent from frontend is here, I already sent all of nodejs code.
You can't use PaymentIntent and Checkout Session together. They are two different integrations and you can only choose one
PaymentIntent is for collecting payment method using custom UI in your website: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Checkout Session is for payment collection on Stripe hosted page: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
They have no relationship with one another, so that's the reason why your PaymentIntent is not processed
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?
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
Have we any universel link for android?
Yup, there should be: https://developer.android.com/training/app-links
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?
I'll be stepping away and my coworker @indigo torrent will be taking over
Okey hi @indigo torrent