#carlos-offsession-error
1 messages · Page 1 of 1 (latest)
I'm using the confirmCardPayment component, in it I pass the off_session parameter to use the payment method informed in future payments.
what's not working, what's the exact error
The payment method has been attached but not used for future payments
wait
i think i found the problem
ah nice!
not working hahah
my code
is not setting as default payment method. At the time of subscription renewal fails
I'm sorry you gave a lot of screenshot, what's your real question?
async function handleConfirmCardPayment() {
const { error } = await stripe.confirmCardPayment(clientSecret ?? dadosModal.clientSecret, {
payment_method: {
card: elements.getElement(CardElement),
billing_details: {
name: holder,
},
metadata: {
"origem": "mensalidade"
}
},
setup_future_usage: 'off_session'
});
if (error) {
errorToast(error.message)
setLoading(false);
} else {
setTimeout(() => {
window.location.reload();
onClose();
sucessToast('Pagamento confirmado!');
}, 5000)
}
}
this is my code
sure but again what's the problem?
Can you summarize in one sentence the real issue, exact error and clear example request id/object id that is relevant?
I'm trying to set a default payment method but off_session I didn't set it, it just attaches the card to the customer
correct, that's how it always works, you have to set this yourself
the off_session parameter is not setting a default payment method for the subscription, it is just attaching to the client
what is off_session for then?