As you can imagine I´m currently setting up the payment API with using Stripe. Problem is, I´ve never done such thing before and am following the docs pretty much 1 by 1.
So I require stripe using (100% the right!) key.
const stripe = require("stripe")(
"keyhere"
);
create the intent in a method...
const paymentIntent = stripe.paymentIntents.create({
amount: process.env.AUDIT_PRICE,
currency: "eur",
automatic_payment_methods: { enabled: true },
});
call that method on a certain express route:
exports.createNewCashOrder = async (req, res) => {
const intent = await paymentIntent();
res.json({ client_secret: intent.client_secret });
};
The rest is irrelevant for now, since my backend server doesn´t even start on localhost. Actually it´s live for like 0.001 seconds and than crashes with this error:
StripeInvalidRequestError: No valid payment method types for this Payment Intent. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard
It also sends back a large error object, where at the end it says that pretty much everything (also the payment methods) are undefined.
Now on my dashboard, I did activate card payment, but it obviously somehow does not recognize it...
Any ideas what I´ve done wrong? Glad for any help, thanks!
