My current component handles sending a payment order to my stripe account on the client-side. Everything seems to be working fine, but I'm struggling to find a way to retrieve the response or token from stripe containing the order details, which I need to send to my backend.
<script setup>
import {onMounted} from "vue";
let stripe = null
onMounted(async () => {
stripe = Stripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY)
})
const redirect = () => {
stripe.redirectToCheckout({
successUrl: 'http://localhost:8000/success',
cancelUrl: 'http://localhost:8000/cancel',
lineItems: [
{
price: import.meta.env.VITE_PHOTO_PRICE,
quantity: 2
}
],
mode: 'payment'
})
}
</script>
<template>
<div id="checkout" class="checkout">
<button @click="redirect">Pay now!</button>
</div>
</template>
Could there be any helpful information in the stripe checkout documentation that might address this issue?