GreenLeaf
PayGO
Open Dashboard
Platform Guide v3.0.0

PayGO — What It Does, How It Works

Complete reference for capabilities, roles, architecture, integrations, test data, and the product roadmap. Built for GreenLeaf Technology Solutions.

1. What PayGO Can Do

PayGO is a multi-tenant PAYG solar management platform covering the full lifecycle of a solar device from warehouse to verified carbon-credit installation.

Customer Management

Register, onboard and manage solar customers with full KYC (name, national ID, GPS, phone). Bulk CSV import for 1,000+ customers at once.

Device Inventory

Track solar devices (20W–200W) from 8 manufacturers. Manage lifecycle states: Unassigned → Assigned → Active → Suspended → Decommissioned.

OpenPAYGO Tokens

Generate HMAC-SHA256 9-digit tokens compliant with OpenPAYGO Token Standard v2.0. Token types: ADD_TIME, SET_TIME, DISABLE, UNLOCK, COUNTER_SYNC.

Payment Processing

Accept Mobile Money (M-Pesa, Airtel, Tigo), Cash, USSD, and in-app payments. Arrears tracking, approval workflows, and payment schedules.

dMRV (8-Step Workflow)

Digital Measurement, Reporting & Verification for REA carbon credits. Community approval → site survey → contract → installation → photos → GPS verify → M&E → final approval.

REA Prospect API

Automatic batch submission of customer installations to the Rural Electrification Agency. Auto-submits at 50+ records, CSV download per batch, no duplicate re-submissions.

SMS Notifications

10 template types: payment confirmation, token delivery, arrears notice, device suspended, welcome. Providers: Africa's Talking, Twilio, Selcom. Per-tenant templates.

Multi-Tenancy

Multiple solar companies on one platform with full data isolation, custom branding, per-tenant SMS templates, and role-based access per company.

Reports & Analytics

Payment statistics, device utilisation, customer portfolio, dMRV pipeline status, REA submission history. Downloadable CSV reports.

2. Roles, Credentials & Test Accounts

🧪 For testing purposes only

These credentials are provided so you can explore how the system works across different roles. Use the test environment — it is safe to create, edit, and delete data here without affecting live operations.

Test environment: https://test.paygo-africa.com

RoleUsernamePasswordWhat They Can DoScreens
system_adminsysadminSysAdmin@123Full access across ALL tenants. Create tenants, manage all users, view all data, override anything.All 15 screens
business_adminmary.jumaSysAdmin@123Manage own tenant: create users, register customers, add devices, approve dMRV final step, submit to REA.Home · Customers · Devices · Payments · dMRV · Areas · Users · Tenants · Reports · REA · Billing
commercial_officertst_coPayGO@Test1Approve pending payments before tokens are released. View REA queue, submit batches, manage SMS templates.Home · Payments · Devices · REA · Billing · More
techniciantst_techPayGO@Test1Execute dMRV steps 2 (site survey), 4 (installation), 6 (photo evidence). View assigned customers and devices.Home · Customers · Devices · dMRV Pipeline
sales_reppeter.kilembaSysAdmin@123Register new customers, record payments, initiate dMRV step 3 (contract signing). Cannot approve payments.Home · Customers · Payments · dMRV Pipeline
village_chairmanali.hassan.vcSysAdmin@123Approve dMRV step 1 (community approval) for customers in their assigned area. Read-only view of area customers.Home · dMRV Pipeline · Areas & Chairmen
m_and_e_officertst_mnePayGO@Test1Execute dMRV step 7 (monitoring & evaluation). View all records across tenants. Generate dMRV compliance reports.Home · Customers · dMRV Pipeline · Reports

⚠ Security Notice

Change all default passwords before exposing the system to production traffic. Passwords must be 8+ characters with uppercase, lowercase, digit, and special character.

Account Lockout Policy

5 failed login attempts within 5 minutes triggers a 15-minute lockout. System admin can unlock accounts manually from the Users screen.

3. Tests Conducted

The automated test suite covers end-to-end API flows across all services. Run with python tests/test_api.py (local) or via GitHub Actions CI on every push.

API & Service Tests

  • Health checks — all 5 services + gateway
  • User login — valid, invalid, locked-out
  • JWT token refresh and expiry
  • API key generation and validation
  • Device CRUD + bulk CSV upload
  • Device assignment to customer
  • Customer registration + bulk import
  • Contract creation and pricing
  • Payment processing (mobile money)
  • Payment processing (cash + approval)
  • Arrears calculation and grace period
  • OpenPAYGO token generation (ADD_TIME)
  • OpenPAYGO token generation (DISABLE/UNLOCK)
  • Token counter synchronisation

Workflow & Integration Tests

  • dMRV all 8 steps — sequential approval
  • Village chairman area assignment
  • Area code hierarchy (region→village)
  • SMS delivery (mock provider)
  • SMS template substitution (10 templates)
  • Mobile money webhook (HMAC verified)
  • REA Prospect API batch submission
  • Duplicate submission prevention
  • Multi-tenant data isolation
  • RBAC — role permission enforcement
  • USSD payment endpoint
  • Payment approval (commercial_officer)
  • Firebase smoke test (hosted functions)
  • Reports endpoint — payment statistics

Seed Data for Testing

50 Device Templates tests/seed_devices.csv

8 manufacturers · 4 wattage classes · pre-configured OpenPAYGO starting codes and secret keys · REA project flags. Import via Admin Dashboard → Devices → Bulk Upload.

50 Customer Templates tests/seed_customers.csv

Realistic Tanzanian names, phone numbers (Vodacom/Airtel/Tigo), national IDs, 20 area codes across 15 regions, GPS coordinates. Import via Admin Dashboard → Customers → Bulk Upload.

4. System Architecture & Data Relationships

Client Layer

Web Browser

Admin & analytics dashboard

Mobile App

PayGO Touch (Android)

USSD / SMS

Feature phones

API Gateway — single entry point for all traffic
Security & SSL Rate Limiting Load Balancing Response Cache Request Correlation
Microservices — independent, independently deployable

Auth

Login · JWT · Roles

Devices

Inventory · Tokens

Customers

KYC · dMRV · REA

Payments

Mobile money · Cash

Notifications

SMS · Alerts

Data Layer

Database

Customers · Payments · Devices · Contracts · dMRV · Tokens

Cache

Sessions · Rate limits · API response cache

External Services

Mobile Money

Payment collection

SMS Gateway

Token delivery

REA API

Carbon credits

File Storage

dMRV photo evidence

Key Data Model Relationships

Tenant (1) ──── (many) User
Tenant (1) ──── (many) Device
Tenant (1) ──── (many) Customer
Tenant (1) ──── (many) AreaCode

Customer (1) ──── (1)    Contract  ←── links to ──→  Device
Contract (1) ──── (many) Payment
Payment  (1) ──── (1)    Token      (OpenPAYGO 9-digit code)

Customer (1) ──── (1)    DMRVRecord  (8 steps, sequential)
DMRVRecord(1) ──── (1)    ProspectLog (REA submission)

AreaCode  (1) ──── (many) Customer
AreaCode  (many)─ (many) VillageChairman (User)

DeviceType(1) ──── (many) Device
Manufacturer(1)─── (many) Device

5. Use Cases & Workflows

Payment → Token Generation Flow
1

Customer initiates payment

Via mobile money (STK Push to phone), USSD (*150#), Cash to sales rep, or in-app.

2

Payment Service validates

Checks customer exists, contract is active, verifies mobile money confirmation via provider API.

3

Commercial Officer approval (cash only)

Cash payments queue for CO approval. Limits: 3 per day, 10 per week per approver.

4

Arrears cleared first

If balance is overdue, payment covers arrears before adding new credit days.

5

OpenPAYGO token generated

HMAC-SHA256 9-digit token calculated from device secret key + token counter. Type: ADD_TIME.

6

SMS sent to customer

"Malipo ya TZS 10,000 yamepokelewa. Nambari yako ya siku 30: 123 456 789. Asante!"

7

Customer enters token on device

Device validates token locally (no internet needed). If valid, credit time added.

dMRV 8-Step Verification Workflow
StepNameRoleWhat HappensEvidence
01Community Approvalvillage_chairmanChairman verifies customer lives in their area and approves installationDigital signature + timestamp
02Site SurveytechnicianTechnician visits site, captures GPS coordinates, assesses roof/electrical readinessGPS lat/long, site notes
03Contract Signingsales_repCustomer signs PAYG contract, payment schedule agreedContract ID, customer PIN
04Device InstallationtechnicianDevice installed, serial number recorded, customer trained on useDevice serial, install timestamp
05Initial Paymentsales_repDown payment collected, first token generated and deliveredPayment reference, token
06Photo EvidencetechnicianPhotos uploaded: device on wall, solar panel on roof, customer holding token3× geotagged photos
07M&E Verificationm_and_e_officerIndependent officer reviews all evidence, visits site if requiredM&E approval notes
08Final Approvalbusiness_adminBusiness admin approves complete record for REA submissionApproval timestamp + REA batch ID
Customer Onboarding → Device Active

1. Register customer — Sales rep captures name, phone, national ID, GPS, area code via PayGO Touch app (works offline, syncs when online).

2. Select device — Choose available device from inventory (must be UNASSIGNED). Assign to customer → device becomes ASSIGNED.

3. Create contract — Set plan price, down payment, monthly amount, grace period. System auto-calculates payment schedule.

4. Process down payment — First payment generates first OpenPAYGO token. Device status → ACTIVE. SMS sent with token.

5. dMRV (if REA project) — If device is flagged as REA project, the 8-step verification must complete before REA submission.

6. Ongoing payments — Each payment generates a new token, extending device runtime. Missed payments → device auto-suspended after grace period.

6. External Platform Integrations

How PayGO communicates with the outside world — one platform at a time.

MM

Mobile Money — M-Pesa, Airtel Money, Tigo Pesa

Payment collection and confirmation

How it works (Outbound — STK Push)

1
PayGO sends STK Push request to Vodacom API with amount + customer phone
2
Customer's phone displays payment prompt — they enter M-Pesa PIN
3
Vodacom sends webhook POST to /webhook/mobile-money with HMAC-SHA256 signature
4
PayGO verifies signature, marks payment COMPLETED, generates token

Config required

MPESA_CONSUMER_KEY=...
MPESA_CONSUMER_SECRET=...
MPESA_SHORTCODE=123456
AIRTEL_API_KEY=...
TIGO_API_KEY=...
WEBHOOK_HMAC_SECRET=...

Webhook URL: https://paygo-africa.com/api/v1/webhook/mobile-money

SMS

SMS — Africa's Talking, Twilio, Selcom

Token delivery, payment confirmation, arrears notices

Flow (Outbound only)

1
Payment Service calls Notification Service with event type + customer data
2
Notification Service selects tenant's SMS template, substitutes variables (name, token, days, amount)
3
Primary provider (Africa's Talking) sends SMS. Falls back to Twilio if AT fails.
4
Delivery status logged. Failed SMS retried up to 3 times.

Config required

AT_API_KEY=...
AT_USERNAME=...
AT_SENDER_ID=PayGO
TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
TWILIO_FROM=+1XXXXXXXXXX

10 pre-built templates. Business Admins and COs can edit templates per tenant via the CMS.

WA

WhatsApp Business API

Not yet integrated — roadmap item

WhatsApp is the most widely used messaging app in East Africa. Integration would allow:

  • Token delivery via WhatsApp (higher open rate than SMS)
  • Payment reminders with interactive "Pay Now" buttons
  • Customer self-service: type "TOKEN" to get latest code, "BALANCE" to check outstanding
  • Photo upload for dMRV evidence directly from customer's WhatsApp

How to get there:

1
Apply for WhatsApp Business API account via Meta Business Manager
2
Get approved phone number (company phone or virtual +255 number)
3
Add whatsapp provider to Notification Service alongside SMS providers
4
Register WhatsApp message templates ("payment_token", "payment_reminder") via Meta
5
Add webhook endpoint /webhook/whatsapp for inbound messages (customer self-service)

Email — Gmail SMTP / SendGrid

User welcome emails, billing invoices, system alerts

Current usage

  • Welcome email when a new User account is created
  • Password reset links
  • System admin alerts for failed REA submissions
  • Monthly billing summary to Business Admins

Config required

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=noreply@paygo-africa.com
SMTP_PASS=...  # app-specific password
FROM_NAME=PayGO Platform
REA

REA Prospect API — tz.prospect.energy

Carbon credit registration for rural electrification

1
Customers who complete dMRV all 8 steps are queued for REA submission
2
System auto-submits when queue reaches 50, or CO/Business Admin submits manually
3
Batch HTTP POST to https://tz.prospect.energy/api/submissions with encrypted API token
4
Idempotency key prevents double submission. ProspectLog records status per customer.
5
CSV report downloadable per batch for offline audit trail

Cloud Platform

Hosting · Database · Auth · File Storage · API layer

Database

Primary persistent data store. Stores all tenants, customers, contracts, payments, and dMRV records with real-time sync.

API Layer

All microservice logic is containerised and deployed for low-latency access in East Africa.

File Storage

dMRV photo evidence and uploaded documents are stored with per-tenant folder isolation and secure access controls.

7. Future Plan Services

Planned expansion services ranked by business impact. Detailed implementation plans are maintained in internal documentation.

Full implementation details, technical specifications, and monetisation models are available to authorised team members in the internal documentation.

High Impact · Near-term

Carbon Credit Trading

Each verified dMRV installation generates Verified Carbon Units. PayGO brokers these credits to international buyers via established carbon markets.

Revenue share
High Impact · Near-term

Customer Micro-Loans & Savings

Customers with 6+ months of consistent payments have a proven credit profile. Platform offers micro-loans and a savings pool backed by payment history data.

Financial inclusion
Medium Impact · Short-term

WhatsApp Self-Service Bot

Customers send simple messages to receive their token, check their balance, or trigger a payment — no sales rep or USSD code needed.

Customer experience
Medium Impact · Mid-term

Agent Commission Wallet

Built-in earnings wallet for sales agents — tracks commissions per activation and payment, enables withdrawals via mobile money, replaces manual reconciliation.

Channel growth
Medium Impact · Mid-term

Productive Use Appliance Financing

PAYG financing for water pumps, refrigerators, sewing machines, and phone charging kiosks — all tracked on the same platform alongside the solar device.

Upsell revenue
Future · Long-term

Device Insurance Cover

Optional monthly cover added to the payment plan for theft and damage. Claims filed directly in PayGO Touch with photo evidence, processed through a licensed insurer partner.

Recurring revenue
Future · Long-term

B2B White-Label Platform

License the PayGO engine to other solar companies in Kenya, Uganda, Rwanda, and Mozambique. The multi-tenant architecture is already built — expansion requires a self-serve onboarding flow and usage-based billing.

Platform play