Are you positive $company is actually what you think it is? Maybe dd($company) before the cancel call to double check that or use findOrFail().
Jun 16, 2015
2
Level 2
Cashier - 502 bad gateway
Hi.
When signed in to my application as a user, when the following is called, Stripe cancels the subscription fine and the database Company->stripe_active is updated.
Auth::user()->company->subscription()->cancel();
However, as an Admin user I need to be able to cancel user accounts in the same way. When I use the following code I get a 502 bad gateway error.
public function adminCancel( $company_id )
{
$company = Company::find( $company_id );
$company->subscription()->cancel();
return Redirect::route('companies'); //
}
Is there something obvious that i'm missing?
Thanks
Please or to participate in this conversation.