You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we call the defaultPaymentMethod() method for certain users, we get a Attempt to read property "default_payment_method" on null exception triggered in /vendor/laravel/cashier/src/Concerns/ManagesPaymentMethods.php on this if statement even though the customer has a valid subscription and Stripe ID:
if ($customer->invoice_settings->default_payment_method) {
return new PaymentMethod($this, $customer->invoice_settings->default_payment_method);
}
We believe this may be happening because the customer has a 100% off coupon and therefore wasn't required to enter a payment method when creating their subscription using Stripe Checkout. We create all new subscriptions with Stripe Checkout using this method:
Cashier Stripe Version
15.6.0
Laravel Version
11.5.0
PHP Version
8.1.0
Database Driver & Version
No response
Description
When we call the defaultPaymentMethod() method for certain users, we get a
Attempt to read property "default_payment_method" on null
exception triggered in/vendor/laravel/cashier/src/Concerns/ManagesPaymentMethods.php
on this if statement even though the customer has a valid subscription and Stripe ID:We believe this may be happening because the customer has a 100% off coupon and therefore wasn't required to enter a payment method when creating their subscription using Stripe Checkout. We create all new subscriptions with Stripe Checkout using this method:
Steps To Reproduce
$user->defaultPaymentMethod()
.The text was updated successfully, but these errors were encountered: