In the process of implementing the overseas charging pile project in Africa, localized payment docking is the core link. The mainstream payment channels in Tanzania are mainly mobile wallet payments, supplemented by bank cards and offline payments. As the top compliant payment gateway in Tanzania, SELCOM is deeply compatible with local mainstream mobile wallets such as M-Pesa, Tigo Pesa, Airtel Money, etc., and is the preferred payment docking solution for overseas charging pile platforms.
This article is based on a practical scenario of charging station business, and provides a detailed explanation of the core security mechanism, full process payment link, exception handling, and retry scheme of the SELCOM payment gateway. Combined with the project source code SelcomPayService. Java practical logic, it completely disassembles the “order placement+wallet pre-deduction+polling+asynchronous callback” dual confirmation payment architecture, helping development and operation personnel quickly grasp the core points of Tanzania cross-border payment docking, and avoid common problems such as docking errors, payment cancellations, and duplicate entries.

1、 Overview of SELCOM Payment Gateway Project Application
The overseas charging station project relies on the SELCOM payment gateway to enable users in Tanzania to recharge their wallet balance online on the charging station platform. SELCOM adopts a hybrid payment confirmation mode to address the unstable network environment and user dependence on mobile USSD pop-up payments in Africa. It combines Redis temporary data storage, asynchronous Webhook callback, and scheduled task polling mechanisms to maximize the high reliability and availability of cross-border payment links.
2、 SELCOM Payment Core Security Mechanism (Essential for Integration)
The SELCOM interface has strict authentication, signature, and time verification rules, which are the core barriers to ensure the security of cross-border payments. All interface requests must strictly follow the three major security specifications; otherwise, they will directly fail due to request and signature errors, which is also the core reason for most docking failure problems.
Standardized timestamp specification
All interface request timestamps must be in Tanzania UTC+3 standard time, strictly following the ISO8601 format: YYYY-MM-DDThh: mm: ss+03:00. Prohibit the use of server local time and UTC zero zone time to avoid signature invalidation and request interception due to time zone deviation.
Exclusive request header authentication method
The fixed format of the Authorization field in the request header is SELCOM {Base64 (API_KEY)}. It should be noted that this authentication method is not universal Basic authentication; it only requires Base64 encoding of the merchant API_KEY separately, without the need to concatenate account passwords. Incorrect encoding format will directly lead to authentication failure.
HMAC-SHA256 Signature Algorithm
SELCOM adopts HMAC-SHA256 encrypted signature to ensure the request data is tamper-proof. The signature stitching rules are highly rigorous, and the original string format is:timestamp={timestamp}&key1={value1}&key2={value2}. The order of the fields participating in the signature must be the same as the field order declared in the Signed Fields request header. Disordered order, missing fields, and redundant parameters can all cause the signature verification to fail.

3、 Complete payment service chain of SELCOM charging station platform
The overall payment process of the project is divided into four core steps: user information collection, minimalist order creation, wallet payment triggering, and dual confirmation of payment status. Redis is linked throughout the process to store temporary order data, achieving real-time synchronization of status and front-end interaction.
Payment initialization and user information collection
When users initiate wallet recharge on the charging station APP, the charging station platform will call the payment platform’s getPaymentURL method to store the core information of the payment order in Redis, completing the order initialization. At the same time, redirect to the user information collection page to collect necessary payment information, including the user’s email, name, and phone number. The mobile phone number is the core parameter used to receive local mobile wallet USSD payment pop-ups and payment confirmation messages.
Minimalist order creation
After the information collection is completed, the system calls the SELCOM official/v1/checkout/create order minimal interface to create a payment order. The core parameters of the interface are strictly adapted to the Tanzanian business standards: the payment amount is uniformly in integer format, the currency is fixed at TZS (Tanzanian shilling), the asynchronous callback address needs to be Base64 encoded, and the unique identifier vendor for the platform-exclusive merchant is passed in to ensure order compliance and validity.
Mobile wallet payment trigger
After the order is successfully created, the system immediately calls the/v1/checkout/wallet payment interface to initiate a prepayment request. By inputting the user’s mobile phone number msisdn and unique order_id, the USSD payment pop-up on the user’s mobile phone is triggered, guiding the user to enter the payment password to complete the deduction operation, adapting to the mainstream mobile wallet payment habits in Tanzania.
Dual mechanism to confirm payment status
In response to issues such as network fluctuations and user operation delays in Africa, the project adopts a dual confirmation mechanism of asynchronous callback and active polling to eliminate payment omissions and abnormal status problems. On the one hand, enable asynchronous monitoring of webhooks. After the user completes the payment, the SELCOM platform actively pushes the payment result to the project/SelkomPay/webhook interface; On the other hand, start the Schedule Task Manager scheduled task, actively call the order status query interface every 15 seconds, and poll for up to 30 minutes (120 times). After detecting the Completed status, automatically execute business logic such as order entry and charging permission activation.

SELCOM Tanzania Payment FAQ
Q: Why is SELCOM payment gateway the preferred choice for charging stations going to Tanzania?
Answer: SELCOM is the official compliant mainstream payment gateway in Tanzania, fully compatible with local mobile wallets such as M-Pesa and Tigo Pesa, and adapted to local users’ payment habits. At the same time, the callback and retry mechanisms have been optimized for the weak network environment in Africa, combined with a dual confirmation payment architecture for the project, which can effectively solve the problems of cross-border payment loss, delay, and high failure rate. It is the best choice for charging pile overseas projects.
Q: What are the main reasons for SELCOM payment signature failure?
Answer: The four common reasons are: 1. The timestamp is not in UTC+3 Tanzania Standard Time; 2. API_KEY did not perform Base64 encoding separately, resulting in incorrect authentication format; 3. The splicing order of signature fields is inconsistent with the declared order of Signed Fields; 4. Redundant request parameters, missing, or have incorrect formats.
Q: Why does SELCOM payment require both callback and polling to be enabled simultaneously?
Answer: Tanzania’s network stability is poor, and a single asynchronous callback is prone to packet loss and push failure issues. The dual confirmation mechanism can complement each other, with real-time synchronization of callback priority and polling to complete abnormal orders, ensuring 100% accuracy of payment results to the maximum extent possible and avoiding business failures such as user payment not being powered on and order status being stuck.
Q: How can SELCOM payments avoid duplicate payments?
Answer: The project implements global idempotence control through the unique order_id of the order. Whether it is asynchronous callback or timed polling, the order processing status is verified before processing the order. Completed orders will not have duplicate entry logic, eliminating the problem of duplicate settlement.