#Mariukas - test card exception

1 messages · Page 1 of 1 (latest)

obtuse pagoda
#

Interesting. And which test card is this for?

woeful sable
#

for successfull payment: 4242424242424242

obtuse pagoda
#

And the other card numbers work here?

woeful sable
#

and other card numbers doesn't work.

obtuse pagoda
#

Ah I see. Can you send me the code that is throwing this exception?

woeful sable
#

And this is nodejs express server

const stripe = Stripe(PRIVATE_KEY, { apiVersion: "2020-08-27" });

backend.post("/create-payment-intent", async (req, res) => {
    try {
        const paymentIntent = await stripe.paymentIntents.create({
            amount: 1099,
            currency: "eur",
            payment_method_types: ["card"],
        });

        const clientSecret = paymentIntent.client_secret;

        res.json({
            slientSecret: clientSecret,
        });

    } catch (e) {
        console.log(e.message);
        res.json({ error: e.message });
    }
})

backend.listen(port, "192.168.1.101", () => console.log(`server running on http://192.168.1.101:${port}`));
obtuse pagoda
#

Do you know where exactly in the client code the exception is being thrown?

woeful sable
#

When I use onChange={value => setEmail(value.nativeEvent.text)} I get this error.
But when I use just onChange={value => setEmail(value)} I get this error:

So I think there is the problem?

obtuse pagoda
#

And what is your setEmail function doing with that value?

#

Also are these three different errors? For the first one it sounds like paymentIntentClientSecret was not set, which means you should check in to if your fetching function is actually fetching it properly

woeful sable
#

omg...

#

It doesn't worked, because I misspelled.

#

Thank you for your patience... I fixed that. Have a nice day :)