Stripe - Axios - NodeJS #14411
Unanswered
Cabezagithub
asked this question in
General - Components / Directives / etc
Replies: 1 comment 1 reply
-
|
I suggest you ask this question on Stripe or Axios repos, as this has not much to do with Quasar itself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can I "Redirect" to Stripe CheckOut Payment URL after execute Axios Post to API Rest developed in Nodejs?
Quasar-VUE
const pago = async () => {
const resultpago = null
try {
const resultpago = await api.post('stripe_test/create-checkout-session')
} catch (error) {
console.log('Error : ', error)
}
API Rest - NodeJS
// Check Out Session
router.post('/create-checkout-session', async (req, res) => {
const domainURL = process.env.DOMAIN
const quan = 3
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [
{
price: 'price_1LhAlpEFYo4ca6813G3rVzyB',
quantity: quan
},
],
// ?session_id={CHECKOUT_SESSION_ID} means the redirect will have the session ID set as a query param
success_url:
http://localhost:8080/pagoexitoso,cancel_url:
http://localhost:8080/pagocancelado})
return res.redirect(303, session.url)
})
https://checkout.stripe.com/c/pay/cs_test_a1Ch1Yd2UWJTdBzLbFUbqlmdg07veMiKmmxdaZlzPaYCPIL2h4ojwyDOcG#fidkdWxOYHwnPyd1blpxYHZxWjA0SVFWYklAQ1xqMWZkMz00d1VCalxmM21cZ2hVbF9wcHZHVzZRcWF2bDA1UUpiaWB1MG0zaD1cN191XWB1XWZ0XzJAb0JPdmlHSVVAS19CR1I3dXB1U25hNTVQXX9jZGZ0XCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl
Any suggestion will be appreciated.
Really thank.
Beta Was this translation helpful? Give feedback.
All reactions