Stripe PaymentIntent integration API

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

UP, someone?

Hi,

I was able to locate an amazing forum post with instructions and examples on how to implement Stripe payment processing. You can check it out here . I hope this helps you out!

Good luck!

You are not helpful… this is payment intent, the old post is useful…

If you have solved the problem can you share the code publishing a forum post? I need this code too! Thanks!