DEV Community

Cover image for Utility bill payment and airtime topup with Golang
Mathias Jiya
Mathias Jiya

Posted on • Updated on

Utility bill payment and airtime topup with Golang

Hello devs, this article is for developers who wishes to have these features in their projects:

  • Airtime topup
  • Buy data
  • Utility bills payment
  • Convert airtime to cash

With this package you can integrate these features into your project with some easy steps.

I know how difficult it can be to get API's to achieve these which is why I have taken time to create a Go library that handles all these. The library utilizes a 3rd party API provided by bingpay
Bingpay is a one app for everything platform which allow for Cheap Airtime & Data Topup, Send & Recieve Cash, Pay Utility Bills, Purchase Giftcards, Trade Airtime, Paypal & Giftcards and International Topup. All these features are available from within bingpay although the API which is made public have only some features available.

Now lets get right into the interesting stuffs.

Buy Airtime

Use this to perform airtime purchase.
You get 2% discount on every airtime purchase instantly.

package main

import (
    "fmt"
    bingpay "github.com/iqquee/bingpay-go"
    "github.com/iqquee/bingpay-go/airtime"
)

func main() {
    bingpay.Token = "your bingpay api secret key" // to add your secret key for the api requests 

    phone := "08000000000" // Phone number to recharge.
    amount := 100 // Amount to recharge. e.g 100 for 100 naria topup
    network_id := 0 // Network (As seen in the all-networks endpoint).
    response, status, err := airtime.BuyAirtime(phone,amount,network_id)
    if err != nil {
        fmt.Println(err)
    }

    fmt.Println(status)
    fmt.Println(response)
}
Enter fullscreen mode Exit fullscreen mode

A lot of other methods are available in github.com/iqquee/bingpay-go. You can visit github.com/iqquee/bingpay-go for more example code for each methods. This package have been properly documented to allow for easy use of it and as such every methods in this package have an example code to it.

Top comments (6)

Collapse
 
oltyt55 profile image
oltyt55

This Golang library sounds like a fantastic resource for developers looking to integrate utility bill payments and airtime top-ups into their projects! The ease of accessing these features can really enhance user experience. It’s also great to see that you're addressing the challenges of finding reliable APIs. While managing payments, don't forget the importance of keeping track of your wasa bill too! Being aware of utility expenses can help users manage their finances better while utilizing your app.

Collapse
 
harshbarge65083 profile image
Harshbargerson Hammer

Using Golang, you can efficiently build a system for utility bill payments and airtime top-ups, integrating various service providers. For instance, you could create a feature that allows users to pay their GEPCO online bill seamlessly, alongside topping up their mobile airtime, all within a single platform. By leveraging Golang's robust concurrency model, the system can handle multiple transactions simultaneously, ensuring fast and reliable payment processing for both utility bills and airtime purchases.

Collapse
 
liyex93245 profile image
Liyex • Edited

Using Golang for utility bill payments and airtime top-ups can streamline services like SEPCO bill payments. This approach ensures fast, reliable transactions for users.

Collapse
 
philipvhk profile image
Njk Vhk

A LESCO utility bill payment and airtime top-up system using Golang ensures secure, fast transactions by integrating payment gateways. This solution provides a seamless user experience for quick bill processing and airtime recharges.

Collapse
 
adamk0887 profile image
Adam K

This is a great initiative for developers looking to integrate utility bill payments and airtime top-up features seamlessly. Similarly, just like the API streamlines these processes, food website like Texas Roadhouse menu offer users a streamlined way to access updated menu information with ease.

Collapse
 
alex_066fbae0458cd03acdb3 profile image
Alex • Edited

Thanks for sharing this Golang library! It's great to have an all-in-one solution for integrating airtime top-up and utility bill payments. Appreciate the effort in making API access easier for developers!