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

ghten's avatar
Level 1

Cashier 10 + angular with subscriptions

Hi,

I use Laravel 5 with cashier in the server and angular in the client. In the client I put the card and stripe returns me a token “_tok”. I send to the server, but I have this error “No such payment_method”. Because cashier doesn’t accept the token to create a subscription but in angular I have only the token.

Thanks

0 likes
2 replies
yoeriboven's avatar

Are you using the old frontend methods? In September Stripe switched from tokens to payment intents.

See the docs.

After the credit card is verified you should send the setupIntent.payment_method to your server to create the subscription.

ghten's avatar
Level 1

Thanks

you were right. This is my programming for other people.

New subscription

In laravel user()->createSetupIntent() return client-secret

In angular I use ngx-stripe handleCardSetup(clientSecret, this.card).subscribe() You receive method-payment from Stripe.

You send to server Laravel Stripe::setApiKey(secret key);

"Create Customer if not created" if ( !user()->hasPaymentMethod()) { user()->createAsStripeCustomer(); }

"a customer's default payment method information." user()->updateDefaultPaymentMethod($payment_method); user()->save();

"Create subscription" user()->newSubscription('main', $namePlan)->create($payment_method);

Please or to participate in this conversation.