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(9mo ago)11MITPHP

Since Aug 8Pushed 9mo 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 1mo ago

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

27

—

LowBetter than 49% of packages

Maintenance57

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

283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc1bef3e416c5d30f92585e4f800ece8579d93f2782e73736612e6e214a506c0?d=identicon)[timwaweru](/maintainers/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

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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