This code is from stripe docs and I feel like i sill just have to get all of the payment info on the payment success view via the client secret from stripe - (and create the payment instance there)
// Submit the payment to Stripe
const form = document.getElementById('payment-form')
form.addEventListener('submit', async (event) => {
event.preventDefault()
$('#submit').attr('disabled', true)
const { error } = await stripe.confirmPayment({
//`Elements` instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: 'http://127.0.0.1:8000/'
}
})
if (error) {
// This point will only be reached if there is an immediate error when
// confirming the payment. Show error to your customer (for example, payment
// details incomplete)
const messageContainer = document.querySelector('#error-message')
messageContainer.classList.add('alert', 'alert-danger')
messageContainer.innerHTML = '<i class="fas fa-exclamation-circle"></i> ' + error.message
$('#submit').attr('disabled', false)
} else {
// Your customer will be redirected to your `return_url`. For some payment
// methods like iDEAL, your customer will be redirected to an intermediate
// site first to authorize the payment, then redirected to the `return_url`.
}
})
This code is from stripe docs and I feel like i sill just have to get all of the payment info on the payment success view via the client secret from stripe - (and create the payment instance there)