#jogui_billing-confirmpayment
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1252649092048486483
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
The total frontend code is:
stripe
.confirmPayment({
elements,
cstoken,
confirmParams: {
payment_method_data: {
billing_details: {
name: nameInput.value,
email: vueInstance.userEmail,
address: {
country: vueInstance.form.countryIso,
postal_code: vueInstance.form.postalCode,
},
},
},
return_url: window.location.origin + "/premium",
},
})
.then(function (result) {
if (result.error) {
console.log(result.error);
vueInstance.stripeFormError = result.error.message;
} else {
//OK! return_url will be executed! This is legacy and must be deleted when implementation is validated.
// window.location.href = "/premium";
}
vueInstance.isPurchaseProcessing = false;
});
@summer summit what is that cstoken parameter you have in your code exactly?
jogui_billing-confirmpayment
I get the clientSecret from the backend and pass it to the frontend:
String clientSecretToken = subscription.getLatestInvoiceObject().getPaymentIntentObject().getClientSecret(); this has a value like "pi_xxxxx..."
In frontend:
stripe.confirmPayment({elements,cstoken,confirmParams}) where cstoken is the "pi_xxx" value.
yeah you can't pass the variable like that, it won't work. you have to do clientSecret: ... instead
ouch, i really think i see the problem, it has to be clientSecret
totally, let me try, so embarassing
no it's not exactly that. It's that if you either name your variable exactly clientSecret and you can pass ..., clientSecret, ... or you have to be explicit about which parameter/option it is by passing clientSecret: cstoken for example.
It's some weird JS magic (I don't like those things either lol)
Exactly, as part as a migration, i left this be
thank you @oblique birch , sharp response ๐
happy to help ๐