#nshah97_unexpected

1 messages Β· Page 1 of 1 (latest)

potent sealBOT
#

πŸ‘‹ 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.

sonic hare
#

Hi Dougal πŸ‘‹

potent sealBOT
sonic hare
#

Hi toby πŸ‘‹

vague island
#

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?

sonic hare
#

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

vague island
#

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?

sonic hare
#

This is a customer that was created after executing the above code^ cus_TRKzvlemz53jO0

#

dont have a publicly accessible page for this

sonic hare
vague island
#

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?

sonic hare
#

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

vague island
#

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)

sonic hare
#

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

vague island
#

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

sonic hare
#

Okay sick, thanks a lot!

potent sealBOT
#

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.
sonic hare
#

I've created it

#

the support ticket i mean ^

vague island
#

Perfect, I'll grab it or have my teammates assign it to me.

sonic hare
#

nice, thanks a lot!

#

Can i keep you updated re payment element via email ?

vague island
#

Sure, that works for me! I'll have a message to you today

sonic hare
#

cool thanks !