#mudassir.dev

1 messages · Page 1 of 1 (latest)

vagrant cloakBOT
sand thistle
#

Hi there 👋 can you tell me more about what you're experiencing? Are you referring to client secrets (secret keys are something different)?

languid kettle
#
              customer: user["stripeCustomerId"],
              payment_method_types: ["card"],
            });
            const clientSecret = setupIntent.client_secret;
            // create ephermal key
            const ephemeralKey = await stripe.ephemeralKeys.create(
              { customer: user["stripeCustomerId"] },
              { apiVersion: "2020-03-02" }
            );
            res.status(200).json({
              status: true,
              setupIntent: true,
              clientSecret,
              ephemeralKey: ephemeralKey.secret,
              customer: user["stripeCustomerId"],
            });```
#

This is my code

#

and this is the response I get

#

When I initilize the payment sheet I get an error saying key format is incorrect. And previously when I was working with setupintents the key didn't start with pi

#

so I think that's the issue but I can't figure out what's causing it

sand thistle
#

Can you share the ID of a request where you're seeing that? The code you have written should definitely create a Setup Intent. Are you sure you're hitting the right endpoint on your end?

languid kettle
#

Can you elaborate more on what ID

#

And yes I am sure

#

This is the error I get when I initialize onResponse: Payment Failed java.lang.IllegalArgumentException: Invalid Setup Intent client secret: pi_3NTmTNJDsF3FhY2a1LfW6aD1_secret_vQLG8FT56sAOT67LEnFjnfEut

sand thistle
languid kettle
#

Hi the issue got fixed. Thanks

#

You may close the thread