PHPackages                             paymentsdk/payment-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. paymentsdk/payment-sdk

ActiveLibrary[Payment Processing](/categories/payments)

paymentsdk/payment-sdk
======================

Secure and user-friendly checkout and direct charge API SDK for PHP applications for PaymentSDK Transactions.

v1.0.0(11mo ago)11MITPHP

Since Aug 8Pushed 11mo agoCompare

[ Source](https://github.com/payment-sdks/Php-SDK)[ Packagist](https://packagist.org/packages/paymentsdk/payment-sdk)[ RSS](/packages/paymentsdk-payment-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

PaymentSDK Usage Guide
======================

[](#paymentsdk-usage-guide)

Introduction
------------

[](#introduction)

The PaymentSDK for PHP facilitates the integration of Payment SDK's payment and checkout features into your PHP applications. This comprehensive guide will assist you in the setup and utilization of the PaymentSDK.

Prerequisites
-------------

[](#prerequisites)

Before getting started, ensure you have the following:

- PHP installed on your server or development environment.
- Payment SDK API credentials, including the IV Key, Consumer Secret, Consumer Key.

Installation
------------

[](#installation)

1. **Download the Payment SDK:**Download the Payment SDK and include it in your project.

    ```
    # Example using Composer
    composer require paymentsdk/payment-sdk
    ```
2. **Include the Composer autoloader in your PHP file:**

    ```
    require_once 'vendor/autoload.php';
    ```
3. **Instantiate the PaymentSDK class with your credentials:**

    ```
    use PaymentSDK\PaymentSDK\PaymentSDK;

    // Replace these values with your actual credentials
    $IVKey = 'your_iv_key';
    $consumerSecret = 'your_consumer_secret';
    $environment = 'sandbox';
    $rootDomain = 'example.com'
    ```

Checkout Usage
--------------

[](#checkout-usage)

1. **To initialize the PaymentSDK class, provide the $IVKey, $consumerKey, $consumerSecret, $rootDomain, and $environment parameters. The $environment should be one of the following: 'production' or 'sandbox'.**

    ```
    $PaymentSDK = new PaymentSDK($IVKey, $consumerKey, $consumerSecret, $rootDomain, $environment);
    ```
2. **Validate Payload**

    ```
    try {
    $PaymentSDK->validateCheckoutPayload($payload);
    } catch (Exception $error) {
    echo 'Error: ' . $error->getMessage() . "\n";
    }
    ```
3. **Encrypt Payload**

    ```
    $encryptedPayload = $PaymentSDK->encrypt($payload);
    ```
4. **Get Checkout Status**

    ```
    try {
    $PaymentSDK->getCheckoutStatus($payload["merchant_transaction_id"]);
    } catch (Exception $error) {
    echo 'Error: ' . $error->getMessage() . "\n";
    }
    ```
5. **Build Checkout URL**

    ```
    try {
        $checkoutUrl =
        'https://sandbox.checkout.{{rootDomain}}/?access_key=' .
        urlencode($accessKey) .
        '&payload=' .
        urlencode($encryptedPayload);
         echo 'Checkout URL: ' . $checkoutUrl . "\n";
       } catch (Exception $error) {
         echo 'Error: ' . $error->getMessage() . "\n";
       }
    ```

Direct API Usage
----------------

[](#direct-api-usage)

1. **To initialize the PaymentSDK class, provide the $IVKey, $consumerSecret, $rootDomain, and $environment parameters. The $environment should be one of the following: 'production' or 'sandbox'.**

    ```
    $PaymentSDK = new PaymentSDK($IVKey, $consumerSecret, $rootDomain, $environment);
    ```
2. **Direct Charge**

    ```
    try {
    $PaymentSDK->DirectCharge($payload);
    } catch (Exception $error) {
     echo 'Error: ' . $error->getMessage() . "\n";
    }
    ```
3. **Get Charge Request Status**

    ```
    try {
    $PaymentSDK->getChargeRequestStatus($chargeRequestId);
    } catch (Exception $error) {
    echo 'Error: ' . $error->getMessage() . PHP_EOL;
    }
    ```

License
=======

[](#license)

This SDK is open-source and available under the MIT License.
------------------------------------------------------------

[](#this-sdk-is-open-source-and-available-under-the-mit-license)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance53

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

330d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/62005732?v=4)[Waweru™](/maintainers/timwaweru)[@timwaweru](https://github.com/timwaweru)

---

Top Contributors

[![timwaweru](https://avatars.githubusercontent.com/u/62005732?v=4)](https://github.com/timwaweru "timwaweru (4 commits)")

### Embed Badge

![Health badge](/badges/paymentsdk-payment-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/paymentsdk-payment-sdk/health.svg)](https://phpackages.com/packages/paymentsdk-payment-sdk)
```

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[patryqhyper/polish_payments_api

Library for polish payment providers

141.6k](/packages/patryqhyper-polish-payments-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
