Skip to main content

WhiskyPay Payment Gateway

The WhiskyPay Payment Gateway is the core backend infrastructure that powers the entire payment system. It’s built with Next.js and integrates with Supabase for reliable, scalable data storage.

Key Features

  • Solana Integration: Process cryptocurrency payments on the Solana blockchain
  • Session Management: Create and manage payment sessions
  • Merchant Dashboard: Register and manage merchant accounts
  • Payment Verification: Verify payment authenticity and process confirmations
  • Webhook Notifications: Notify merchants about successful payments
  • Email Notifications: Send confirmation emails to customers and merchants
  • Database Integration: Supabase backend for reliable data storage
  • API Endpoints: RESTful API for SDK and third-party integrations

Architecture

The payment gateway consists of several key components:

1. API Layer

The API layer provides endpoints for:
  • Creating payment sessions
  • Fetching session details
  • Verifying payments
  • Processing webhooks
  • Managing merchant accounts

2. Database

The system uses Supabase (PostgreSQL) for data storage with the following key tables:
  • users: Merchant information
  • tiers: Pricing tiers for each merchant
  • buyers: Customer purchase records
  • sessions: Payment session data
  • signatures: Transaction signature verification

3. Blockchain Interaction

The gateway interacts with the Solana blockchain to:
  • Verify transaction signatures
  • Validate payment amounts
  • Process token transfers

4. Notification System

After successful payments, the gateway:
  • Sends webhooks to merchant endpoints
  • Enqueues email notifications
  • Updates session status

Flow Diagram

The payment process follows this general flow:
  1. Merchant creates a payment session via SDK or API
  2. Customer selects payment method and token in the payment UI
  3. Customer submits payment transaction on Solana
  4. Gateway verifies the transaction
  5. On successful verification:
    • Database is updated
    • Merchant is notified via webhook
    • Confirmation emails are sent
    • Customer is redirected to success page

Deployment

The WhiskyPay Payment Gateway is designed to be deployed as a Next.js application on platforms like Vercel, Netlify, or any Node.js hosting environment.

Security

The gateway implements multiple security measures:
  • Input validation and sanitization
  • Rate limiting to prevent abuse
  • Transaction signature verification
  • Error logging and monitoring
  • Secure API key management

Next Steps