lundi 3 octobre 2016

InvalidRequest in ApiRequestor.php line 108: No such customer: cus_9JHigF9SGUuVJQ

I just wondering why I got this error:

InvalidRequest in ApiRequestor.php line 108:
No such customer: cus_9JHigF9SGUuVJQ

in my controller, this is my code:

use Laravel\Cashier\Billable;
use Stripe\Stripe;
...
class BillingController extends Controller
{
    use Billable;
    public function postPayCharges( Request $request )
    {
        $account = \App\Account::find( Auth::user()->account->account_id );
        $plan = \App\Plan::find($account->plan_id);

        $ccToken = $request->input('stripeToken');

        $user = \App\User::find(Auth::user()->user_id);
        $user->newSubscription($plan->name, $plan->plan_id)->create($ccToken, [
            'email' => $user->email,
        ]);

I am sure that the stripe public key and secrete key I used are valid. Any idea?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire