When you create a subscription using createAndSendInvoice(), it doesn't immediately take payment, so for that subscription there is no latest payment, when you then call latestPayment() it doesn't fail gracefully, it just says:
file: "vendor/laravel/cashier/src/Subscription.php"
line: 1379
message: "Call to a member function stripe() on null"
i'm assuming because it cannot get a latest payment, but can't.
It also tries to call asStripeSubscription() before that which in turn tries to get stripe() and fails.
Cashier Stripe Version
14.14.0
Laravel Version
10.4.1
PHP Version
8.2
Database Driver & Version
MySQl 8.0.31
Description
When you create a subscription using createAndSendInvoice(), it doesn't immediately take payment, so for that subscription there is no latest payment, when you then call latestPayment() it doesn't fail gracefully, it just says:
file: "vendor/laravel/cashier/src/Subscription.php" line: 1379 message: "Call to a member function stripe() on null"
i'm assuming because it cannot get a latest payment, but can't.
It also tries to call asStripeSubscription() before that which in turn tries to get stripe() and fails.
Steps To Reproduce
Mentioned above in description.