#jess_docs
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/1283121645652934688
📝 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.
- jess_docs, 5 days ago, 34 messages
Hmmm, I thought it did. Let me test and circle back to confirm
Wait, how are you adding the radio button to form?
Through the stripe payment options, I have type as accordion, radios = true?
Right, but you mentioned a checkbox that says "Save Payment Details for <company>."
Sorry it says “save payment details for future purchase”
Can you copy/paste your client-side code?
What are you looking for? The options I have set for the payment element?
Yeah, I'm just trying to understand how that radio button is showing up. I don't see it on mine. Is it for a specific payment method type?
Also a screenshot would help
I am referring to the checkbox that saves the payment details for the payment element
One sec
For card payments
What API version are you on?
Not quite sure
Um, I am using the customer client secret to save card information on the payment element
Right, but what code are you using to detect that the radio button was clicked? Can you copy/paste the relevant code snippets so I can repro? I'm just trying to understand why you're not getting an on('change') event emitted when it's clicked
<PaymentElement
id="payment-element"
options={options}
onChange={event => paymentElementOnChange(event)}
/>
const paymentElementOnChange = (event: StripePaymentElementChangeEvent) => {
console.log(event);
}
That’s basically it
Where in the rest of your code is that located? In the initialization function?
Hey there, just stepping in as twoshoes needs to head out.
Reading the backlog here and want to make sure i understand the situation to continue helping you.
You are:
1/ Using React
2/ Implementing the PaymentElement component
3/ Trying to use our built-in Saved Payment Methods feature
4/ For that feature, trying to detect when a customer has opted in to saving their payment method
Have I got that right?
Yes that’s right!
Thanks for confirming.
And further, you're observing that the PE change event is not fired by that checkbox state changing, and includes no details of its value.
Yes, exactly!
Got it. Thanks. Let me poke at this in my test integration.
Still digging into this, and short version is that I don't think there's currently a way to get at this directly, but there might be an alternative approach depending on your end goal
Can you explain briefly what you're trying to listen to this for? That is, what are you planning to do with the information if you can get it?
We would like to add a tracking event to the checkbox to indicate user has selected to save payment details
Can you say a bit more about that? Indicate to the customer beyond that checkbox itself, or for your own logging purposes?
Mostly for our own logging purposes
Also, because we may not require email addresses of our users in checkout, we did not use the link authentication element for collecting email addresses (in a previous post I asked stripe about the validation of this field as it is required if the component is present). Instead we used our own email collection input and we would like to use that checkbox to save email information to be reused in future checkouts
Got it, thanks for clarifying
I'm sharing this feedback internally to hopefully make this easier to access. In the meantime, as analternative you can consider the "two step" payment flow that involves creating a confirmation token to give you an opportunity to inspect details and present a summary to customers before final payment confirmation
https://docs.stripe.com/payments/build-a-two-step-confirmation#create-ct
As part of this, the confirmation token includes a representation of this selection by the customer as the allow_redisplay property: https://docs.stripe.com/api/confirmation_tokens/object#confirmation_token_object-payment_method_preview-allow_redisplay
Where you find allow_redisplay=always in that preview is where the customer as opted to save their payment method.