Date: 2024-10-15 || Views: 401

Getting Started with pawaPay SDK

PawaPay is a mobile money payment platform that enables businesses to send and receive payments across  African countries through mobile wallets. It offers fast settlements, no chargebacks, and secure transaction processing, all managed from a single dashboard. PawaPay integrates with all major mobile money operators, providing a scalable and efficient solution for businesses looking to tap into Africa’s mobile money ecosystem.

If you want to integrate pawaPay into your PHP-based application, this guide will help you get started with the pawaPay SDK. It covers the system requirements, download and installation steps, and the initial setup with basic configuration.

1. System Requirements

Before you begin, ensure that your environment meets the following system requirements:

  1. PHP Version: PHP Version: 8.0 or higher
  2. Composer: PHP dependency manager installed
  3. cURL: Required for making HTTP requests
  4. OpenSSL: For secure HTTPS connections
  5. JSON Extension: Enabled in PHP for working with JSON data
  6. SSL Certification: A valid SSL certificate on your server
  7. Web Server: Apache 2.4 or LiteSpeed V8.1 (or any modern server capable of running PHP)

You can verify the PHP version by running the following command using Terminal in your Cpanel or an SSH client (like PuTTY),

php -v

Or displaying PHP information in a script, you can use the phpinfo() function and save in a .php file (e.g., phpinfo.php) on your server. Then access the page via a browser, it will show detailed information about the PHP environment, including loaded modules, configuration settings, and more.

You can also make sure the necessary extensions are enabled by checking your php.ini configuration file or using php -m to list the installed modules in your terminal or using an SSH client (like PuTTY).

Since pawaPay SDK requires Composer, you first need to confirm that Composer is installed correctly. To check the Composer version, run the following command:

composer -v

If Composer is installed, you should see output similar to Composer version 2.6.5

If you don't see this or if Composer is not installed, you can either contact your web server administrator or, if you have admin (superuser) access, install Composer yourself. Follow these steps to install Composer:

  1. Download the Composer installer: 

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  2. Run the Composer installer script: 

    php composer-setup.php
  3. Remove the installer to clean up: 

    php -r "unlink('composer-setup.php');"
  4. Make Composer globally accessible by moving it to a directory in your system’s PATH, such as /usr/local/bin

    mv composer.phar /usr/local/bin/composer

You can now confirm that Composer is installed by running the version check again: 

composer -v

Alternatively, you can also install Composer using curl as an alternative method. Run the following command:

curl -sS https://getcomposer.org/installer | php


Then move the Composer binary as described earlier:

mv composer.phar /usr/local/bin/composer


After this, run composer -v to verify the installation.

2. Use Composer in Your Project

To manage dependencies and integrate the PawaPay SDK package efficiently, you'll use Composer in your project. Follow the steps below to set it up:

Navigate to Your Project Directory

First, navigate to the directory where your project is located. If you're using cPanel's File Manager or a more advanced tool like a VS Code extension called Remote File Sync that supports FTP, SFTP, SSH, or WebDAV, you can easily upload or synchronize your project files. This extension allows for seamless file management and remote access, making it a more flexible option than traditional FTP.

If you're using the terminal, use the following command:

cd /path/to/your/project

Initialize Composer (If composer.json Doesn't Exist)

If your project directory doesn't contain a composer.json file, you'll need to initialize Composer to create one:

composer init


This command will prompt you to provide information to generate the composer.json file. You can press Enter to skip optional fields, but make sure to define any required dependencies like package name, description, author, minimum stability, type, license, and Dependencies - if any.

Add the SDK to Your Project

To integrate the PawaPay SDK into your project, use Composer to require the katorymnd/pawa-pay-integration package:

composer require katorymnd/pawa-pay-integration

This command performs the following actions:

  1. Adds the SDK to your project's dependencies: Updates your composer.json file to include the PawaPay SDK.
  2. Installs the package: Downloads the SDK and its dependencies into your project's vendor directory.
  3. Updates the composer.lock file: Locks the package versions to ensure consistency across installations.

By running this command, you've successfully added and installed the PawaPay SDK into your project.

Install Other Dependencies (If Necessary)

If your project already has a composer.json file with other dependencies and you haven't installed them yet, you can install all required packages by running:

composer install

This command reads the composer.json file and installs all the listed packages into your project.

Conclusion

By completing these steps, you've successfully set up Composer in your project and integrated the PawaPay SDK to handle mobile money payments.



Learn how to use PuTTYgen for generating and converting SSH...


Learn to craft SEO-friendly titles and meta descriptions that boost...


Explore Katorymnd Freelancer's strategy for engaging web content under 'Content...


Katorymnd Portfolio

Here is how I helped my clients reach their goals. Click on the portfolio websites.

Fishman's Fresh Fish Delivery

A custom-built PHP website for online fresh tilapia home delivery.

Online interracial local singles dating site.

Drupal website built for online dating.

Remote File Sync - VS Code Extension

A VS Code extension to manage and synchronize your remote and local files efficiently, supporting FTP, SFTP, SSH, WebDAV, and Google Drive connections.

Katorymnd Reaction Process - WordPress Plugin

A WordPress plugin that introduces a dynamic and interactive layer to your site, allowing users to express their feelings and thoughts on your content through a variety of reaction options.

pawaPay SDK - Payment Integration

The pawaPay SDK provides seamless mobile money integration into your PHP applications, enabling smooth transaction processing with powerful API features.

Pesapal SDK - Payment Gateway Integration

A robust PHP SDK for integrating with Pesapal's payment gateway, providing seamless transaction handling for card payments



Get started now