hotgeart
3 months ago
373
3
Laravel

Subscription problem with cashier

Posted 3 months ago by hotgeart

Hi,

I try to make a subcription with cashier but I get this error:

vendor\stripe\stripe-php\lib\ApiResource.php:103

urlencode() expects parameter 1 to be string, object given

My code is very simple:

public function subscribe()
{
    $user = auth()->user();
    $paymentMethod = $user->defaultPaymentMethod();

    $planId = 'subscription_monthly';
    $user->newSubscription('main', $planId)->create($paymentMethod);

    return 'done';
}

The payment method is in my BDD btw no problem on this side.

Anyone can help me? Thank you

Please sign in or create an account to participate in this conversation.