Skip to main content

Payment Lifecycle

Understand the complete payment journey from authorization to settlement in the Azotte platform.

Payment Flow Overview

Customer Checkout


┌────────────────────┐
│ Authorization │
│ │
│ • Validate payment │
│ • Reserve funds │
│ • Fraud check │
└──────────┬─────────┘


┌────────────────────┐
│ Capture │
│ │
│ • Settle funds │
│ • Activate service │
│ • Send confirmation │
└──────────┬─────────┘


┌────────────────────┐
│ Settlement │
│ │
│ • Transfer to bank │
│ • Generate invoice │
│ • Update records │
└────────────────────┘

Payment States

Authorization States

  • Pending: Authorization in progress
  • Authorized: Funds reserved successfully
  • Declined: Authorization failed (insufficient funds, etc.)
  • Expired: Authorization timeout or expiry

Capture States

  • Captured: Funds successfully captured
  • Partial: Partially captured (less than authorized amount)
  • Failed: Capture attempt failed
  • Cancelled: Authorization cancelled before capture

Settlement States

  • Pending: Settlement in progress
  • Settled: Funds transferred to merchant account
  • Failed: Settlement failed
  • Returned: Settlement reversed (chargeback, etc.)

Recurring Payments

Subscription Billing Cycle

  1. Billing Date: Recurring charge attempt
  2. Payment Processing: Authorize and capture
  3. Success Handling: Continue subscription
  4. Failure Handling: Retry logic and dunning

Retry Logic

Payment Failed


Retry #1 (24 hours)


Retry #2 (72 hours)


Retry #3 (7 days)


Subscription Cancelled

Payment Methods

Credit/Debit Cards

  • Visa, Mastercard, American Express
  • 3D Secure authentication
  • Tokenization for security
  • Automatic retry for network failures

Digital Wallets

  • PayPal, Apple Pay, Google Pay
  • One-click payments
  • Biometric authentication
  • Streamlined mobile experience

Bank Transfers

  • ACH (US), SEPA (Europe)
  • Direct debit for subscriptions
  • Lower fees, higher authorization times
  • Bank account verification required

Error Handling

Common Payment Errors

  • Insufficient Funds: Customer account lacks funds
  • Expired Card: Payment method expired
  • Invalid CVV: Security code incorrect
  • Fraud Detection: Transaction flagged as suspicious

Error Response Format

{
"error": {
"code": "card_declined",
"message": "Your card was declined",
"type": "card_error",
"decline_code": "insufficient_funds",
"payment_intent_id": "pi_1234567890"
}
}

Webhooks and Events

Payment Events

  • payment.authorized - Payment successfully authorized
  • payment.captured - Payment captured and settled
  • payment.failed - Payment attempt failed
  • payment.refunded - Refund processed

Event Handling

app.post('/webhooks/azotte', (req, res) => {
const event = req.body;

switch (event.type) {
case 'payment.captured':
// Activate customer subscription
activateSubscription(event.data.subscription_id);
break;
case 'payment.failed':
// Handle failed payment
handlePaymentFailure(event.data);
break;
}

res.status(200).send('OK');
});

Next Steps