Skip to main content

Payment Service Configuration

Environment Variables

Database

DATABASE_URL=postgresql://user:password@localhost:5432/payment_rs

Server

HOST=0.0.0.0
PORT=8001

Logging

RUST_LOG=info,payment_rs=debug

OpenTelemetry

OTLP_ENDPOINT=http://otel-collector:4317
OTLP_SERVICE_NAME=payment

PayFast Configuration

PAYFAST_MERCHANT_ID=your-merchant-id
PAYFAST_MERCHANT_KEY=your-merchant-key
PAYFAST_PASSPHRASE=your-passphrase
PAYFAST_SANDBOX=true # or false for production
PAYFAST_RETURN_URL=https://your-app.com/payment/return
PAYFAST_CANCEL_URL=https://your-app.com/payment/cancel
PAYFAST_NOTIFY_URL=https://your-app.com/payment/webhook

Yoco Configuration

YOCO_SECRET_KEY=your-yoco-secret-key
YOCO_SANDBOX=true # or false for production

Stripe Configuration (Future)

STRIPE_SECRET_KEY=your-stripe-secret-key
STRIPE_WEBHOOK_SECRET=your-webhook-secret

Configuration Files

Cargo.toml

Rust project dependencies and metadata.

Database Migrations

Located in migrations/ directory:

  • 0001_init.sql - Initial schema
  • 0002_subscription_templates.sql - Subscription templates
  • 0003_invoices_and_enhancements.sql - Invoice support

Provider Selection

The service selects providers based on:

  1. Explicit provider in request
  2. Default provider configuration
  3. Currency-based selection (future)

Webhook Configuration

Configure webhook URLs for each provider to receive payment status updates.