From f44215b0b7dd68d8601e5baa38a986ea7adad3d1 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Wed, 6 Nov 2024 19:12:46 -0500 Subject: [PATCH] Removing some unneccessary log and dump code --- .../Http/Controllers/Billing/Webhooks/PaddleWebhook.php | 9 --------- .../Http/Controllers/Billing/Webhooks/StripeWebhook.php | 4 ---- wave/src/Http/Livewire/Billing/Checkout.php | 2 +- wave/src/User.php | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/wave/src/Http/Controllers/Billing/Webhooks/PaddleWebhook.php b/wave/src/Http/Controllers/Billing/Webhooks/PaddleWebhook.php index 0e13621e5..d5dfdc802 100644 --- a/wave/src/Http/Controllers/Billing/Webhooks/PaddleWebhook.php +++ b/wave/src/Http/Controllers/Billing/Webhooks/PaddleWebhook.php @@ -18,14 +18,6 @@ public function handler(Request $request) { $event = $request->get('event_type', null); - dump('hit the handler'); - dump($event); - - dump('request'); - dump($request); - - Log::info('hit the handler'); - switch ($event) { case 'subscription.canceled': $this->subscriptionCancelled($request); @@ -35,7 +27,6 @@ public function handler(Request $request) } return response()->json(['message' => 'Webhook handled successfully'], 200); - } protected function subscriptionCancelled(Request $request) diff --git a/wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php b/wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php index ea69e4ed3..fbb93574f 100644 --- a/wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php +++ b/wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php @@ -34,8 +34,6 @@ public function handler(Request $request) exit(); } - dump($event->type); - if($event->type == 'checkout.session.completed' || $event->type == 'checkout.session.async_payment_succeeded') { $this->fulfill_checkout($event->data->object->id, $event); @@ -131,8 +129,6 @@ public function fulfill_checkout($session_id, $event): void 'status' => 'active', 'seats' => 1 ]); - - //dump($checkout_session); } } } diff --git a/wave/src/Http/Livewire/Billing/Checkout.php b/wave/src/Http/Livewire/Billing/Checkout.php index 4b374b9f2..c133bfe36 100644 --- a/wave/src/Http/Livewire/Billing/Checkout.php +++ b/wave/src/Http/Livewire/Billing/Checkout.php @@ -106,7 +106,7 @@ public function verifyPaddleTransaction($transactionId){ $transaction = null; $response = Http::withToken( config('wave.paddle.api_key') )->get($this->paddle_url . '/transactions/' . $transactionId); - dump($response->body()); + if ($response->successful()) { $resBody = json_decode($response->body()); if (isset($resBody->data->status) && ($resBody->data->status == 'paid' || $resBody->data->status == 'completed' || $resBody->data->status == 'ready')) { diff --git a/wave/src/User.php b/wave/src/User.php index 1a509434d..55456c5dd 100644 --- a/wave/src/User.php +++ b/wave/src/User.php @@ -113,7 +113,6 @@ public function subscription() public function switchPlans(Plan $plan){ $this->syncRoles([]); - dump('assigned role: ' . $plan->role->name); $this->assignRole( $plan->role->name ); }