skip to Main Content

In the stripe documentation, we have the option to pass ‘payment_behavior’ => ‘default_incomplete’, in order to create a subscription with the payment method.

In cashier we have a trial option but what if we don’t want to use trail then how can the subscription get created without a payment method?

$subscription = $user->newSubscription('default', $validated['priceId'])
            ->trialDays(14)->create();

This is my code, I would like to remove the

trailDays

option and add payment_behavior to default_incomplete.

2

Answers


  1. You can remove trialDays() if you don’t want a trial and then pass the desired additional Stripe parameters in third argument as noted in the Laravel Cashier docs: https://laravel.com/docs/10.x/billing#additional-details

    Login or Signup to reply.
  2. Try ignoreIncompletePayments method without trialDays.

    $subscription = $user->newSubscription('default', $validated['priceId'])->ignoreIncompletePayments()->create();
    

    The status will be default_incomplete but if you invoke subscribed method it will result false.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search