Skip to content

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

@xf345

Description

@xf345

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions