Blog / Fintech and payments
Building payments for a product that sells in several countries
Selling in a second country looks like a pricing problem: show prices in pounds as well as naira. It is really a data problem. Decisions made in the first version, about how amounts are stored and which gateway handles what, are expensive to undo once real money has moved.
Store every amount with its currency
Every amount in your database should have two parts: a whole number in the currency’s smallest unit, and a currency code. ₦25,000 is stored as 2500000 and NGN. £20 is 2000 and GBP. Never store a bare number and assume the currency, and never use floating point for money.
Not every currency has two decimal places. The Japanese yen has none, and some currencies, such as the Kuwaiti dinar, have three. Look up each currency’s minor unit rather than multiplying everything by 100.
Never convert stored money
Keep each amount in the currency it was actually paid in. If you want reports in one currency, convert when you report, using the rate for that date, and say which rate you used. Converting stored balances on the fly means a customer’s balance changes every time the exchange rate does.
One ledger, accounts per currency
A user who holds naira and dollars has two balances, not one. In a double-entry ledger, each currency has its own accounts, and every entry stays within one currency. A currency exchange is then two pairs of entries, one in each currency, linked to the same conversion record with the rate stored on it.
Route to the right gateway
No single gateway is best everywhere. A product selling in Nigeria and the UK might use Paystack for Nigerian customers and Stripe for UK customers, behind one checkout. Build a payments layer that picks the gateway by the customer’s country and currency, so the rest of the code never needs to know which one ran. This table compares the three we use most.
Know who pays for conversion
When a customer pays in a currency different from your account’s, someone pays to convert it. Stripe, for example, lists an extra 2% for currency conversion on UK accounts and 1% on US accounts. Decide whether to price in each local currency, so customers pay in their own money and you absorb or price in the cost, or to charge in one currency and let the customer’s bank convert.
Settlement in each currency
Money collected in pounds settles to a pounds account; naira to a naira account. Your reconciliation has to run per currency and per gateway. Plan where each currency will land before launch, because opening foreign currency accounts takes time.
Prices and taxes per country
- Set prices per currency deliberately, rather than converting daily, or your prices will look random.
- VAT and sales taxes differ by country and sometimes by product. Store the tax amount on each transaction, separately from the price.
- Show customers the total, in their currency, before they pay.
Rules beyond the software
Selling abroad can bring tax registration, foreign exchange rules and, for money-holding products, licensing questions in each country. Take advice from an accountant and a lawyer for each market before you switch it on.
Where this comes from. We do this work for clients. See fintech and payment systems, or the case study on Gamestakers.
Questions about this post? Email contact@naxfront.com. Nancy reads every one.