Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am referring here to Stripe Checkout.

https://stripe.com/payments/checkout

It's supposed to make payments easier with a Stripe-hosted payments page. However, creating a server-side Checkout session, and then getting line items from an order, is an unnecessarily convoluted series of requests.



You can use "expand" to get multiple queries into a single request, kind of like a SQL join. I don't know if this is exactly your use case, but when we get a Checkout session, and want the customer and purchase line items, it looks like this (using the Stripe Ruby library).

Stripe::Checkout::Session.retrieve({ id: session_id, expand: ['line_items', 'customer'] })




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: