#paulc-checkout-docs

1 messages ยท Page 1 of 1 (latest)

hardy tulip
#

Hey there, you mean payment_method_types right?

tough compass
#

Hello !
yes

#

This is how I am passing them :

#

const session = await stripe.checkout.sessions.create({
payment_method_types: ['card', 'ideal'],
mode: 'payment',
cancel_url: "https://something.com",
success_url: "https://something.com",
customer_email: "hello@oprimizeat.nl",
// data.email,
line_items: {
name: "Test_name",
price_data: {
unit_amount: 2000,
},
quantity: 1
}
})

hardy tulip
#

Can you share the request id of the error response, from the headers?

tough compass
#

yes sure

#

{"type":"StripeInvalidRequestError","raw":{"message":"Invalid array","param":"line_items","type":"invalid_request_error","headers":{"server":"nginx","date":"Thu, 11 Nov 2021 14:35:18 GMT","content-type":"application/json","content-length":"116","connection":"keep-alive","access-control-allow-credentials":"true","access-control-allow-methods":"GET, POST, HEAD, OPTIONS, DELETE","access-control-allow-origin":"","access-control-expose-headers":"Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required","access-control-max-age":"300","cache-control":"no-cache, no-store","idempotency-key":"45b025b6-eeb5-4e3c-82a0-4606f6c4442b","original-request":"req_wRR3yfDj4j9ZSM","request-id":"req_wRR3yfDj4j9ZSM","stripe-version":"2020-08-27","strict-transport-security":"max-age=31556926; includeSubDomains; preload"},"statusCode":400,"requestId":"req_wRR3yfDj4j9ZSM"},"rawType":"invalid_request_error","param":"line_items","headers":{"server":"nginx","date":"Thu, 11 Nov 2021 14:35:18 GMT","content-type":"application/json","content-length":"116","connection":"keep-alive","access-control-allow-credentials":"true","access-control-allow-methods":"GET, POST, HEAD, OPTIONS, DELETE","access-control-allow-origin":"","access-control-expose-headers":"Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required","access-control-max-age":"300","cache-control":"no-cache, no-store","idempotency-key":"45b025b6-eeb5-4e3c-82a0-4606f6c4442b","original-request":"req_wRR3yfDj4j9ZSM","request-id":"req_wRR3yfDj4j9ZSM","stripe-version":"2020-08-27","strict-transport-security":"max-age=31556926; includeSubDomains; preload"},"requestId":"req_wRR3yfDj4j9ZSM","statusCode":400}

#

This is the error from the curl post attempt

#

req_wRR3yfDj4j9ZSM

#

Sorry for the long error message

true heron
#

line_items: [{
name: "Test_name",
price_data: {
unit_amount: 2000,
}]

#

you pass object as line items not Array<Object>

#

Type is, line_items: {}[]

#

Thats why it says Invalid Array, just pass the same object inside []

tough compass
#

@true heron Damn ! Thats right ! Thank you so much , been twisting my brain for a while on this !

hardy tulip
#

Yep, was just going to share that its the line items array thats wrong, not the payment method types

#

thanks for the assist @true heron ๐Ÿ‘

true heron
#

yeah now synthrider can join my firend toby into finding out why cant verify greek ID documents' we have a list of 50 merchants waiting to be onboarded...

#

๐Ÿ™‚

tough compass
#

Oh success , thanks again both of you !!

hardy tulip
#

Very welcome