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?
if your api keys are valid then following can be the issue.
This issues erupts only due to one reason and that is token generated by following function.
Stripe.card.createToken($form, stripeResponseHandler)
in stripeResponseHandler(status, response) response.id is the token value. so please use this token to create subscription or whatever... Thanks