🔌 Meter Token Webhook System Test

Comprehensive system check for webhook components and configuration

✓ All Tests Passed

Environment File Check

.env file found and loaded successfully

Required Files Check

All required files are present
MeterAPI.php Found
SMSAPI.php Found
WhatsAppAPI.php Found
webhook.php Found

PHP Extensions Check

All required PHP extensions are loaded
curl Loaded
json Loaded

Environment Variables Check

All environment variables are configured
METER_API_URL https://server-newv.stronpower.com/api/VendingMeter
METER_COMPANY_NAME STEPHENNJERU
METER_USERNAME STEPHENNJERU
METER_PASSWORD ******
AFRICASTALKING_API_KEY atsk*********************************************************************c806
AFRICASTALKING_USERNAME NomNom_Pos
WHATSAPP_PHONE_NUMBER_ID 1006747622520633
WHATSAPP_ACCESS_TOKEN EAAa******************************************************************************************************************************************************************************************************************************************YBXN

Meter ID Validation

All meter ID validations passed
Input: '58103773683'valid (cleaned: '58103773683')
Input: ' 58103773683 'valid (cleaned: '58103773683')
Input: '581 037 736 83'valid (cleaned: '58103773683')
Input: 'ABC123'invalid (cleaned: 'ABC123')
Input: '123-456'invalid (cleaned: '123-456')
Input: '(empty)'invalid

WhatsApp message sent successfully

Phone Number Detection

All phone number detection tests passed
Input: ''
Input: ''
Input: ''

Webhook Payload Parsing

Sample webhook payload parsed successfully
Meter ID: 58103773683
Amount: 10.00
Phone: +254788460709

SMS Results

            nullwhat
            

WhatsApp Results

            {
    "success": true,
    "message": "WhatsApp message sent successfully",
    "data": {
        "messaging_product": "whatsapp",
        "contacts": [
            {
                "input": "254712787719",
                "wa_id": "254712787719"
            }
        ],
        "messages": [
            {
                "id": "wamid.HBgMMjU0NzEyNzg3NzE5FQIAERgSRUQ4Q0RGNUU0NjYxRTJBM0U4AA==",
                "message_status": "accepted"
            }
        ]
    }
}            

📋 Next Steps

  1. Ensure all environment variables are configured in your .env file
  2. Deploy webhook.php to your server and make it accessible via your webhook URL
  3. Test the webhook endpoint using the cURL commands provided in README.md
  4. Monitor the response for token generation and notification delivery status
  5. Implement webhook signature validation for production use