Quick overview
This workflow receives a payment routing request via webhook, evaluates Stripe, PayPal, and Adyen against estimated fees, currency support, and live availability checks, then returns a routing decision with an audit trail.
How it works
- Receives a POST request on an n8n webhook with payment details like amount, currency, and requestId.
- Validates the request, builds a provider catalog (Stripe, PayPal, Adyen), and pre-filters candidates by currency support and minimum amount while estimating fees.
- Calls three HTTP health-check endpoints in sequence (with short waits) to determine live availability for each provider.
- Sends the candidate list to a routing HTTP endpoint to simulate forwarding the payment.
- Combines fees, base reliability scores, and live availability into a final score, selects the best available provider, and records the route outcome.
- Responds to the webhook with the selected provider (or failure reason), provider-by-provider scoring details, and an overall routing status code.
Setup
- Configure the webhook path as needed and copy the production webhook URL into your payment-request source system.
- Replace the placeholder httpbin.org URLs with your real provider health-check endpoints and your payment routing endpoint (or keep them for simulation/testing).
- Update the provider catalog in the code (fees, supported currencies, base scores, minimum amounts, and timeouts) to match your payment setup.