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
According to the docstring of PaymentMethod::delete, calling the function will return \Stripe\PaymentMethod regardless of result. However, the ManagesPaymentMethods::removePaymentMethod returns to void, leading to issues if you are validating the result of the delete function call.
Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.
Cashier Stripe Version
12.17.2
Laravel Version
8.83.27
PHP Version
8.1.17
Database Driver & Version
No response
Description
According to the docstring of
PaymentMethod::delete
, calling the function will return\Stripe\PaymentMethod
regardless of result. However, theManagesPaymentMethods::removePaymentMethod
returns to void, leading to issues if you are validating the result of thedelete
function call.This appears to still affect the latest Cashier version, as looking at the source code still has it in there.
https://github.com/laravel/cashier-stripe/blob/14.x/src/PaymentMethod.php#L51
https://github.com/laravel/cashier-stripe/blob/14.x/src/Concerns/ManagesPaymentMethods.php#L115
I suppose there are a few options:
PaymentMethod::delete
to have@return void
ManagesPaymentMethods::removePaymentMethod
to return thePaymentMethod
ManagesPaymentMethods::removePaymentMethod
to return abool
result and change the docstring ofPaymentMethod::delete
to@return bool
Steps To Reproduce
The text was updated successfully, but these errors were encountered: