Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions data/providers/orange-money-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"faq": {
"url": "https://developer.orange.com/apis/om-webpay/faq",
"kind": "official_docs",
"observed_at": "2026-12-01"
"observed_at": "2026-12-01",
"note": "The FAQ sends merchants to their local Orange operator for costs."
},
"umoa-register-2026-06": {
"url": "https://www.cb-umoa.org/sites/default/files/Liste%20%20des%20EME%20ET%20EP%20de%20l%27UMOA%202026.pdf",
Expand Down Expand Up @@ -166,8 +167,11 @@
"integration": {
"public_pricing": {
"value": false,
"source": "faq",
"note": "The FAQ sends merchants to their local Orange operator for costs."
"source": "faq"
},
"pricing_route": {
"value": "local_operator",
"source": "faq"
}
},
"onboarding": {
Expand Down
4 changes: 4 additions & 0 deletions data/providers/passerelle.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@
"value": false,
"source": "terms"
},
"pricing_route": {
"value": "dashboard",
"source": "terms"
},
"docs_url": "https://docs.passerelle.abecedaire.tg"
},
"onboarding": {
Expand Down
4 changes: 4 additions & 0 deletions data/providers/paydunya.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
"value": false,
"source": "pricing"
},
"pricing_route": {
"value": "sales",
"source": "pricing"
},
"docs_url": "https://developers.paydunya.com/doc/FR/introduction"
},
"onboarding": {
Expand Down
100 changes: 50 additions & 50 deletions data/providers/saspay.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ A provider belongs to one or more families:
amount, cap, minimum, tiers, VAT, payer, plan. A rate a standard
online payment does not pay is marked `restricted_to` (`in_person`,
`merchant_app`, `segment`) and left out of the home fee card. So is a rate
the source gives only as a floor ("from X%"), marked `starting_rate`.
the source gives only as a floor ("from X%"), marked `starting_rate`. A rate read from a merchant account cites an
`integrator_evidence` source; its note then heads the country card, apart
from the published rates. When a provider publishes no fee table but says
where its fees are found, `integration.pricing_route` records it.
- **settlements**: how long collected money takes to reach the merchant, per
destination (mobile money, bank account) and country when the source names
one, automatic or on request. One entry per statement: a provider whose
Expand Down
2 changes: 2 additions & 0 deletions src/components/FeeCountryCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const folded = (index: number): '' | undefined => (extra > 0 && index >= FIRST_L
<h4>{countryName(locale, card.country)}</h4>
{currencies.length > 0 && <small>{currencies.join(', ')}</small>}
</header>
{card.unpublished !== '' && <p class="fee-unpublished"><NoteText locale={locale} note={card.unpublished} /></p>}
{card.common !== '' && <p class="fee-common">{card.common}</p>}
<div id={listId}>
{
Expand Down Expand Up @@ -112,6 +113,7 @@ const folded = (index: number): '' | undefined => (extra > 0 && index >= FIRST_L
.fee-card h4 { margin: 0; font: inherit; }
.fee-card header small { margin-left: auto; font: 400 var(--text-2xs) var(--mono); color: var(--ink-3); }
.fee-common { margin: 0 0 var(--space-1); font-size: var(--text-2xs); color: var(--ink-3); }
.fee-unpublished { margin: 0 0 var(--space-0-5); font-size: var(--text-2xs); color: var(--safran-text); }
.fee-plan { margin: var(--space-2-5) 0 0; font: 500 var(--text-4xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--safran-text); }
.fee-plan-common { margin: var(--space-1) 0 0; font-size: var(--text-2xs); color: var(--ink-3); }
.fee-lines { margin: 0; padding: 0; list-style: none; }
Expand Down
8 changes: 6 additions & 2 deletions src/components/provider/PrivateFees.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ interface Props {
}

const { locale, provider, statement } = Astro.props;
const { source, note } = statement;
const { note } = statement;
// The sentence, its link and its date must come from the page that states it.
const { source } = provider.integration.pricing_route ?? statement;
const strings = providerStrings(locale);
const t = strings.gaps.privateFees;
const { url, observedAt } = sourceLink(provider, source, strings);
const onPricing = source === 'pricing';
const route = provider.integration.pricing_route?.value;
const text = route === undefined ? t.text : t.routes[route];
---

<GapPanel stated drawing={SECTION_ICONS.privateFees} title={t.title} text={t.text(provider.name)} seen={onPricing ? t.seenOnPricing(observedAt) : t.seen(observedAt)} {...(note === undefined ? {} : { note: dataText(locale, note) })}>
<GapPanel stated drawing={SECTION_ICONS.privateFees} title={t.title} text={text(provider.name)} seen={onPricing ? t.seenOnPricing(observedAt) : t.seen(observedAt)} {...(note === undefined ? {} : { note: dataText(locale, note) })}>
<a class="gap-go" href={url} rel="nofollow noopener noreferrer" target="_blank">{onPricing ? t.openPricing : t.openSource} <span aria-hidden="true">→</span><span class="visually-hidden">{strings.newTab}</span></a>
<a href={localePath(locale, reportPath(provider.slug, 'fees'))}>{t.report} <span aria-hidden="true">→</span></a>
</GapPanel>
16 changes: 6 additions & 10 deletions src/i18n/data-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ export const DATA_FR: Readonly<Record<string, string>> = {
"API de paiement web d’Orange pour Orange Money : le client paie sur le site du marchand depuis son portefeuille, avec un code à usage unique reçu par USSD. Réservée aux marchands Orange Money enregistrés, qui s’inscrivent en boutique Orange dans leur pays ; les tarifs viennent de l’opérateur Orange local.",
"Listed on both the API overview and its FAQ. The overview also names DR Congo and the Central African Republic, and the FAQ names Liberia; those three are left out until the sources agree.":
"Cité à la fois sur la présentation de l’API et dans sa FAQ. La présentation nomme aussi la RD Congo et la Centrafrique, la FAQ le Liberia ; ces trois pays sont écartés tant que les sources ne concordent pas.",
"The FAQ sends merchants to their local Orange operator for costs.":
"Pour les coûts, la FAQ renvoie le marchand vers son opérateur Orange local.",
"Merchants sign up in an Orange store in their country and must already be registered Orange Money merchants. Integrators need Orange Money merchant status too.":
"Le marchand s’inscrit en boutique Orange dans son pays et doit déjà être marchand Orange Money enregistré. Les intégrateurs doivent aussi avoir ce statut.",
"Mobile money of the Yas operators in Togo, Senegal and Tanzania, run by a different company in each country. Businesses collect payments and pay out in bulk after contacting the operator. No public developer documentation was found on 2026-12-01.":
Expand Down Expand Up @@ -580,15 +578,13 @@ export const DATA_FR: Readonly<Record<string, string>> = {
"Vente ou revente de services VPN",
"Sale or resale of IPTV services":
"Vente ou revente de services IPTV",
"Merchant dashboard rate, not published, shown as added to the amount. The home page advertises from 1.8%.":
"Taux du tableau de bord marchand, non publié, affiché comme ajouté au montant. La page d’accueil annonce dès 1,8 %.",
"Merchant dashboard rate, not published, shown as added to the amount sent.":
"Taux du tableau de bord marchand, non publié, affiché comme ajouté au montant envoyé.",
"Card rate advertised on the home page. The page also states a fixed 100 FCFA per transaction without saying which rates it adds to. Check the rate applied to your account before committing.":
"Taux carte annoncé sur la page d’accueil. La page indique aussi 100 FCFA fixes par transaction sans préciser à quels taux ils s’ajoutent. Vérifiez le taux appliqué à votre compte avant de vous engager.",
"Networks and payouts listed in the pricing table of the merchant dashboard.":
"Réseaux et reversements listés dans la grille tarifaire du tableau de bord marchand.",
'Rate advertised on the home page; for mobile money, that of the cheapest method in the country. The page also states a fixed 100 FCFA per transaction without saying which rates it adds to. Check the rate applied to your account before committing.':
"Taux annoncé sur la page d’accueil ; pour le mobile money, celui du moyen le moins cher du pays. La page mentionne aussi 100 FCFA fixes par transaction sans dire à quels taux ils s’ajoutent. Vérifiez le taux appliqué à votre compte avant de vous engager.",
'Card taken from the home page.': 'Carte reprise de la page d’accueil.',
"Unless stated otherwise, rates are those of the home page, for mobile money that of the cheapest method in the country. The page also states a fixed 100 FCFA without saying which rates it adds to. Check the rate on your account.":
"Sauf mention, taux de la page d’accueil, celui du moyen le moins cher du pays pour le mobile money. La page cite aussi 100 FCFA fixes sans dire à quels taux ils s’ajoutent. Vérifiez le taux de votre compte.",
"Mobile money: merchant dashboard, 2026-12-04, fees added to the amount. Home page: from 1.8%.":
"Mobile money : tableau de bord, 04/12/2026, frais ajoutés au montant. Page d’accueil : dès 1,8 %.",
"Merchant dashboard, 2026-12-04. Fees shown as added to the amount sent.":
"Tableau de bord, 04/12/2026. Frais affichés comme ajoutés au montant envoyé.",
};
5 changes: 5 additions & 0 deletions src/i18n/provider-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const PROVIDER_EN: ProviderStrings = {
privateFees: {
title: 'Fees not public',
text: (name) => `${name} does not publish a fee table. Contact the provider to know the fees for your business.`,
routes: {
sales: (name) => `${name} does not publish a fee table. It refers merchants to its sales team.`,
local_operator: (name) => `${name} does not publish a fee table. Ask the operator in your country for the fees.`,
dashboard: (name) => `${name} does not publish a fee table. Fees are shown at sign-up or in the dashboard.`,
},
seenOnPricing: (date) => `Seen on its pricing page on ${date}`,
seen: (date) => `Seen on ${date}`,
openPricing: 'See its pricing page',
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/provider-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const PROVIDER_FR: ProviderStrings = {
privateFees: {
title: 'Tarifs non publics',
text: (name) => `${name} ne publie pas de grille tarifaire. Contactez le service pour connaître les frais de votre activité.`,
routes: {
sales: (name) => `${name} ne publie pas de grille tarifaire. Il renvoie vers son service commercial.`,
local_operator: (name) => `${name} ne publie pas de grille tarifaire. Les frais s’obtiennent auprès de l’opérateur de votre pays.`,
dashboard: (name) => `${name} ne publie pas de grille tarifaire. Les frais sont affichés à l’inscription ou dans le tableau de bord.`,
},
seenOnPricing: (date) => `Constaté sur sa page Tarifs, le ${date}`,
seen: (date) => `Constaté le ${date}`,
openPricing: 'Voir sa page Tarifs',
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/provider-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export interface GapStrings {
readonly privateFees: {
readonly title: string;
readonly text: (name: string) => string;
/** Replaces `text` when the provider says where its fees are found. */
readonly routes: Readonly<Record<'sales' | 'local_operator' | 'dashboard', (name: string) => string>>;
readonly seenOnPricing: (date: string) => string;
readonly seen: (date: string) => string;
readonly openPricing: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/data-texts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function displayedTexts(provider: Provider): string[] {
const { integration, onboarding, operations } = provider;
const facts = [
integration.public_docs, integration.sandbox, integration.webhook_signature, integration.official_sdks,
integration.public_pricing, integration.status_page,
integration.public_pricing, integration.pricing_route, integration.status_page,
onboarding.signup, onboarding.individuals_allowed, onboarding.documents, onboarding.days, onboarding.security_deposit,
operations.transaction_limits, operations.recurring_payments, operations.ecommerce_plugins,
operations.payout_requirements, operations.prohibited_activities,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/fee-sheet-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface FeeSection {

export interface FeeCountry {
country: string;
/** What the rates read from a merchant account share, empty when the card has none apart. */
unpublished: string;
/** What every fee of the country shares, said once at the top of its card. */
common: string;
/** The fees outside any plan first, then one block per plan in data order. */
Expand Down
39 changes: 35 additions & 4 deletions src/lib/fee-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function feeSections(provider: Provider, lookups: Lookups, strings: Provi

const own = distinct(fees.filter((fee) => fee.method.brand === provider.slug).map((fee) => methodKey(fee.method)));
const context: SheetContext = { provider, lookups, strings, union: sharedUnion(fees, lookups), ownAlone: own.length === 1 };
const lift = sharedLift(fees, NOTHING);
const lift = directionLift(fees, provider);
const plans = distinct(fees.map((fee) => fee.plan ?? null));
const plan = plans.length === 1 ? (plans[0] ?? null) : null;
const shared = sentences([plan === null ? undefined : strings.fees.plan(dataText(strings.locale, plan)), ...liftTexts(lift, context)]);
Expand All @@ -85,6 +85,33 @@ function sharedUnion(fees: Fee[], lookups: Lookups): string | undefined {
return unions.length === 1 ? unions[0] : undefined;
}

/** A rate read from a merchant account rather than published. */
function isPrivate(fee: Fee, provider: Provider): boolean {
return provider.sources[fee.source]?.kind === 'integrator_evidence';
}

/** Published and private rates side by side, every private one saying where it comes from: otherwise the published note would seem to cover it. */
function setsApart(fees: Fee[], provider: Provider): boolean {
const hidden = fees.filter((fee) => isPrivate(fee, provider));

return hidden.length > 0 && hidden.length < fees.length && hidden.every((fee) => fee.note !== undefined);
}

/** Beside private rates, the note the published ones share still counts as the direction's. */
function directionLift(fees: Fee[], provider: Provider): Lift {
const published = fees.filter((fee) => !isPrivate(fee, provider));
const lift = sharedLift(fees, NOTHING);

return setsApart(fees, provider) ? { ...lift, note: shared(published, (fee) => fee.note) } : lift;
}

/** The note the private rates of a card share, when its direction also has published rates. */
function privateNote(card: Fee[], direction: Fee[], provider: Provider): string | undefined {
const hidden = card.filter((fee) => isPrivate(fee, provider));

return hidden.length > 0 && setsApart(direction, provider) ? shared(hidden, (fee) => fee.note) : undefined;
}

/** What every fee shares and is not said by `above` yet. */
function sharedLift(fees: Fee[], above: Lift): Lift {
return {
Expand Down Expand Up @@ -114,13 +141,17 @@ function countryOrder(fees: Fee[], provider: Provider): string[] {

/** A country with a single fee keeps its conditions on the line rather than above it. */
function countryCard(country: string, all: Fee[], section: { lift: Lift; single: boolean }, context: SheetContext): FeeCountry {
const fees = all.filter((fee) => fee.country === country);
const here = all.filter((fee) => fee.country === country);
const apart = privateNote(here, all, context.provider);
const fees = apart === undefined ? here : here.map((fee) => (isPrivate(fee, context.provider) ? { ...fee, note: undefined } : fee));
const own = fees.length > 1 ? sharedLift(fees, section.lift) : NOTHING;
const said = merge(section.lift, own);
const plans = section.single ? [null] : distinct([...(fees.some((fee) => fee.plan === undefined) ? [null] : []), ...fees.map((fee) => fee.plan ?? null)]);
const blocks = plans.map((plan) => planBlock(plan, fees.filter((fee) => section.single || (fee.plan ?? null) === plan), said, context));

return { country, common: sentences(liftTexts(own, context)), blocks };
const unpublished = apart === undefined ? '' : sentences([dataText(context.strings.locale, apart)]);

return { country, unpublished, common: sentences(liftTexts(own, context)), blocks };
}

/** A plan of several fees says once, under its name, what they all share and the card does not say yet. */
Expand All @@ -147,7 +178,7 @@ function entry(fee: Fee, said: Lift, context: SheetContext): Entry {
const left: Lift = {
payer: said.payer === undefined ? fee.payer : undefined,
vat: said.vat === undefined ? fee.vat_included : undefined,
note: said.note === undefined ? fee.note : undefined,
note: said.note === fee.note ? undefined : fee.note,
};

const rate = rateText(fee, strings);
Expand Down
3 changes: 3 additions & 0 deletions src/schema/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export const SANDBOX_ACCESS = ['self_serve', 'after_kyc', 'none'] as const;
/** How a merchant asks for an account: `online` on its own, `on_request` by contacting the provider first. */
export const SIGNUP_ROUTES = ['online', 'on_request'] as const;

/** Where a provider that publishes no fee table says its fees are found. */
export const PRICING_ROUTES = ['sales', 'local_operator', 'dashboard'] as const;

/** `shared_secret`: a static secret echoed in a header, not a signature of the payload. */
export const WEBHOOK_SIGNATURES = ['hmac', 'asymmetric', 'shared_secret', 'ip_allowlist', 'none'] as const;

Expand Down
2 changes: 2 additions & 0 deletions src/schema/provider-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
INCIDENT_TYPES,
LICENCE_TYPES,
METHOD_KINDS,
PRICING_ROUTES,
SANDBOX_ACCESS,
SETTLEMENT_DESTINATIONS,
SETTLEMENT_TRIGGERS,
Expand Down Expand Up @@ -126,6 +127,7 @@ export const integrationSchema = z.strictObject({
webhook_signature: sourcedFact(z.enum(WEBHOOK_SIGNATURES)).optional(),
official_sdks: sourcedFact(z.array(z.string().min(1))).optional(),
public_pricing: sourcedFact(z.boolean()).optional(),
pricing_route: sourcedFact(z.enum(PRICING_ROUTES)).optional(),
status_page: sourcedFact(webUrlSchema.nullable()).optional(),
docs_url: webUrlSchema.optional(),
});
Expand Down
38 changes: 38 additions & 0 deletions tests/fee-sheet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,41 @@ describe('feeSections', () => {
expect(section?.cards.map((card) => card.country)).toEqual(['SN', 'BJ', 'TG']);
});
});

describe('rates read from a merchant account', () => {
const sources = { evidence: SOURCE, account: { ...SOURCE, kind: 'integrator_evidence' } };
const fees = [
fee('TG', MOMO, 3, { source: 'account', note: 'Dashboard' }),
fee('TG', CARD, 5, { note: 'Home page' }),
fee('BJ', CARD, 5, { note: 'Home page' }),
];
const record = providerSchema.parse(provider({ slug: 'two-pay', sources: { ...sources, evidence: { ...SOURCE, kind: 'official_page' } }, fees, coverage: [] }));
const [collection] = feeSections(record, LOOKUPS, PROVIDER_EN);

it('says the published note once, above the countries', () => {
expect(collection?.shared).toBe('Paid by the merchant. Home page.');
});

it('says where the private rates come from at the top of their card, and nowhere else', () => {
const togo = collection?.cards.find((card) => card.country === 'TG');

expect(togo?.unpublished).toBe('Dashboard.');
expect(togo?.blocks.flatMap((block) => block.lines.map((line) => line.note))).toEqual(['', '']);
expect(collection?.cards.find((card) => card.country === 'BJ')?.unpublished).toBe('');
});

const read = (list: object[]) =>
feeSections(providerSchema.parse(provider({ slug: 'two-pay', sources: { ...sources, evidence: { ...SOURCE, kind: 'official_page' } }, fees: list, coverage: [] })), LOOKUPS, PROVIDER_EN)[0];

it('heads a card holding only private rates with their note', () => {
const section = read([fee('SN', MOMO, 3, { source: 'account', note: 'Dashboard' }), fee('SN', CARD, 4, { source: 'account', note: 'Dashboard' }), fee('BJ', CARD, 5, { note: 'Home page' })]);

expect(section?.cards.find((card) => card.country === 'SN')?.unpublished).toBe('Dashboard.');
});

it('never lets the published note cover a private rate that has none', () => {
const section = read([fee('TG', MOMO, 3, { source: 'account' }), fee('BJ', CARD, 5, { note: 'Home page' })]);

expect(section?.shared).toBe('Paid by the merchant.');
});
});
Loading