Getting Started With the Pawapay Sdk: Installation and Setup | Katorymnd Freelancer

Getting Started With the Pawapay Sdk: Installation and Setup

Date: 2024-10-15 || Views: 2,470

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 configure FTP, SFTP, SSH, and WebDAV in...


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


Try the @katorymnd/pawapay-node-sdk Live Demo. Bring your sandbox token and...


Glimpses of Greatness Crafted by Katorymnd

Dive into the journeys of clients I've empowered.
Click any project below to explore the results - each one a story of transformation.

pawaPay Java SDK - Payment Integration

pawaPay Java SDK: Seamless enterprise mobile money integration for Java applications. Features robust typing, thread-safe execution, and reliable transaction handling.

pawaPay Python SDK - Payment Integration

pawaPay Python SDK: Seamless enterprise mobile money integration for Python applications. Features robust typing and asynchronous transaction handling.

pawaPay Node.js SDK, Payments

pawaPay Node.js SDK: Enterprise mobile money integration for Node.js & TypeScript. Strictly typed, async wrapper with simple domain-based licensing.

Clean My Mind - A Quiet Release

A privacy-first web ritual, no signup, say one sentence and let it go. Built with vanilla JavaScript, local-only storage, and focused on presence rather than analytics.