Urgent.News

What's breaking now, across thousands of outlets.

Tech

Trois fournisseurs mobile money, trois modèles d'idempotence, dont deux qui n'en ont aucun

À trois semaines de l'échéance du 30 septembre, beaucoup d'équipes de l'UEMOA écrivent du code de paiement dans l'urgence. La BCEAO a reporté à cette date la connexion à la plateforme PI-SPI pour les banques, les établissements de monnaie électronique et les établissements de paiement. Fin juin, 80 participants étaient connectés et 74 institutions encore en phase de test réel. Le Sénégal mène…

Original French Read in English

With mobile money providers rapidly rolling out payment solutions, a recent report highlights three different models of idempotence. Two of these models lack any form of idempotence entirely. The Central Bank of West African States (BCEAO) has pushed back the connection date to September 30th, allowing banks, electronic money institutions and payment service providers to integrate the PI-SPI platform.

As of June, 80 participants were connected and 74 institutions were still in the testing phase. Senegal currently leads the Union with 20 authorized institutions as of April 2nd.

The PI-SPI protocol ensures interoperability between institutions, but it does not dictate how a provider's code should handle a failed call, such as when a Wave or Orange Money connection times out, and the job queue retries it. This bug becomes apparent in production when it affects other people's money. The three providers analyzed all respond differently to the same scenario.

MTN MoMo is the only provider offering a real idempotence key. The X-Reference-Id header on the POST /collection/v1_0/requesttopay endpoint should be a UUID. If you use your order number, the API refuses without explanation. Replaying the same reference causes MTN to not replay the payment, responding with HTTP/1.1 409 Conflict and code: RESOURCE_ALREADY_EXIST.

However, many PHP developers treat anything other than 2xx as a failure, leading to a timeout, replay with the same key, an exception, and the assumption that nothing was processed, resulting in a second payment prompt. This highlights the importance of understanding the provider's response and handling it correctly.

Wave, on the other hand, provides no idempotence key at all. Repeating an API call creates a second payment session, with no way to verify the correct session. To protect against this, developers must manually manage the client_reference, which can be truncated to 255 characters and used to link the payment session to a unique identifier.

Orange Money, meanwhile, relies on a redirect to a web URL and returns a payment_url. The only identifier provided is the order_id, which is a simple numeric value without any guarantee of idempotence. Like Wave, Orange Money's approach treats the order_id as a reconciliation handle rather than a protection mechanism.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Thursday 10 September →