Building a mobile app (Course Assist) Part 18: Integrating a new payment gateway

building course assist

Just when I was getting ready to finally launch Course Assist I received an email from my previous payment gateway provider Flutterwave announcing that they are temporarily stopping operations in my country🥲. This was a huge setback for Course Assist because I’ve come so close to completing it. Nevertheless, we keep pushing😤, without wasting much time I quickly began searching for a new payment gateway provider while at the same time considering the option of creating my own. In this article, I’ll walk you through how I went about finding a new payment gateway and how I integrated it into the Course Assist User app. Let’s get straight to it🏃‍♂️

Finding a new payment gateway🔎

The search for a new payment gateway was a difficult process. This is because I needed a payment gateway that has mobile money payment methods included in it. Most payment gateways unfortunately only have credit card payment methods (e.g. Visa and MasterCard). I even considered creating a payment gateway by integrating the MTN and Airtel mobile money API but I didn’t manage because the approval waiting time and process was honestly too long😅. But I might still create that and add it to Course Assist as an update later on but for now the focus is on launching as soon as possible.

I kept searching and eventually landed on a payment gateway called SparcoPay, a Zambian-owned payment gateway that not only has credit card payment methods but also mobile money payment options, exactly what I was looking for😄. The signup process was pretty standard I had to submit some KYC documents and sign a contract, the usual payment gateway procedure. Once it was done my account was approved, I got my public and secret keys and was ready to integrate.

Integrating SparcoPay into the Course Assist User app🔧

The integration process was not a simple one because the documentation is terrible😬. So to keep things simple here I’ll give a quick outline of the process. There are two SparcoPay API links I use in Course Assist. These are the checkout and verification links.

  • Checkout: is used for making payments, so when a user clicks on the pay button they’re redirected via the checkout link to a 3rd party SpacroPay payments page. Once the transaction is complete they can go back to the app where they now automatically land on the approval page where they can approve a question-answer request.
  • Verification is used to find out if the transaction was successful. I added some functionality that checks to see if the transaction was successful via the verification link before a question-answer request can be approved. If it is, the user can successfully approve the request and if not they are notified of a failed or pending transaction. The process outlined below worked well when I tested it with just a few alterations needed to be made, mainly to do with the user experience, the whole payment and approval process needs to be smooth. Something which I’ll work on as soon as possible

With the payment gateway issue now resolved, Course Assist is now back on Course (no pun intended)😂 and should be launching in the coming week or so, just as soon as I conduct a couple more tests. You’ll not want to miss anything so stay tuned to the blog to see what’s coming next. Thanks for reading and see you in the next.🙏


Leave a Comment

Your email address will not be published. Required fields are marked *