subscription page updated

This commit is contained in:
Hritikkk9
2024-07-03 12:07:14 +05:30
parent 7f858f4402
commit 136fbf3a1b
4 changed files with 9 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ class StripeWebhookController extends Controller
// Verify the webhook signature for security
$secret = config('constants.subscription.webhook_secret'); // Your webhook secret key
$payload = $request->getContent();
$sigHeader = $request->header('Stripe-Signature');
$event = null;
@@ -61,7 +62,7 @@ class StripeWebhookController extends Controller
Log::info("webhook called");
$stripe = new \Stripe\StripeClient($stripeSecret);
if ($event->type === 'checkout.session.completed') {
@@ -127,12 +128,12 @@ class StripeWebhookController extends Controller
//Log::info('Subscription Taken Successfully by ' . $getCaregiverData->iamprincipal->user_name);
Log::info('Subscription Taken Successfully by ');
DB::commit();
} catch (\Exception $e) {
// Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage());
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage());
// return response()->json(['error' => __('something_went_wrong')], 500);
//Log::error('Customer Subscription Checkout session function failed: ' . $e->getMessage());
Log::error('Customer Subscription Checkout session function failed: ' . $e->getMessage());
DB::rollBack();