Skip to content

Commit

Permalink
Don't list subscriptions if none
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Mar 29, 2024
1 parent b0c6a25 commit e1add9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wave/src/Http/Controllers/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public function checkout(Request $request){

public function transactions(User $user){

// Check if user has a subscription
if (!$user->latestSubscription) {
return [];
}

$invoices = [];
$response = Http::withToken($this->api_key)->get($this->paddle_url . '/transactions', [
'subscription_id' => $user->latestSubscription->subscription_id
Expand Down

0 comments on commit e1add9a

Please sign in to comment.