#jess_docs

1 messages · Page 1 of 1 (latest)

sinful lotusBOT
#

đź‘‹ 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.

sonic halo
#

Hmmm, I thought it did. Let me test and circle back to confirm

#

Wait, how are you adding the radio button to form?

fierce holly
#

Through the stripe payment options, I have type as accordion, radios = true?

sonic halo
#

Right, but you mentioned a checkbox that says "Save Payment Details for <company>."

fierce holly
#

Sorry it says “save payment details for future purchase”

sonic halo
#

Can you copy/paste your client-side code?

fierce holly
#

What are you looking for? The options I have set for the payment element?

sonic halo
#

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

fierce holly
#

I am referring to the checkbox that saves the payment details for the payment element

#

One sec

#

For card payments

sonic halo
#

What API version are you on?

fierce holly
#

Not quite sure

#

Um, I am using the customer client secret to save card information on the payment element

sonic halo
#

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

fierce holly
#

<PaymentElement
id="payment-element"
options={options}
onChange={event => paymentElementOnChange(event)}
/>

sinful lotusBOT
fierce holly
#

const paymentElementOnChange = (event: StripePaymentElementChangeEvent) => {
console.log(event);
}

#

That’s basically it

sonic halo
#

Where in the rest of your code is that located? In the initialization function?

fierce holly
#

What do you mean by the initialization function?

#

This is what is printed out

dreamy shale
#

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?

fierce holly
#

Yes that’s right!

dreamy shale
#

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.

fierce holly
#

Yes, exactly!

dreamy shale
#

Got it. Thanks. Let me poke at this in my test integration.

dreamy shale
#

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?

fierce holly
#

We would like to add a tracking event to the checkbox to indicate user has selected to save payment details

dreamy shale
#

Can you say a bit more about that? Indicate to the customer beyond that checkbox itself, or for your own logging purposes?

fierce holly
#

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

dreamy shale
#

Got it, thanks for clarifying

sinful lotusBOT
dreamy shale
#

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.