Skip to content

Commit

Permalink
Early return upcoming invoice (laravel#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Nov 6, 2023
1 parent f8dff8a commit e03fc2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,10 @@ public function latestInvoice()
*/
public function upcomingInvoice(array $options = [])
{
if ($this->canceled()) {
return null;
}

return $this->owner->upcomingInvoice(array_merge([
'subscription' => $this->stripe_id,
], $options));
Expand Down

0 comments on commit e03fc2f

Please sign in to comment.