- add development setup steps - define branching and PR rules
# Africa
**Developer-first payments infrastructure for Africa**
Paycraft is a Stripe-inspired payments API designed for African developers.
It makes it easy to accept **M-Pesa and card payments** using clean APIs, predictable webhooks, and a powerful sandbox environment.
> Built for developers. Designed for reliability. Kenya-first, Africa-ready.
---
## ✨ Features
- 🇰🇪 **M-Pesa STK Push** (Paybill & Till ready)
- 💳 Card payments (Visa & Mastercard – roadmap)
- 🧪 **Full sandbox mode** (no real money)
- 🔁 Webhooks with retries & signature verification
- 🔐 Secure API key authentication
- ♻️ Idempotent requests (no double charges)
- 📚 Stripe-style developer documentation
---
## 🧠 Philosophy (Why Paycraft?)
Most payment gateways in Africa are built for **merchants and sales teams**.
Paycraft is built for:
- Developers
- Startups
- SaaS products
- Marketplaces
- Fintech MVPs
**Docs before dashboards. APIs before UI. Reliability before features.**
---
## 🏗️ Architecture Overview
Client App ↓ Paycraft API ↓ Sandbox Engine (test mode) OR PSP / M-Pesa (live mode) ↓ Webhook System ↓ Merchant Server
Copy code
- Test mode never touches real M-Pesa
- Live mode integrates via licensed PSPs
- Webhooks are the source of truth
---
## 🚀 Quickstart
### 1. Get API Keys
Create an account and get your keys:
- `sk_test_xxx` → Sandbox
- `sk_live_xxx` → Production
⚠️ Never expose secret keys in frontend code.
---
### 2. Install SDK (Node.js)
```bash
npm install paycraft
3. Initialize Client
Copy code
Js
import Paycraft from "paycraft";
const paycraft = new Paycraft({
secretKey: process.env.PAYCRAFT_SECRET_KEY
});
4. Create an M-Pesa Payment
Copy code
Js
const payment = await paycraft.payments.create({
amount: 1500,
currency: "KES",
method: "mpesa",
phone: "254712345678",
reference: "ORDER_1021",
callback_url: "
example.com"
});
Customer receives an STK push to confirm the payment.
🔄 Payment Lifecycle
Copy code
created → pending → successful
fa …