Accept mobile money payments

This guide shows how a registered Payflow UG organization connects one payment website to collect payments.

Example: your payment website

Assume your site is shop.example.org. A visitor enters their name, phone number, and payment amount, then clicks Pay now.

1Your website shows the payment form.
Collect customer name, email, phone number, payment amount, and what the customer is paying for.
2Your server starts the payment with Payflow UG.
Payflow UG uses the mobile-money option approved for your organization. Your website does not choose or display the provider.
3The customer approves payment on their phone.
Show a waiting for payment message while it is being completed.
4Your website confirms the result.
When payment succeeds, save the payment in your own database and show a thank-you message.

Set up your website

1. Create a project

In Payflow UG, create a project called Payment website and enter shop.example.org. One project means one website.

2. Copy the project keys

Payflow UG gives you a Client ID and Secret. Put them in your website server settings. Never place the Secret in page JavaScript.

X-Payflow-Client-Id: pf_client_...
X-Payflow-Secret: pf_secret_...
The same keys may be used for future payments from this one website. They are not for another website or app.

Start a payment

When the customer clicks Pay now, your server sends this request to Payflow UG:

POST https://billing.hakateq.com/api/payflow/collections
X-Payflow-Client-Id: pf_client_...
X-Payflow-Secret: pf_secret_...
Content-Type: application/json

{
  "customer_name": "Jane Doe",
  "customer_email": "jane@example.com",
  "phone": "0771234567",
  "amount": 10000,
  "currency": "UGX",
  "description": "Order payment"
}

Payflow UG returns a payment_id and status. Save the payment ID next to the payment in your database.

Confirm the payment

Use the saved payment ID to check whether the customer completed payment:

GET https://billing.hakateq.com/api/payflow/collections/{payment_id}
X-Payflow-Client-Id: pf_client_...
X-Payflow-Secret: pf_secret_...

When payment is successful

Mark the payment as paid in your website database, send a receipt or thank-you message, and update your payment records.

Keep your keys safe

Use your server only

Only your website server should call Payflow UG with the Secret. If it is exposed, revoke it in Projects & credentials and issue a replacement.