Overview

Deploying payment systems to production requires careful planning, security considerations, and robust monitoring. This guide covers everything you need to deploy FundKit safely and reliably in production environments.
Payment systems handle sensitive financial data. Always follow security best practices and conduct thorough testing before going live.

Pre-Production Checklist

Security & Compliance

API Credentials

  • Production API keys obtained from all providers - [ ] Credentials stored securely (environment variables, vault) - [ ] No hardcoded secrets in code - [ ] Credential rotation strategy implemented

Network Security

  • HTTPS enforced for all endpoints - [ ] Webhook endpoints secured - [ ] IP allowlisting configured - [ ] Firewall rules properly configured

Data Protection

  • PCI DSS compliance reviewed - [ ] Data encryption at rest and in transit - [ ] Audit logging enabled - [ ] Data retention policies implemented

Access Control

  • Role-based access control (RBAC) - [ ] Multi-factor authentication (MFA) - [ ] Principle of least privilege applied - [ ] Regular access reviews scheduled

Technical Requirements

Error Handling

  • Comprehensive error handling implemented - [ ] Graceful degradation strategies - [ ] Circuit breakers configured - [ ] Retry logic with exponential backoff

Monitoring

  • Application performance monitoring (APM) - [ ] Real-time alerting configured - [ ] Business metrics dashboards - [ ] SLA monitoring and reporting

Infrastructure

  • Load balancing configured - [ ] Auto-scaling policies set - [ ] Database clustering/replication - [ ] Disaster recovery plan tested

Testing

  • End-to-end testing completed - [ ] Load testing performed - [ ] Security testing conducted
  • Failover scenarios tested

Environment Configuration

Production Environment Variables

# FundKit Configuration
FUNDKIT_API_KEY=fk_live_your_production_key_here
FUNDKIT_ENVIRONMENT=production

# Provider Credentials - HoneyCoin
HONEYCOIN_API_KEY=hc_live_your_api_key_here
HONEYCOIN_PUBLIC_KEY=pk_live_your_public_key_here
HONEYCOIN_WEBHOOK_SECRET=your_webhook_secret_here

# Provider Credentials - EasyPay
EASYPAY_SECRET=ep_live_your_secret_here
EASYPAY_CLIENT_ID=your_client_id_here
EASYPAY_WEBHOOK_SECRET=your_webhook_secret_here

# Provider Credentials - Tola
TOLA_API_KEY=tola_live_your_api_key_here
TOLA_MERCHANT_ID=your_merchant_id_here
TOLA_WEBHOOK_SECRET=your_webhook_secret_here

# Security
ENCRYPTION_KEY=your_32_character_encryption_key
JWT_SECRET=your_jwt_secret_key
WEBHOOK_SIGNING_SECRET=your_webhook_signing_secret

Production Configuration

import { PaymentClient } from '@fundkit/core';
import { HoneyCoin } from '@fundkit/honeycoin';
import { EasyPay } from '@fundkit/easypay';
import { Tola } from '@fundkit/tola';

// Production-optimized configuration
const productionConfig = {
  // Enhanced timeouts for production reliability
  timeout: 45000,
  retries: 5,
  retryDelay: 2000,

  // Connection pooling
  maxConnections: 100,
  keepAlive: true,

  // Rate limiting
  rateLimit: {
    requests: 1000,
    window: 60000, // Per minute
    burst: 200,
  },

  // Circuit breaker
  circuitBreaker: {
    threshold: 10, // Failures before opening
    timeout: 30000, // Reset timeout
    monitor: true,
  },

  // Monitoring
  enableMetrics: true,
  enableTracing: true,

  // Security
  enableAuditLogging: true,
  logSensitiveData: false,
};

// Initialize providers with production settings
const honeycoin = new HoneyCoin({
  apiKey: process.env.HONEYCOIN_API_KEY!,
  publicKey: process.env.HONEYCOIN_PUBLIC_KEY!,
  environment: 'production',
  ...productionConfig,
});

const easypay = new EasyPay({
  apiKey: process.env.EASYPAY_SECRET!,
  clientId: process.env.EASYPAY_CLIENT_ID!,
  environment: 'production',
  ...productionConfig,
});

const tola = new Tola({
  apiKey: process.env.TOLA_API_KEY!,
  merchantId: process.env.TOLA_MERCHANT_ID!,
  environment: 'production',
  ...productionConfig,
});

// Production PaymentClient
export const paymentClient = new PaymentClient({
  apiKey: process.env.FUNDKIT_API_KEY!,
  providers: [honeycoin, easypay, tola],
  environment: 'production',
  ...productionConfig,
});

Next Steps