-
Notifications
You must be signed in to change notification settings - Fork 60
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
Update Subscription.php #148
Conversation
Allow paymentMethod() to be empty string
@@ -704,7 +704,7 @@ public function paddleEmail() | |||
*/ | |||
public function paymentMethod() | |||
{ | |||
return (string) $this->paddleInfo()['payment_information']['payment_method']; | |||
return (string) ($this->paddleInfo()['payment_information']['payment_method'] ?? ''); |
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.
Maybe better to return null here, and update the phpdoc. Seems odd to pretend we have a payment method when we don't?
I agree it seems weird to return an empty string? @driesvints |
Switching to |
I don't agree it's breaking, because it never worked, so nobody could be relying on that behaviour. ;) |
I think we should be consistent with the other methods. If we want to do this we can change all of them in a future release. |
Ok, let's do that. |
Allow paymentMethod() to be empty string. Subscriptions with "state": "deleted" don't have
payment_information
andpayment_method
respectively.Solves #147