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

Error when message of type user_changed_number is received. #120

Open
muniter opened this issue Jun 28, 2023 · 1 comment
Open

Error when message of type user_changed_number is received. #120

muniter opened this issue Jun 28, 2023 · 1 comment

Comments

@muniter
Copy link

muniter commented Jun 28, 2023

Error processing the webhook when a user changes its phone number.

Payload

Note: Personal data has been redacted with X

{
    "object": "whatsapp_business_account",
    "entry": [
        {
            "id": "108XXXXXXXXXXXX",
            "changes": [
                {
                    "value": {
                        "messaging_product": "whatsapp",
                        "metadata": {
                            "display_phone_number": "573XXXXXXXXX",
                            "phone_number_id": "10XXXXXXXXXXXXX"
                        },
                        "messages": [
                            {
                                "from": "573XXXXXXXXX",
                                "id": "wamid.HBgMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==",
                                "timestamp": "1687834799",
                                "system": {
                                    "body": "User A changed from \\u200e573XXXXXXXXX to 573XXXXXXXXX\\u200e",
                                    "wa_id": "573XXXXXXXXX",
                                    "type": "user_changed_number"
                                },
                                "type": "system"
                            }
                        ]
                    },
                    "field": "messages"
                }
            ]
        }
    ]
}

Stack trace

exception: 'Undefined index: customer',

#0 /app/vendor/netflie/whatsapp-cloud-api/src/WebHook/Notification/MessageNotificationFactory.php(99): yii\\base\\ErrorHandler->handleError(8, \'Undefined index...\', \'/app/vendor/net...\', 99, Array)
#1 /app/vendor/netflie/whatsapp-cloud-api/src/WebHook/Notification/MessageNotificationFactory.php(9): Netflie\\WhatsAppCloudApi\\WebHook\\Notification\\MessageNotificationFactory->buildMessageNotification(Array, Array)
#2 /app/vendor/netflie/whatsapp-cloud-api/src/WebHook/NotificationFactory.php(29): Netflie\\WhatsAppCloudApi\\WebHook\\Notification\\MessageNotificationFactory->buildFromPayload(Array, Array, Array)
#3 /app/vendor/netflie/whatsapp-cloud-api/src/WebHook.php(32): Netflie\\WhatsAppCloudApi\\WebHook\\NotificationFactory->buildFromPayload(Array)
#4 /app/modules/Whatsapp/controllers/DefaultController.php(44): Netflie\\WhatsAppCloudApi\\WebHook->read(Array)
...
@aalbarca
Copy link
Contributor

Hi @muniter, which graph api version are you using? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants