#cashier_elements-onbehalfof
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/1255172560857858059
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, https://dashboard.stripe.com/test/logs/req_f5XGVvsJhm0jzI?t=1719260889 is linked to confirmation_token https://dashboard.stripe.com/test/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self&starting_after=1719260888-req_zMQs9CKLsrxmHG. Why the confirmation_token does not have onBehalfOf option? I am pretty sure I passed it in frontend payment element
the frontend onBehalfOf matches the backend when I creating/confirmation PI step
ok, the confirmation_token does not have onBehalfOf option, that's fine, https://docs.stripe.com/api/confirmation_tokens/object. but I did passed onBehalfOf to payment element js component, your backend side said it does not match, what's the reason?
Hello
How are you passing on_behalf_of on the client-side?
Can you share the code?
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
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
fine, please check https://dashboard.stripe.com/test/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self&starting_after=1719261324-req_LTzpMHZMGvCgQw and https://dashboard.stripe.com/test/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self&starting_after=1719260888-req_zMQs9CKLsrxmHG . thanks for your advice
well, you can check confirmation_token object docu, it does not have onBehalfOf property
Can you try removing server_side_confirmation_beta=v1 and secret_key_confirmation: "required" & see if that changes anything?
thanks for your suggestion. let me test
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
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
@rustic jewel thanks for your suggestion. actually https://dashboard.stripe.com/test/logs?method[0]=post&method[1]=delete&direction[0]=connect_in&direction[1]=self is passing ` "client_context": {
"mode": "payment",
"on_behalf_of": "acct_1HFVC8LNz3uMms8Y",
"currency": "hkd"
}. now. let me testing again. thank you
all good now. thank you very much. It seems my VCR keeps some invalid data to replay. sorry about that
totally fine, VCR can be tough to debug. Glad you figured it out!