subscription module updated

This commit is contained in:
Hritikkk9
2024-07-10 16:50:45 +05:30
parent 1a575539ce
commit 6daeca0628
2 changed files with 11 additions and 8 deletions

View File

@@ -61,7 +61,8 @@ class SubscriptionController extends Controller
}
} catch (\Exception $e) {
Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'));
}
}
@@ -80,7 +81,8 @@ class SubscriptionController extends Controller
return view('Admin.pages.subscriptions.list-of-products', compact('productList'));
} catch (\Exception $e) {
Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
@@ -195,7 +197,7 @@ class SubscriptionController extends Controller
$stripeId = $request->stripe_id;
$timestamp = $request->timestamp_to_update;
$updateSubscription = $stripe->subscriptions->update(
$stripeId,
['trial_end' => $timestamp] //8 RD aUG
@@ -303,7 +305,8 @@ class SubscriptionController extends Controller
} catch (\Exception $e) {
Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'));
// return redirect()->back()->with(['error' => "Something went wrong while subscription!" . $e->getMessage()]);
@@ -368,9 +371,9 @@ class SubscriptionController extends Controller
} catch (\Exception $e) {
DB::rollBack();
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return redirect()->back()->with(['error' => "Something went wrong while cancelling subscription!" . $e->getMessage()]);
// Log::error("An error occurred in " . _METHOD_ . ": " . $e->getMessage(), ['exception' => $e]);
// return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}