Stripe Checkout - line_items not found

What was the value on the front end?

It is supposed to be an array.

But I will see if we can make it smarter

Okay, an array of price ids?

an array of objects with price, quantity in them
where price is the stripe price_id

I think this was explained in the first Stripe docs tutorial but because we used a Data Store there it might not have being clear that it is an array.

Okay, that helps. Thanks for the late night assist George.

I’m going to feel so stupid once I figure this out!

Sending to stripe checkout:

Screen Shot 2021-03-26 at 2.43.59 PM

Getting back;

Subscriptions require at least one recurring price or plan to be passed to `line_items`. See https://stripe.com/docs/payments/checkout/set-up-a-subscription#create-checkout-session. If you didn't intend to create a subscription, use payment `mode` instead. Learn more at https://stripe.com/docs/payments/checkout/accept-a-payment#create-checkout-session.

Well the Subscription flows were covered in:

Both Client Side Only flow and Server Side - with reusing the Customer even.
So see if you have missed anything in your subscription definition, like the right price id and also setting the purchase mode to subscription.

Unfortunately those checkout.

To troubleshoot, I used that same price id but inside the checkout action itself, and changed from Reference to Prices ID List. That works fine.

I’ll keep at it.

Maybe you guys can check on your end as well @George.

I have now rebuilt the files…same result.

This is what shows as a request on the stripe portal:

No line_items object is being sent and so it fails:

However, if I use the Items Type of Prices ID List, it shows the request including line_items

1 Like

So what exactly is post to your server action for the create checkout session from the front end? That it doesn’t work.

Data store with the price and quantity

And the stripe element:

I mean in devtools could you inspect the exact post to server connect action

Sorry there was a bug indeed when passing the regular line_items.

Unzip and replace the stripe.js in lib/modules:
stripe.zip (7.1 KB)

Now we event improved create Session checkout to accept all kind of line items. A single price, or a Price/Quantity object or array of those.

So you can pass anything to it.

2 Likes

Thanks George…confirmed it is working.

1 Like

I just ran into to this issue too as @mebeingken was outlining I thought I was going crazy until I decided to check the forum here to see if anyone else was having this issue. I’ll unzip the file and replace it on my end too in the morning unless advice otherwise. Thanks @George and @mebeingken

@George, So I am using stripe.php my project and I believe I am having the same issues here. Do you have a fix zip file for stripe.php as well? If not I can probable put off the part of the build I am working on and wait until Thursday when there is a new update. Let me know thanks.

Here is the php fix, unzip it in dmxConnectLib/modules:

stripe.zip (6.2 KB)

Thanks @George You are truly the best sir.