im using laravel 5.1 and followed the steps in http://ift.tt/1ZYkHtS
except for the provider need to 2 keys
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
i set it in my .env file as
STRIPE_KEY=@my_stripe_test_publishable_key
STRIPE_SECRET=@my_stripe_test_secret_key
my controller code is
$creditCardToken = $request->stripeToken; //from stripe documentation
//because the documentation didnt include how to get this variable
$user = User::find(1);
$user->subscription('monthly')->create($creditCardToken);
$user->trial_ends_at = Carbon::now()->addDays(14);
$user->save();
an error appears everytime i try to subscribed. even without the $creditCardToken variable
ErrorException in StripeGateway.php line 71:
Argument 1 passed to Laravel\Cashier\StripeGateway::__construct() must be an instance of Laravel\Cashier\Contracts\Billable, instance of App\User given, called in C:\wamp\www\lifesaver\vendor\laravel\cashier\src\Laravel\Cashier\Billable.php on line 58 and defined
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire