Call to a member function create() on null [Cashier 7.0]
Although I'm getting the Stripe Token like so:
in Billable.php line 385
at User->updateCard(object(Token)) in SubscriptionBuilder.php line 212
at SubscriptionBuilder->getStripeCustomer('tok_19oWykA5zF9kYK3AAOoQP6YM', array('email' => '[email protected]')) in SubscriptionBuilder.php line 177
I figure it out. In fact I first register / charge one customer and after that delete it in stripe admin interface.
After that I try to charge the same customer and I experienced that error in Billable.php line 385
In fact the first time I charge the client a stripe_id was added in the row of the user in my DB. When I've deleted and try to charge the same client, the stripe_id stored in my DB and the new ID genereted by stripe doesn't match and create that issue.
You can simulate this error also if you try to charge a user which doest exist in you DB.
Ex :
$user = User::find(99999); // Fake ID
$user->newSubscription('main', 'main')->create(Input::get('stripeToken'));