my route php Route::get('fan-tip-redirect/', [TipController::class, 'fanTipRedirect']);
my controller code in the file
my stripe redirect url ```js
<script type="text/javascript">
const options = {
clientSecret: '{{$client_secret}}',
// Fully customizable with appearance API.
appearance: {/.../},
};
// Set up Stripe.js and Elements to use in checkout form, passing the client secret obtained in a previous step
const elements = stripe.elements(options);
// Create and mount the Payment Element
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
const form = document.getElementById('payment-form');
form.addEventListener('submit', async (event) => {
event.preventDefault();
const {error, paymentIntent} = await stripe.confirmPayment({
//`Elements` instance that was used to create the Payment Element
elements,
redirect: 'always',
confirmParams: {
return_url: 'https://url.com/tip-status',
},
});
if (error) {
console.log(error);
const messageContainer = document.querySelector('#error-message');
messageContainer.textContent = error.message;
} else {
console.log('Intent gotten');
}
});
</script>