Skip to content

Latest commit

 

History

History
198 lines (147 loc) · 5.87 KB

File metadata and controls

198 lines (147 loc) · 5.87 KB

Payment Destination Guide

🎯 Where Do Payments Go?

Currently, your website is in demo mode, so payments are simulated and don't actually go anywhere. Here's where payments will go when you configure each payment method:


💳 Stripe Payments

Where Payments Go:

  • Stripe Account → Payments go directly to your Stripe account
  • Bank Account → Stripe automatically transfers funds to your connected bank account

How to Configure:

  1. Create Stripe Account (if you haven't):

    • Go to https://stripe.com
    • Sign up and complete account verification
    • Add your business information
  2. Connect Bank Account:

    • Go to Stripe Dashboard → SettingsBank accounts and scheduling
    • Add your bank account details
    • Stripe will transfer funds automatically (usually within 2-7 business days)
  3. Set Payout Schedule:

    • Choose daily, weekly, or monthly payouts
    • Set minimum payout amount if desired
  4. Update Your Code:

    • In script.js, replace the Stripe key with your actual publishable key
    • Set up backend to use your Stripe secret key

Result: Payments → Stripe Account → Your Bank Account


₿ Cryptocurrency Payments

Where Payments Go:

  • Your Crypto Wallet → Payments go to addresses you control
  • Payment Gateway Wallet → If using Coinbase Commerce/BitPay, they hold funds temporarily

How to Configure:

Option A: Direct to Your Wallet

  1. Generate Wallet Addresses:

    • Bitcoin: Use a Bitcoin wallet (Electrum, Exodus, etc.)
    • Ethereum: Use MetaMask or similar
    • Get receiving addresses for each cryptocurrency
  2. Update Code:

    • In script.js, find generateCryptoAddress() function
    • Replace demo addresses with your actual wallet addresses

Result: Payments → Your Crypto Wallet Addresses

Option B: Coinbase Commerce

  1. Sign Up: https://commerce.coinbase.com
  2. Get API Key: From Coinbase Commerce dashboard
  3. Configure Payout: Set up automatic payouts to your Coinbase account
  4. Update Backend: Integrate Coinbase Commerce API

Result: Payments → Coinbase Commerce → Your Coinbase Account → Your Bank (if you cash out)


📱 M-Pesa Payments

Where Payments Go:

  • M-Pesa Till Number → Payments go to your registered M-Pesa Till/Paybill number
  • M-Pesa Account → Funds appear in your M-Pesa business account

How to Configure:

  1. Register M-Pesa Business Account:

    • Contact Safaricom to register a Till Number or Paybill Number
    • Complete business verification
    • Get your Till/Paybill number
  2. Set Up Developer Account:

  3. Update Backend Configuration:

    // In your backend M-Pesa configuration
    const mpesaConfig = {
      shortcode: 'YOUR_TILL_NUMBER', // e.g., '123456'
      passkey: 'YOUR_PASSKEY',
      consumerKey: 'YOUR_CONSUMER_KEY',
      consumerSecret: 'YOUR_CONSUMER_SECRET'
    };
  4. Set Up Callback URL:

    • Configure webhook URL to receive payment confirmations
    • Update CallBackURL in STK Push request

Result: Payments → Customer's M-Pesa → Your M-Pesa Till/Paybill Number → Your Bank Account (via M-Pesa to Bank transfer)


⚙️ Configuration File

Create a config.js file (or add to your backend) to store payment recipients:

// config.js - Payment Recipients Configuration
const paymentConfig = {
  stripe: {
    publishableKey: 'pk_test_YOUR_KEY',
    // Stripe automatically routes to your connected bank account
    // Configure in Stripe Dashboard → Settings → Bank accounts
  },
  
  crypto: {
    // Your wallet addresses
    BTC: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
    ETH: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
    USDC: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
    LTC: 'ltc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
    BCH: 'bitcoincash:qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh'
  },
  
  mpesa: {
    tillNumber: '123456', // Your M-Pesa Till Number
    paybillNumber: '123456', // Your Paybill Number (if using Paybill)
    accountName: 'Your Business Name'
  },
  
  // Payment routing (if you want to split payments)
  routing: {
    default: 'primary', // 'primary' or 'split'
    splitPercentage: {
      primary: 100, // 100% to primary account
      secondary: 0   // 0% to secondary account
    }
  }
};

🔐 Security Best Practices

  1. Never expose secret keys in frontend code
  2. Use environment variables for sensitive data
  3. Store configuration on backend server
  4. Use HTTPS in production
  5. Verify payments using webhooks/callbacks
  6. Keep backup of wallet addresses and keys

📊 Payment Flow Summary

Stripe:

Customer Payment → Stripe → Your Stripe Account → Your Bank Account

Cryptocurrency:

Customer Payment → Blockchain → Your Wallet Address → Your Control

M-Pesa:

Customer Payment → Customer's M-Pesa → Your Till/Paybill → Your M-Pesa Account → Your Bank

🚨 Important Notes

  1. Demo Mode: Currently, no real payments are processed
  2. Backend Required: All payment methods need backend integration for production
  3. Compliance: Ensure you comply with local payment regulations
  4. Fees: Each payment method has different fees:
    • Stripe: ~2.9% + $0.30 per transaction
    • Crypto: Network fees (varies by blockchain)
    • M-Pesa: Transaction fees based on amount tiers
  5. Settlement Time:
    • Stripe: 2-7 business days
    • Crypto: Instant (but confirmations may take time)
    • M-Pesa: Instant to M-Pesa account

📞 Need Help?