Hello guys, i am trying to make an integration with stripe’s api, but I can’t figure it out:
This is the error I get:
code: "parameter_unknown"
doc_url: "https://stripe.com/docs/error-codes/parameter-unknown"
message: "Received unknown parameter: object Object"
param: "object Object"
type: "invalid_request_error"
This is my code in the backend:
export async function charge(amount) {
const response = await fetch("https://api.stripe.com/v1/payment_intents", {
method: 'post',
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Bearer " + apiKey
},
body: {
"currency": "eur",
"amount": amount
}
});
// transaction failed - return error type
const ret = await response.json();
return ret;
}
I don’t see any “object” as you can see.
Thanks
STRIPE API: Stripe API reference – Create a PaymentIntent – curl