# πŸ’³ Payment & Courier β€” Napkin Notes ## Payment Gateways (SA Market) ### Recommended Stack | Gateway | What it covers | Fees | Priority | |---------|---------------|------|----------| | **Payfast** | Cards (Visa/MC), EFT, SnapScan, Masterpass | 3.5% + R2/tx | Must-have | | **Payflex** | Buy now pay later (4 instalments) | They pay you upfront | High β€” big conversion booster for fashion | | **Yoco** | Cards, tap-to-pay (if physical retail later) | 2.6-2.95%/tx | Nice-to-have | ### Why this stack - Payfast alone covers ~90% of SA payment methods - Payflex is the killer feature for apparel β€” "R1,500 jacket? Pay R375 Γ— 4" removes price friction - Cards (Visa/MC/Amex) come free with Payfast - EFT = still king in SA, people trust bank transfers ### NOT needed (yet) - Stripe β€” limited SA support, overkill for local-first - PayPal β€” high fees, withdrawal pain in SA - Crypto β€” niche, not the market ### Integration notes - Spree has payment provider plugin architecture β€” write adapter, plug in API keys - Morne's company (NSH/INET) registers as merchant β€” they get the API keys - We build the pipe, they plug in credentials - Payfast has well-documented REST API + existing Spree community plugins --- ## Courier / Logistics (SA Market) ### Recommended: Bob Go (aggregator) - **One API** β†’ connects to 10+ SA couriers - API docs: https://api-docs.bob.co.za/bobgo - Couriers included: The Courier Guy, Pargo, RAM, SkyNet, Internet Express, DPD/Dawn Wing - Features: compare rates, print waybills, track parcels - Shopify integration exists β†’ Spree adapter needed ### What Bob Go solves (all 3 spec blockers) | Spec Action Item | Status | |-----------------|--------| | πŸ”΄ Identify suitable SA courier/API | βœ… Bob Go = one API, all couriers | | πŸ”΄ Confirm automated shipment creation | βœ… Bob Go API supports it | | πŸ”΄ Confirm waybill generation | βœ… Bob Go handles waybills | ### Direct courier alternatives (if Bob Go doesn't fit) - **The Courier Guy** β€” most popular SA e-commerce courier - **Internet Express** β€” free API integration - **CourierIT** β€” volume discounts - **Evership** β€” another aggregator (Fastway, RAM, Aramex, TCG, DPD) ### Shipping zones consideration - SA is big β€” courier coverage varies by province - Major metros (Joburg, Cape Town, Durban) = next day - Rural = 3-5 days, some couriers don't cover - Bob Go handles zone logic per courier --- ## 🏷️ Mock Convention All test/sandbox values tagged with `#mock` in code and config. When going live: `rg '#mock'` β†’ find all β†’ replace with production credentials. ``` # Example in config: PAYFAST_MERCHANT_ID=10000100 #mock PAYFAST_MERCHANT_KEY=46f0cd694581a #mock PAYFAST_PASSPHRASE=jt7NOE43FZPn #mock PAYFAST_MODE=sandbox #mock β†’ change to "live" BOBGO_API_KEY=test_xxxxxxxxxxxx #mock PAYFLEX_API_KEY=staging_xxxxx #mock ``` --- ## Open Questions - [ ] Local SA only or international shipping? - [ ] Currency: ZAR only or multi-currency? - [ ] Who registers as merchant β€” NSH or a new entity? - [ ] Cash on delivery β€” needed? (Still popular outside metros) - [ ] Payflex merchant approval β€” timeline? --- ## Architecture Summary ``` Buyer β†’ Spree Storefront (Next.js) ↓ Checkout ↓ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”‚ Payfast β”‚ β†’ Cards, EFT, SnapScan β”‚ Payflex β”‚ β†’ Buy now pay later β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ ↓ Order Created ↓ Bob Go API β†’ auto-select cheapest courier ↓ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”‚ Waybill β”‚ β†’ PDF generated β”‚ Trackingβ”‚ β†’ number assigned β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ ↓ Customer gets tracking link ```