#cashier_elements-onbehalfof

1 messages ¡ Page 1 of 1 (latest)

calm cometBOT
#

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

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

forest pewter
#

the frontend onBehalfOf matches the backend when I creating/confirmation PI step

desert saddleBOT
glass terrace
#

Hello

How are you passing on_behalf_of on the client-side?
Can you share the code?

forest pewter
#
  mountHTMLComponent (amount: number, currencyIsoCode: string, onBehalfOf: string | null): void {
    console.log('onBehalfOf: ', onBehalfOf)
    this.stripeElements = this.stripe.elements({
      mode: StripePaymentElementPaymentMode,
      amount: convertRegularAmountToStripeAmount(amount, currencyIsoCode),
      currency: currencyIsoCode.toLowerCase(),
      onBehalfOf: onBehalfOf,
      paymentMethodCreation: "manual",
      appearance: this.paymentElementAppearance(),
      fonts: PAYMENT_ELEMENT_FONTS
    });
    console.log('this.stripeElements._commonOptions: ', this.stripeElements._commonOptions)
  }
#

as you can see my debug output console.log('this.stripeElements._commonOptions: ', this.stripeElements._commonOptions) in picture, it does get correct onBehalfOf

glass terrace
#

I don't think its complaining about client-side missing on-behalf-of param. I think its complaining about something on your server-side missing this value. Most likely the confirmation token?

I'm not super familiar with this flow so give me a couple of minutes to look

forest pewter
glass terrace
#

Can you try removing server_side_confirmation_beta=v1 and secret_key_confirmation: "required" & see if that changes anything?

forest pewter
glass terrace
#

I was talking to a colleague about this and we noticed something weird with your ConfirmationToken creation request

https://dashboard.stripe.com/test/logs/req_Xtenfci6FouKMk

client_context parameter in the request body should also contain the onBehalfOf account ID you're adding, which is missing from your request.

In your code, is this.stripeElements getting reset/overridden somewhere? Your Element creation request is also missing onBehalfOf account ID
https://dashboard.stripe.com/logs/req_YRMHsk37eOlAqE

calm cometBOT
rustic jewel
#

cashier_elements-onbehalfof

#

@forest pewter also is there any way for us to see the page live? We've be able to look at the requests Elements make to see if anything jumps out

forest pewter
forest pewter
#

all good now. thank you very much. It seems my VCR keeps some invalid data to replay. sorry about that

rustic jewel
#

totally fine, VCR can be tough to debug. Glad you figured it out!