#niraj-p_error

1 messages ¡ Page 1 of 1 (latest)

leaden knollBOT
#

👋 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/1400424949532983376

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

proud harbor
#

Where is this error thrown? That's an internal API object, you shouldn't be interacting with that directly

sullen depot
#

It is throwing error when i mount stripe payment element with adaptive pricing.

proud harbor
#

Can you share the exact code that youy're using that throws the error?

sullen depot
#
this.elements = await this.stripeV3.initCheckout({
                fetchClientSecret: () => this.getClientSecret(clientSecret),
                elementsOptions: { appearance: STRIPE_APPEARANCE_ELEMENT },
            });
            this.paymentElement = this.elements.createPaymentElement();
            this.paymentElement.mount('#payment-element');
            const currencySelectorElement = this.elements.createCurrencySelectorElement();
            currencySelectorElement.mount('#currency-selector');

I am using above code

proud harbor
#

What's the value of clientSecret?

sullen depot
#

cs_test_a1aON10YVpTTA4C2ltIiJzrBKsro33tZpsYLHg9u6vdW4XM1EqHP7zJVHN_secret_fidwbEhqYWAnPydmcHZxamgneCUl

checkout session client secret

proud harbor
#

Can you share the code you use to init Stripe.js?

sullen depot
#
this.stripeV3 = Stripe(pk, { betas: ['custom_checkout_adaptive_pricing_2'], locale: this.currencyCode || 'auto', });
proud harbor
sullen depot
#

No it was created by connected account platform key

#

It was all working good till now

proud harbor
#

The creation request was made via the keys from acct_1FixTpHWMWhDPqNo

#

You pass the Stripe-Account header on that creation request for acct_1ESLU7DMHyYK6LSZ

#

You'll need to add stripeAccount: 'acct_1ESLU7DMHyYK6LSZ' to your Stripe.js init code

sullen depot
#

Let me check

leaden knollBOT
thin hamlet
#

hi! I'm taking over this thread. let me know if you have other questions.

sullen depot
thin hamlet
#

yes you need to platform keys, and also set the Stripe-Account header to the connected account ID.

sullen depot
thin hamlet
#

what do you mean? do you get an error? if so, which one?

#

it should look like this:

sullen depot
#

But it is working fine with the other checkout sessions and it was also working fine till now i'm facing this issue right now

thin hamlet
#

I don't reallt follow. If you create a Checkout Session on a Connected account, using a Direct Charge (like you did with cs_test_a1aON10YVpTTA4C2ltIiJzrBKsro33tZpsYLHg9u6vdW4XM1EqHP7zJVHN_secret_fidwbEhqYWAnPydmcHZxamgneCUl)
Then you also have to use the Stripe-Account header when initializing Stripe.js

sullen depot
thin hamlet
#

can you try with a different browser? it's working fine on my end.

sullen depot
#

Okay, it's working now

#

I didn't update anything on my end and now it working fine with the element

#

I guess there might be a temporary issue from stripe