Skip to content
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

Google SubscriptionCanceled erroring with Undefined array key "subscriptionId" #437

Open
sharondikan opened this issue Nov 6, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@sharondikan
Copy link

Liap version(s) affected

1.13

Description

When receiving SUBSCRIPTION_CANCELED events from google RTDN, the error Undefined array key \"subscriptionId\" occurs on google-play-billing/src/DeveloperNotifications/SubscriptionNotification.php:66.

Other event subscriptions are not having this issue so seems to be an isolated event. This occurs without having an event listener for the SubscriptionCanceled event.

Here's an event payload from google,

[
    "version" => "1.0",
    "packageName" => "REDACTED",
    "eventTimeMillis" => "1730917027147",
    "subscriptionNotification" => [
      "version" => "1.0",
      "notificationType" => 3,
      "purchaseToken" => "REDACTED,
    ],
  ]

The real issue seems to be on google's side with not sending a subscriptionID, however, it would be nice to be able to handle this so that we can still respond accordingly.

How to reproduce

  • Create a google subscription
  • Cancel subscription from Google Play Store
  • See error response when receiving SUBSCRIPTION_CANCELED notification

Possible Solution

Return an empty string if the subscription notification does not contain a "subscriptionId" within the create SubscriptionNotification:$attributes['subscriptionId'] ?? ""

Additional Context

No response

@sharondikan sharondikan added the Bug Something isn't working label Nov 6, 2024
@sharondikan sharondikan changed the title Google SUBSCRIPTION_CANCELED notification doesn't include subscriptionId Google SubscriptionCanceled erroring with Undefined array key "subscriptionId" Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant