Expected behaviour
When using the Stripe List Checkout Session Line Items
server action it’s throwing an error:
{
"status": "500",
"message": "Stripe: Argument \"session\" must be a string, but got: [object Object] (on API request to `GET /checkout/sessions/{session}/line_items`)",
"stack": "Error: Stripe: Argument \"session\" must be a string, but got: [object Object] (on API request to `GET /checkout/sessions/{session}/line_items`)\n at /opt/node_app/node_modules/stripe/lib/makeRequest.js:29:13\n at Array.reduce (<anonymous>)\n at getRequestOpts (/opt/node_app/node_modules/stripe/lib/makeRequest.js:26:29)\n at /opt/node_app/node_modules/stripe/lib/makeRequest.js:83:14\n at new Promise (<anonymous>)\n at makeRequest (/opt/node_app/node_modules/stripe/lib/makeRequest.js:80:10)\n at Constructor.listLineItems (/opt/node_app/node_modules/stripe/lib/StripeMethod.js:38:7)\n at App.exports.listCheckoutSessionLineItems (/opt/node_app/lib/modules/stripe.js:857:37)\n at App._exec (/opt/node_app/lib/core/app.js:481:57)\n at App._exec (/opt/node_app/lib/core/app.js:452:28)"
}
I’m expecting to get the line items object from stripe: https://stripe.com/docs/api/checkout/sessions/line_items
Reproduce
-
Create webhook server action:
checkout.session.completed
-
Create
List Checkout Session Line Items
and put$_POST.data.object.id
under thesession
param
- Test webhook using the Stripe CLI
Extra notes:
I’m guessing the issue lies in what is returned in \lib\modules\stripe.js
line 856
Because that same binding: $_POST.data.object.id
does work with Retrieve Checkout Session
https://stripe.com/docs/api/checkout/sessions/retrieve