Phoenix Gamification

Testing and Sandbox

This section provides guidance for testing your integration with the Phoenix Gamification Ingestion Gateway. It includes sandbox credentials, a pre-launch checklist

Test Credentials

Use these credentials for staging environment testing:

FieldValue
Tenant IDtest-tenant
Secrettest_secret_key_12345
Endpointdeployed.url

Never use test credentials in production.

Test Checklist

Before going live, verify:

  • Signature generation is correct
  • All required headers are included
  • Timestamp is within acceptable range
  • Event schema matches specification
  • Tenant ID matches in header and body
  • HTTPS is used (not HTTP)
  • Error handling is implemented
  • Retry logic with backoff is working
  • Rate limits are respected
  • Secrets are stored securely
  • Monitoring and alerting configured

Example Test Script

import os
import sys

def test_integration():
    # Test 1: Valid event submission
    event = create_test_event("evt_test_001", "transaction.completed")
    result = send_event(event)
    assert result["status"] == "accepted", "Event not accepted"
    print("✓ Event submission successful")

    # Test 2: Invalid signature (should fail)
    try:
        event = create_test_event("evt_test_002", "transaction.completed")
        # Tamper with signature
        send_event_with_invalid_signature(event)
        print("✗ Invalid signature should have been rejected")
        sys.exit(1)
    except AuthenticationError:
        print("✓ Invalid signature correctly rejected")

    # Test 3: Expired timestamp (should fail)
    try:
        event = create_test_event("evt_test_003", "transaction.completed")
        send_event_with_old_timestamp(event)
        print("✗ Expired timestamp should have been rejected")
        sys.exit(1)
    except AuthenticationError:
        print("✓ Expired timestamp correctly rejected")

    print("\nAll tests passed! Integration is ready.")

if __name__ == "__main__":
    test_integration()

Before Going Live

Before launching in production:

  1. Complete integration testing - Verify all endpoints work correctly
  2. Load test your implementation - Ensure it handles expected volume
  3. Set up monitoring - Track success rates, latency, and errors
  4. Configure alerts - Get notified of integration issues
  5. Review security - Ensure secrets are secure and HTTPS is used
  6. Document internally - Create runbooks for your team
  7. Contact support - Schedule production verification with our team