#nshah97_unexpected
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/1439977148009156749
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- nshah97_error, 59 minutes ago, 24 messages
Forgot to mention, but im building a checkout page following this guide: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment?payment-ui=embedded-components#handle-payment-confirmation
Hi Dougal π
Hi toby π
Hello π can you tell me a bit more about the context behind wanting to override the email address that the customer provides? And what you're hoping to accomplish by doing that?
Building a sign up flow where in a single form I request email, password and billing information. Email is used to create a Stripe customer as well as user on our end. Password needed to create the user login info.
If a user enters in email + password, then decides to use gpay/apple pay, then the email they entered may be different to gpay/apple pay account. This would cause confusion for the user if the email they entered does not get used.
this is what ive tried
Hm, that looks like what I was going to suggest. Do you have object IDs from your testing that I can look at, and a publicly accessible test page where I can see this behavior?
This is a customer that was created after executing the above code^ cus_TRKzvlemz53jO0
dont have a publicly accessible page for this
Heres another : cus_TRLwLEd0YnZmnn
I'm defintely not seeing the email address from that code snippet being used. Do you have the minimal code needed for me to reproduce this on my end if I'm not able to hit a test site?
let me create some, one sec
import { ExpressCheckoutElement } from "@stripe/react-stripe-js";
import {
CheckoutProvider,
StripeCheckoutValue,
useCheckout,
} from "@stripe/react-stripe-js/checkout";
import {
loadStripe,
StripeExpressCheckoutElementConfirmEvent,
} from "@stripe/stripe-js";
const stripe = loadStripe("STRIPE_PUBLISHABLE_KEY");
const handleExpressCheckoutElementConfirm = async (
checkoutValue: StripeCheckoutValue | null,
event: StripeExpressCheckoutElementConfirmEvent
) => {
if (!checkoutValue) {
return;
}
const anotherEmail = "some_other_email@example.com";
console.log("Original email:", event.billingDetails?.email);
console.log("New email:", anotherEmail);
if (event.billingDetails) {
event.billingDetails.email = anotherEmail;
}
console.log(JSON.stringify(event, null, 2));
await checkoutValue.updateEmail(anotherEmail);
await checkoutValue.confirm({
expressCheckoutConfirmEvent: event,
email: anotherEmail,
});
};
const WalletCheckout = () => {
const checkoutState = useCheckout();
if (checkoutState.type !== "success") {
return null;
}
const checkoutValue = checkoutState.checkout;
return (
<ExpressCheckoutElement
onConfirm={(event) =>
handleExpressCheckoutElementConfirm(checkoutValue, event)
}
/>
);
};
export const MinimalCode = () => {
return (
<CheckoutProvider
stripe={stripe}
options={{
clientSecret: "CLIENT_SECRET",
}}
>
<WalletCheckout />
</CheckoutProvider>
);
};
this should work, you just need to populate the stripe key and client secret
^btw i tried checkoutValue.updateEmail as well and that didnt work either
Thanks, I'm going to step through this and play around with this flow on my end. If I find that I also can't get the email to update via that email field, then I'll file a bug with our team for that to be investigated. While I start doing that, as it may take a while, do you have this same problem is you just use the Payment Element for wallet payments? (I'm trying to think of shorrt term solutions if this is a bug)
Hmm let me try that
Re filing a bug, could you keep me updated via email? you can email me using the email that this customer has: cus_TRLwLEd0YnZmnn
Let's turn this into a support case, and I can email you once I've had enough time to sit down and try to reproduce. Our bot should DM you a link shortly
Okay sick, thanks a lot!
Hello @sonic hare, we have sent you a direct message, please check it at https://discord.com/channels/@me/1439988808538918985
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Perfect, I'll grab it or have my teammates assign it to me.
Sure, that works for me! I'll have a message to you today
cool thanks !