Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

scottsuhy's avatar

Laravel and latest version of Stripe Checkout

I see numerous examples/blogs that show how to use Laravel with the legacy version of Stripe Checkout but I can't find one that uses the new version. https://stripe.com/docs/payments/checkout/migration

I currently use Stripe to take one time payments but want to now save the users card for future payments but it looks like things have changed a bit on the Stripe side. Example here: https://github.com/stripe-samples/saving-card-without-payment/blob/master/server/php/index.php

Can anyone point me to an example with Laravel? or is the Github example the best out there?

0 likes
8 replies
jlrdw's avatar

In this chapter you did see: https://laravel.com/docs/7.x/billing

To prevent breaking changes, Cashier uses a fixed Stripe API version. Cashier 12 utilizes Stripe API version 2020-03-02. The Stripe API version will be updated on minor releases in order to make use of new Stripe features and improvements.

scottsuhy's avatar

I'm not using Cashier right now. Should I be?

i was under the impression that Cashier was only for the "subscription" usecase -- from Doc: 'Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. '

I'm building an auction app functionality that has to charge all the customers after the auction is complete. some will be return customers. I'm not building a saas subscription app.

I was worried about this reference in the doc: 'Of course, when making a single charge against a customer's payment method we'll only need to use a payment method identifier a single time. Due to Stripe limitations, you may not use the stored default payment method of a customer for single charges. You must allow the customer to enter their payment method details using the Stripe.js library.'

are you saying that I can use Cashier for a use-case that stores cards and charges them once service is complete (but not ongoing)? If so, great.

scottsuhy's avatar

that example is using legacy stripe from what I see. In legacy your app collects card information from the customer and sends the token to the server to charge it. in the new version of Checkout you create a Checkout Session on your server then pass the session ID to the client and redirect the customer to Checkout to complete the payment (the page is hosted by Stripe). Opens up a lot of new features for them and is more secure.

since so many people use Stripe with Laravel, and the new Stripe design has been out for a while it doesn't make sense that more people haven't discussed how to integrate so I must be missing something here.

jlrdw's avatar

Definitely bookmarked in case I see a similar question in to order to help others.

martinbean's avatar

Yeah, I’m not clicking a random bit.ly URL added as a response to a 5-month old thread…

4 likes

Please or to participate in this conversation.