#balda_error
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1311686323865784330
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
this is the request to retrive clientSecret
{
Mode = "setup",
Currency = "eur",
UiMode = "embedded",
RedirectOnCompletion = "never"
}
and this is the response
{
"id": "cs_test_c1Er4OOFqBmNks3jNVXikSBCtzEWzzmLGQ7XcHfG3RszoBgIXwaH1GYlS6",
...
"client_secret": "cs_test_c1Er4OOFqBmNks3jNVXikSBCtzEWzzmLGQ7XcHfG3RszoBgIXwaH1GYlS6_secret_fidwbEhqYWAnPydgaGdgYWFgYScpJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknd2BhbHdgZnFKa0ZqaHVpYHFsamsnPydrYHNgdyd4JSUl",
...
"ui_mode": "embedded",
"url": null
}
hi! if you're trying to use Checkout you would not use stripe.elements in that way.
instead you use initEmbeddedCheckout in the way described at https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=embedded-form#mount-checkout
when i retrive clientSecret from server, i manage the secret in this way:
this.clientSecretStripe = data.response.clientSecret;
this.reservationAmount = this.penaltyFeeAmountTimeSlot;
this.stripe
.elements({ clientSecret: this.clientSecretStripe })
.subscribe((x) => {
this.elementsOptions.clientSecret = this.clientSecretStripe;
this.stripesElements = x;
this.stripePaymentElement = this.stripesElements.create(
'payment',
this.paymentElementOptions
);
this.stripePaymentElement.mount(this.stripeCard.nativeElement);
});
where am I going wrong in your opinion?
yeah none of that code would be what you would use if using Checkout.
that frontend code is for using PaymentElement. https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements
but the clientSecret and backend code you're using are for embedded Checkout : https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=embedded-form
they're different integrations and they need to match.
@granite sigil open your own thread through the form on #help
@graceful imp did that help, are things clearer?