-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1585 - Tax ID collection requires updating business name on the customer #1586
Conversation
@@ -85,7 +85,7 @@ public static function create($owner, array $sessionOptions = [], array $custome | |||
} | |||
|
|||
// Make sure to collect address and name when Tax ID collection is enabled... | |||
if (isset($data['customer']) && $data['tax_id_collection']['enabled'] ?? false) { | |||
if (isset($data['customer']) && ($data['tax_id_collection']['enabled'] ?? false)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discovered that this condition previously didn't evaluate correctly without parenthesis, as the null coalescing operator ??
has a lower precedence than the &&
operator, so the condition is equivalent to:
(isset($data['customer']) && $data['tax_id_collection']['enabled']) ?? false
Thanks @stevebauman! |
Thanks @stevebauman for the fix. |
This should've been in an announcement. I wasn't aware some of my projects were broken on Stripe side of things. |
@novaylt123 I still need to do a more thorough investigation but I'm not sure why things suddenly broke at all. Cashier right now doesn't supports So I want to know why and how this API update affects Cashier at all. |
So Stripe got back to me and confirmed this was a breaking change in test mode only as they were trying some things out. Nothing got broken in production and they've reverted the change since. |
Thanks for getting to the bottom of it @driesvints! 🙏 |
Closes #1585
This PR resolves an issue that appears to have been introduced from a Stripe 2023-10-16 API update, where only the existence of the
tax_id_collection.enabled
parameter requires the addition of thecustomer_update
parameters, rather than being able to set it tofalse
as it was previously, resulting in the exception:The
tax_id_collection
collection parameter will now be completely omitted when auto-calculation of taxes is disabled.