Skip to content

Commit

Permalink
fix: fix subscriptions list display (#4967)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Mar 16, 2021
1 parent 99c353e commit ca21705
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/Helpers/InstanceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static function getNumberOfPaidSubscribers()
*/
public static function getPlanInformationFromConfig(string $timePeriod): ?array
{
$timePeriod = strtolower($timePeriod);

if ($timePeriod != 'monthly' && $timePeriod != 'annual') {
return null;
}
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Settings/SubscriptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function index()
]);
}

$planId = $account->getSubscribedPlanId();
try {
$nextBillingDate = $account->getNextBillingDate();
} catch (StripeException $e) {
Expand All @@ -55,7 +54,7 @@ public function index()
}

return view('settings.subscriptions.account', [
'planInformation' => InstanceHelper::getPlanInformationFromConfig($planId),
'planInformation' => InstanceHelper::getPlanInformationFromConfig($subscription->name),
'nextBillingDate' => $nextBillingDate,
'subscription' => $subscription,
'hasInvoices' => $hasInvoices,
Expand Down

0 comments on commit ca21705

Please sign in to comment.