#rahul_docs

1 messages · Page 1 of 1 (latest)

wooden rapidsBOT
#

👋 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/1262905422805729452

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

frail locustBOT
#

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.

neat lily
#

hi again - found this, but the docs seem a bit out of date

sterile sierra
#

Hi there!

neat lily
#

i have a customer in test mode, who has 2 saved payment methods, and at least 1 has allow_redisplay set to always

#

When generating the element, this is the snippet of the code from react

<Elements
                            stripe={stripePromise}
                            options={{
                                appearance: {
                                    theme: "night",
                                },
                                clientSecret: paymentResponse?.paymentIntentClientSecret,
                                customerOptions: {
                                    customer: paymentResponse?.customerId,
                                    ephemeralKey: paymentResponse?.ephemeralKey,
                                },
                            }}
                        >
                            <CheckoutForm
                                event={event}
                                selectedTickets={selectedTickets}
                                paymentResponse={paymentResponse}
                            />
                        </Elements>
#

we pass in the customerId and the ephemeralKey

#

but it only renders the card input form

#

and there's no mention of saved payment methods

sterile sierra
#

Give me a few more minutes

neat lily
#

no worries - take your time, and appreciate any help at all 😅

Just dumping whatever we've used so i can avoid wasting too much of your time

sterile sierra
#

Since this is still in beta, you'll need to work with the beta team on this

neat lily
#

oh is this still part of the beta functionality? It's all over the docs

#

whoops 😬

sterile sierra
#

Actually, no, I think I'm wrong. This is being rolled out as we speak which is why it's all over the docs

neat lily
#

oh gotcha - if there's a good chance it'll be live tomorrow, I might just leave it for tomorrow

sterile sierra
#

Was still looking through some details on this. to be clear, are you using the mobile PaymentSheet?

neat lily
#

ok - on ios, we've already built this using customerSheet and it works awesome (built last week)

#

now we're trying to deploy the same flow on web

#

essentially following this https://docs.stripe.com/payments/save-and-reuse on the Web tab

#

and the Custom Payment Flow

#

https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements#save-payment-methods

sterile sierra
#

Right, okay. And you've gotten to the point of creating a CustomerSession in your backend?

neat lily
#

yup we're on that step

#

and i haven't fully reviewed the backend but on the frontend side, it defines the code as

const elementsOptions = {
  clientSecret: '{{CLIENT_SECRET}}',
  customerSessionClientSecret,
  // Fully customizable with appearance API.
  appearance: {/*...*/},
};
#

but the customerSessionClientSecret isn't defined anywhere in stripe's package on react

#

on the backend the code seems to be there (we're using Go and it's defined)

#

if something's being updated rn that would be awesome and i'd give whoever was in charge a big hug, but if not i'll just build it manually 😭

sterile sierra
#

Do you get an error if you just try to pass in both client secrets (for the SetupIntent and the CustomerSession)?

neat lily
#

the problem is that there's nowhere to pass in the customerSessionClientSecret

#

What we actually use

options={{
    appearance: {
        theme: "night",
    },
    clientSecret: paymentResponse?.paymentIntentClientSecret,
    customerOptions: {
        customer: paymentResponse?.customerId,
        ephemeralKey: paymentResponse?.ephemeralKey,
    },
}}
#

in the options object defined in the package, there is no customerSessionClientSecret

#

unless we're somehow using the wrong object

sterile sierra
neat lily
#

1 sec reviewing now

#
Object literal may only specify known properties, and 'customerSessionClientSecret' does not exist in type 'StripeElementsOptionsClientSecret'.ts(2353)

react-stripe.d.ts(671, 5): The expected type comes from property 'options' which is declared here on type 'IntrinsicAttributes & ElementsProps & { children?: ReactNode; }'
#

this is the error we're getting

#

the BaseStripeElementsOptions includes both customerOptions?: CustomerOptions; and customerSessionClientSecret?: string;

#

but for some reason on our end it's not being recognized

#
options={{
    appearance: {
        theme: "night",
    },
    customerSessionClientSecret: paymentResponse?.setupIntentClientSecret,
    clientSecret: paymentResponse?.paymentIntentClientSecret,
    // customerOptions: {
    //     customer: paymentResponse?.customerId,
    //     ephemeralKey: paymentResponse?.ephemeralKey,
    // },
}}

in this code, the customerSessionClientSecret has the error, but the customerOptions doesn't, even tho they're coming from the same place

sterile sierra
#

I don't think this is causing the error but the value of customerSessionClientSecret should be the client secret from a CustomerSession, not from a SetupIntent

#

The value of clientSecret should be either a PaymentIntent client secret or a SetupIntent client secret

neat lily
#

Yup - ignore the vars, just put them in as a random string

wooden rapidsBOT
neat lily
#

What are the odds it’s just our specific devices not loading the packages correctly? (Unlikely since I tested on 3 separate ones but just for the sake of completion)

sour geyser
#

hmmmm, actually i think it's because we just recently launched a new feature, and customerSessionClientSecret may not yet have been released in a new version yet. Gimme a while to take a look at the package

neat lily
#

I’ll wait a while - honestly if that’s the case that’s a huge relief, I’ve spent the last couple hours scouring the code to figure out what’s wrong and I have NOTHING

sour geyser
#

I think it'll be good to write in and we can keep you updated if that's really the case https://support.stripe.com/contact/email

#

Can you share your account id? You can find your account id by logging in to https://dashboard.stripe.com/settings/account. It'll be in the upper right hand corner and looks like acct_123

Once you've written in, let me know and I can find the support ticket and keep you updated

neat lily
#

Will do in a bit, thanks

#

Can I reference the discord thread @sour geyser in the email

sour geyser
#

sure, that's fine

neat lily
#

Thanks - just submitted

#

Our account id is acct_1KjazoAxoep4HrR2