Skip to main content

Multi-Currency Architecture

SolydFlow enables you to sell the same core product across multiple currencies without building complex exchange-rate converters or managing separate codebases for each country.

[1. Create Base Product] ➔ [2. Attach Regional Currency Packages] ➔ [3. Auto Geo-IP Detection] ➔ [4. Unified Multi-Currency Ledger]

By decoupling your high-level Product from single-currency Packages, your business can charge customers in their native currency while aggregating reporting into your primary base currency.


The "Smallest Currency Unit" Rule​

In financial software, floating-point arithmetic (e.g. 5000.00 * 0.075) introduces rounding inaccuracies that corrupt accounting ledgers.

To guarantee mathematical precision, all amounts in SolydFlow are stored and processed as integers in the smallest currency unit:

CurrencyISO CodeSmallest Unit NameDivisorExample Raw IntegerHuman-Readable Display
Nigerian NairaNGNKobo100500000₦5,000.00
Kenyan ShillingKESCents10050000KSh 500.00
Ghanaian CediGHSPesewas1006500GH₵ 65.00
South African RandZARCents1009900R 99.00
US DollarUSDCents100499$4.99
EuroEURCents100499€4.99

Multi-Currency Product Structure​

📦 Product: "Pro Workspace" ➔ Entitlement: "pro_access"
│
├── 🇳🇬 Package: pro_monthly_ngn ➔ ₦5,000 (500000 kobo) via Paystack / Monnify
├── 🇰🇪 Package: pro_monthly_kes ➔ KSh 500 (50000 cents) via M-Pesa STK Push
├── 🇬🇭 Package: pro_monthly_ghs ➔ GH₵ 65 (6500 pesewas) via Flutterwave
├── 🇿🇦 Package: pro_monthly_zar ➔ R 99 (9900 cents) via Paystack EFT
└── 🌍 Package: pro_monthly_usd ➔ $4.99 (499 cents) via Stripe (Global Fallback)

No matter which currency package a customer purchases, SolydFlow unlocks the exact same entitlement: pro_access.


Formatting Multi-Currency Prices in Code​

Never hardcode currency symbols (₦, $, KSh) into your UI. Use standard internationalization formatters that parse the currency code returned by the SDK:

lib/utils/currency_formatter.dart
import 'package:intl/intl.dart';
import 'package:solydflow_flutter/solydflow_flutter.dart';

String formatPackagePrice(SolydPackage pkg) {
// 1. Determine raw integer amount (supporting upgrade credits)
final int amount = pkg.isUpgrade
? pkg.calculatedAmountMinor
: pkg.amountMinor;

// 2. Automatically formats ₦, KSh, $, €, GH₵ based on ISO code
return NumberFormat.simpleCurrency(name: pkg.currency).format(amount);
}

// Example Outputs:
// pkg.currency: "NGN", pkg.amountMinor: 5000 ➔ "₦5,000.00"
// pkg.currency: "KES", pkg.amountMinor: 500 ➔ "KSh500.00"
// pkg.currency: "USD", pkg.amountMinor: 4.99 ➔ "$4.99"

Geo-IP Package Resolution & USD Fallback​

When your application calls SolydFlow.getOfferings():

  1. SolydFlow inspects the customer's incoming IP address.
  2. If the user connects from Nigeria, it serves pro_monthly_ngn.
  3. If the user connects from Kenya, it serves pro_monthly_kes.
  4. If the user connects from an unmapped country (e.g. Japan or Brazil), it automatically defaults to your base USD package.

This guarantees that every visitor is presented with a valid purchase option without throwing layout errors.