- 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 β¦