FakeExpedia Demo
Proxy Mode — All traffic routed through PayFence Gateway
Health Check
PendingGET /healthz -- no authentication needed. Confirms the FakeExpedia origin server is running.
Direct Access Blocked
PendingTry hitting the origin directly with a valid token. The origin rejects non-gateway traffic (403).
Proxy Access Works
PendingSame request, but routed through the PayFence Gateway. Returns 200 with flight results.
Search Hotels
PendingGET hotels via the gateway. Demonstrates the gateway proxying different endpoints.
Place Hold (10 units)
PendingPOST a booking hold through the gateway. Costs 10 quota units -- watch the meter decrease.
Confirm Booking (25 units)
PendingPOST booking confirmation. Costs 25 units. Higher-value operations cost more quota.
Quota Exhaustion (402)
PendingSwitch to a TINY token (5 units total). Burn through quota until we hit 402 Payment Required with a checkout URL.
What This Demonstrates
Proxy Mode means all API traffic flows through the PayFence Gateway. The origin server (FakeExpedia) rejects any request that does not come from the gateway, ensuring every call is authenticated and metered.
Quota enforcement happens at the gateway level. Each API call deducts from the token's quota based on the endpoint's configured cost. When the quota reaches zero, the gateway returns 402 Payment Required with a checkout URL.
The checkout URL redirects the API consumer to a PayFence-hosted payment page where they can purchase more credits. Once payment completes, their quota is replenished and API calls resume working.