Payment Integration Deployment Guide
Ready to Deploy!β
The payment integration is complete and ready for deployment. Here's your step-by-step guide:
π Deployment Checklistβ
β Phase 1: Deploy toto-wallet APIsβ
-
Navigate to toto-wallet functions:
cd ../toto-wallet/functions -
Install dependencies:
npm install -
Deploy Firebase Functions:
firebase deploy --only functions
β Phase 2: Configure Environment Variablesβ
-
In Firebase Console (toto-wallet project):
- Go to Functions > Configuration
- Add environment variables:
FIREBASE_PROJECT_ID=toto-wallet
FIREBASE_REGION=us-central1
-
In toto-bo .env.local:
NEXT_PUBLIC_TOTO_WALLET_URL=https://us-central1-toto-wallet.cloudfunctions.net
NEXT_PUBLIC_TOTO_WALLET_API_KEY=your-api-key-here
β Phase 3: Deploy toto-bo Updatesβ
- Build and deploy toto-bo:
cd toto-bo
npm run build
firebase deploy --only hosting
β Phase 4: Test Payment Integrationβ
-
Test toto-wallet APIs:
curl https://us-central1-toto-wallet.cloudfunctions.net/health -
Test toto-bo integration:
curl https://bo.betoto.pet/api/payments/stats
π Architecture Deployedβ
User (toto-app) β Payment Request β toto-wallet β Payment Processing β Storage
β
toto-bo β Payment Updates β toto-wallet β Payment Confirmation
π API Endpoints Availableβ
toto-wallet (Firebase Functions)β
GET /health- Health checkGET /payments- Get all paymentsGET /payments/stats- Get payment statisticsGET /payments/:id- Get payment by IDPOST /payments- Create new paymentPUT /payments/:id/status- Update payment statusPOST /payments/donation- Process donation
toto-bo (App Hosting)β
GET /api/payments- Get payments from toto-walletGET /api/payments/stats- Get payment stats from toto-walletPOST /api/payments- Create payment in toto-wallet
π― What You Need to Doβ
- Deploy toto-wallet functions (Firebase Functions)
- Configure environment variables (Firebase Console + .env.local)
- Deploy toto-bo updates (Firebase App Hosting)
- Test the payment flow (End-to-end testing)
- Set up monitoring (Firebase Monitoring)
π Quick Start Commandsβ
# 1. Deploy toto-wallet functions
cd ../toto-wallet/functions
npm install
firebase deploy --only functions
# 2. Deploy toto-bo updates
cd ../../toto-bo
npm run build
firebase deploy --only hosting
# 3. Test integration
curl https://us-central1-toto-wallet.cloudfunctions.net/health
curl https://toto-bo-backend--toto-bo.us-central1.hosted.app/api/payments/stats
π Success Criteriaβ
- β toto-wallet APIs deployed and accessible
- β toto-bo can communicate with toto-wallet
- β Payment creation and retrieval working
- β Payment statistics available
- β Cross-service communication established
π Need Help?β
If you encounter any issues during deployment:
- Check Firebase Console for function logs
- Verify environment variables are set correctly
- Test individual endpoints
- Check network connectivity between services
Ready to deploy! π