Skip to content

Commit

Permalink
Merge pull request thedevdojo#152 from thedevdojo/cleaningUpCode
Browse files Browse the repository at this point in the history
Removing some unneccessary log and dump code
  • Loading branch information
tnylea authored Nov 7, 2024
2 parents 0f93c53 + f44215b commit b8aa3ed
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
9 changes: 0 additions & 9 deletions wave/src/Http/Controllers/Billing/Webhooks/PaddleWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -35,7 +27,6 @@ public function handler(Request $request)
}

return response()->json(['message' => 'Webhook handled successfully'], 200);

}

protected function subscriptionCancelled(Request $request)
Expand Down
4 changes: 0 additions & 4 deletions wave/src/Http/Controllers/Billing/Webhooks/StripeWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -131,8 +129,6 @@ public function fulfill_checkout($session_id, $event): void
'status' => 'active',
'seats' => 1
]);

//dump($checkout_session);
}
}
}
2 changes: 1 addition & 1 deletion wave/src/Http/Livewire/Billing/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
1 change: 0 additions & 1 deletion wave/src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit b8aa3ed

Please sign in to comment.