#jogui_billing-confirmpayment

1 messages ยท Page 1 of 1 (latest)

candid wraithBOT
#

๐Ÿ‘‹ 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.

summer summit
#

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;
});

oblique birch
#

@summer summit what is that cstoken parameter you have in your code exactly?

#

jogui_billing-confirmpayment

summer summit
#

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.

oblique birch
#

yeah you can't pass the variable like that, it won't work. you have to do clientSecret: ... instead

summer summit
#

ouch, i really think i see the problem, it has to be clientSecret

#

totally, let me try, so embarassing

oblique birch
#

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)

summer summit
#

Exactly, as part as a migration, i left this be

#

thank you @oblique birch , sharp response ๐Ÿ™‚

oblique birch
#

happy to help ๐Ÿ™‚

candid wraithBOT