Skip to main content

Payment Orchestration

Azotte's payment orchestration engine intelligently routes payments across multiple providers for optimal success rates and cost efficiency.

Orchestration Overview

┌─────────────┐     ┌─────────────────────┐     ┌──────────────┐
│ Customer │────▶│ Payment Gateway │────▶│ PSP Selector │
│ Checkout │ │ │ │ │
└─────────────┘ │ • Tokenization │ │ • Routing │
│ • Validation │ │ • Failover │
│ • Fraud Detection │ │ • Retry │
└─────────┬───────────┘ └──────┬───────┘
│ │
┌─────────▼──────────────────┬──────▼───────┐
│ Payment Providers │ │
│ │ │
┌───────▼──┐ ┌────────▼──┐ ┌────────▼──┐ ┌────────▼──┐
│ Stripe │ │ Adyen │ │ Craftgate │ │ PayPal │
│ │ │ │ │ │ │ │
└──────────┘ └───────────┘ └───────────┘ └───────────┘

Routing Intelligence

Routing Factors

  • Geographic Optimization: Region-specific PSP performance
  • Payment Method: Method-specific routing preferences
  • Success Rate: Historical performance data
  • Cost Optimization: Transaction fee minimization
  • Currency Support: Native currency processing
  • Feature Requirements: Advanced features needed

Smart Routing Algorithm

1. Analyze Transaction
├─ Customer Location
├─ Payment Method
├─ Transaction Amount
└─ Currency

2. Score Available PSPs
├─ Success Rate Score (40%)
├─ Cost Score (30%)
├─ Performance Score (20%)
└─ Feature Score (10%)

3. Select Primary & Backup PSPs
├─ Primary: Highest scoring PSP
└─ Backup: Next 2-3 highest scoring

4. Execute with Failover
├─ Attempt Primary PSP
├─ Auto-retry on soft failures
└─ Cascade to backup PSPs

Failover and Retry Logic

Failure Types

  • Soft Failures: Temporary issues, retry-able

    • Network timeouts
    • Rate limiting
    • Temporary PSP downtime
  • Hard Failures: Permanent issues, no retry

    • Invalid credentials
    • Insufficient funds
    • Fraud detection blocks

Retry Strategy

  • Exponential backoff with jitter
  • Maximum retry limits per PSP
  • Circuit breaker pattern implementation
  • Intelligent retry scheduling

Cascade Failover

  1. Primary PSP failure detection
  2. Automatic secondary PSP selection
  3. Transaction context preservation
  4. Seamless customer experience

PSP Adapter Pattern

Standardized Interface

interface PaymentProvider {
charge(request: ChargeRequest): Promise<ChargeResponse>
refund(request: RefundRequest): Promise<RefundResponse>
tokenize(request: TokenRequest): Promise<TokenResponse>
webhook(payload: WebhookPayload): WebhookEvent
}

Provider-Specific Adapters

  • Stripe Adapter: Stripe-specific implementation
  • Adyen Adapter: Adyen-specific implementation
  • PayPal Adapter: PayPal-specific implementation
  • Generic Adapter: Common PSP interface

Real-Time Monitoring

Performance Metrics

  • Success rate per PSP
  • Average response time
  • Error rate analysis
  • Cost per transaction

Health Monitoring

  • PSP availability monitoring
  • Response time tracking
  • Error pattern detection
  • Capacity utilization

Alerting System

  • PSP downtime notifications
  • Success rate degradation alerts
  • Cost threshold warnings
  • Performance anomaly detection

Configuration Management

PSP Configuration

  • Connection parameters
  • Feature capability mapping
  • Geographic availability
  • Cost structure definitions

Routing Rules

  • Priority-based routing
  • Condition-based routing
  • Time-based routing
  • Volume-based routing

Security and Compliance

PCI DSS Compliance

  • Tokenization at edge
  • Secure key management
  • Encrypted data transmission
  • Regular security audits

Fraud Prevention

  • Multi-layer fraud detection
  • Machine learning models
  • Real-time risk scoring
  • Behavioral analysis

Next Steps