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 Account → Payments go directly to your Stripe account
- Bank Account → Stripe automatically transfers funds to your connected bank account
-
Create Stripe Account (if you haven't):
- Go to https://stripe.com
- Sign up and complete account verification
- Add your business information
-
Connect Bank Account:
- Go to Stripe Dashboard → Settings → Bank accounts and scheduling
- Add your bank account details
- Stripe will transfer funds automatically (usually within 2-7 business days)
-
Set Payout Schedule:
- Choose daily, weekly, or monthly payouts
- Set minimum payout amount if desired
-
Update Your Code:
- In
script.js, replace the Stripe key with your actual publishable key - Set up backend to use your Stripe secret key
- In
Result: Payments → Stripe Account → Your Bank Account
- Your Crypto Wallet → Payments go to addresses you control
- Payment Gateway Wallet → If using Coinbase Commerce/BitPay, they hold funds temporarily
-
Generate Wallet Addresses:
- Bitcoin: Use a Bitcoin wallet (Electrum, Exodus, etc.)
- Ethereum: Use MetaMask or similar
- Get receiving addresses for each cryptocurrency
-
Update Code:
- In
script.js, findgenerateCryptoAddress()function - Replace demo addresses with your actual wallet addresses
- In
Result: Payments → Your Crypto Wallet Addresses
- Sign Up: https://commerce.coinbase.com
- Get API Key: From Coinbase Commerce dashboard
- Configure Payout: Set up automatic payouts to your Coinbase account
- Update Backend: Integrate Coinbase Commerce API
Result: Payments → Coinbase Commerce → Your Coinbase Account → Your Bank (if you cash out)
- 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
-
Register M-Pesa Business Account:
- Contact Safaricom to register a Till Number or Paybill Number
- Complete business verification
- Get your Till/Paybill number
-
Set Up Developer Account:
- Register at https://developer.safaricom.co.ke
- Create an app and get API credentials
- Configure your Till/Paybill number in the app settings
-
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' };
-
Set Up Callback URL:
- Configure webhook URL to receive payment confirmations
- Update
CallBackURLin STK Push request
Result: Payments → Customer's M-Pesa → Your M-Pesa Till/Paybill Number → Your Bank Account (via M-Pesa to Bank transfer)
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
}
}
};- Never expose secret keys in frontend code
- Use environment variables for sensitive data
- Store configuration on backend server
- Use HTTPS in production
- Verify payments using webhooks/callbacks
- Keep backup of wallet addresses and keys
Customer Payment → Stripe → Your Stripe Account → Your Bank Account
Customer Payment → Blockchain → Your Wallet Address → Your Control
Customer Payment → Customer's M-Pesa → Your Till/Paybill → Your M-Pesa Account → Your Bank
- Demo Mode: Currently, no real payments are processed
- Backend Required: All payment methods need backend integration for production
- Compliance: Ensure you comply with local payment regulations
- 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
- Settlement Time:
- Stripe: 2-7 business days
- Crypto: Instant (but confirmations may take time)
- M-Pesa: Instant to M-Pesa account
- Stripe Support: https://support.stripe.com
- Coinbase Commerce: https://commerce.coinbase.com/support
- M-Pesa Support: https://developer.safaricom.co.ke/support