PHPackages                             wiraazharan/leanx-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. [API Development](/categories/api)
4. /
5. wiraazharan/leanx-sdk

ActiveLibrary[API Development](/categories/api)

wiraazharan/leanx-sdk
=====================

This package is to assist LeanX integration

1.1.5(1y ago)010MITPHP

Since Aug 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wiraazharan/leanx-sdk)[ Packagist](https://packagist.org/packages/wiraazharan/leanx-sdk)[ RSS](/packages/wiraazharan-leanx-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

LeanxSdk, PHP SDK for LeanX Integration
---------------------------------------

[](#leanxsdk-php-sdk-for-leanx-integration)

LeanxSdk is a PHP SDK designed to simplify integration with the LeanX payment API. This SDK provides easy-to-use methods for generating payment links, validating payments, and checking payment statuses.

API Docs :

- Easy setup and usage for LeanX payment integration.
- Flexible configuration with dynamic base URLs and endpoints.
- Comprehensive support for generating and managing payments.

Basic Usage
-----------

[](#basic-usage)

To get started with `LeanxSdk`, follow these steps:

### Instantiate the SDK

[](#instantiate-the-sdk)

```
use Wiraazharan\LeanxSdk\LeanxSdk;

// Base URL for LeanX API (use sandbox or live URL as needed)
$baseUrl = 'https://api.leanx.dev';
// Replace 'your-auth-token' with your actual LeanX auth token
$authToken = 'LP-922AFF8C-MM|cdffb385-7f8b-4fa8-9bdf-5563c7b6c2cb|a59592d0bf0620ac09ee406b91f7006b59b96a35d1406dc3101e383dfa9abf820686064e7b281adc71a3a3a36eed5xxxxxxxxxxxxe41ad25a0d07axxxxx';
// Replace 'hashKey' with your actual LeanX Hash Key
$hashKey = 'a59592d0bf0620ac09ee406b91f7006b59b96a35d1406dc3101e383dfa9abf820686064e7b281adc71a3a3xxxxxxxe1ae77b39e41ad25a0d07a2525531';
// Replace 'UUID' with your actual LeanX UUID
$UUID = 'cdffb385-7f8b-xxxxxxx-c7b6c2cb';

// Create a new instance of the SDK
$sdk = new LeanxSdk($baseUrl, $authToken, $hashKey, $UUID);
```

### Generate a Payment Link

[](#generate-a-payment-link)

```
$parameters = [
    'amount' => 100.00,
    'full_name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'phone_number' => '0123456789',
    'invoice_no' => 'INV12345',
    'redirect_url' => 'https://yourwebsite.com/redirect',
    'callback_url' => 'https://yourwebsite.com/callback'
];

$response = $sdk->GeneratePaymentLinkv1($parameters);
print_r($response);
```

### Check Payment Status

[](#check-payment-status)

```
$invoiceNo = 'INV12345';

$response = $sdk->CheckPaymentStatusV1($invoiceNo);
print_r($response);
```

### Payment Services List

[](#payment-services-list)

```
$parameters = [
  "payment_type" => "WEB_PAYMENT",
  "payment_status" => "active",
  "payment_model_reference_id" => 1,
];

$response = $sdk->GetPaymentServices($parameters);
print_r($response);
```

---

HMAC Endpoints
--------------

[](#hmac-endpoints)

---

### Generate a Payment Link

[](#generate-a-payment-link-1)

```
$parameters = [
    'amount' => 100.00,
    'full_name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'phone_number' => '0123456789',
    'invoice_no' => 'INV12345',
    'redirect_url' => 'https://yourwebsite.com/redirect',
    'callback_url' => 'https://yourwebsite.com/callback'
];

$response = $sdk->GeneratePaymentLinkv1WithHashmac($parameters);
print_r($response);
```

### Generate Auto Bill Page

[](#generate-auto-bill-page)

```
$parameters = [
    'amount' => 100.00,
    'full_name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'phone_number' => '0123456789',
    'invoice_no' => 'INV12345',
    'redirect_url' => 'https://yourwebsite.com/redirect',
    'callback_url' => 'https://yourwebsite.com/callback'
];

$response = $sdk->CreateAutoBillPagev1WithHashmac($parameters);
print_r($response);
```

### Check Payment Status

[](#check-payment-status-1)

```
$invoiceNo = 'INV12345';

$response = $sdk->CheckPaymentStatusV1WithHmac($invoiceNo);
print_r($response);
```

### Payment Services List

[](#payment-services-list-1)

```
$parameters = [
  "payment_type" => "WEB_PAYMENT",
  "payment_status" => "active",
  "payment_model_reference_id" => 1,
];

$response = $sdk->GetPaymentServicesHmac($parameters);
print_r($response);
```

---

Callback Decode Helper
----------------------

[](#callback-decode-helper)

---

```
$callbackData = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnZvaWNlX25vIjoiSU5WMTIzNDUwMDAzIiwiY2xpZW50X2RhdGEiOnsibWVyY2hhbnRfaW52b2ljZV9ubyI6IklOVjEyMzQ1MDAwMyIsInV1aWQiOiJjZGZmYjM4NS03ZjhiLTRmYTgtOWJkZi01NTYzYzdiNmMyY2IiLCJvcmRlcl9pZCI6Ik5vbmUifSwiaW52b2ljZV9zdGF0dXNfaWQiOjIsImludm9pY2VfdHlwZV9pZCI6MSwiaW52b2ljZV90eXBlIjoiTk9STUFMX0NPTExFQ1RJT04iLCJpbnZvaWNlX3N0YXR1cyI6IlNVQ0NFU1MiLCJhbW91bnQiOiI1MS4wMCIsInBheW1lbnRfbW9kZWxfcmVmZXJlbmNlX2lkIjoxLCJyYXRlX3R5cGVfcmVmZXJlbmNlX2lkIjoxLCJwYXltZW50X3NlcnZpY2VfaWQiOjI5LCJjbGllbnRfcmVkaXJlY3RfdXJsIjoiaHR0cHM6Ly93ZWJob29rLnNpdGUvYjMzMTJhZmEtOGIyNy00OWIxLWEwNWYtNDgyZTdhNWM3NjRlIiwiY2xpZW50X2NhbGxiYWNrX3VybCI6Imh0dHBzOi8vc3RhZy1hcGkubGVhbnBheS5teS9hcGkvdjEvY2FsbGJhY2stdXJsL2NhbGxiYWNrLXJlZGlyZWN0P191dWlkPWNkZmZiMzg1LTdmOGItNGZhOC05YmRmLTU1NjNjN2I2YzJjYiZvcmRlcl9pZD1Ob25lIiwiY2xpZW50X3RyYW5zYWN0aW9uX2RldGFpbHMiOm51bGwsInByZWZ1bmRfY29sbGVjdGlvbiI6eyJpdGVtIjpudWxsLCJyZXNwb25zZV9jb2RlIjoyMTAwfSwiZGVzY3JpcHRpb24iOm51bGwsImNhcmRfdG9rZW4iOm51bGwsImZweF9kZWJpdF9hdXRoX2NvZGUiOm51bGwsImZweF9jcmVkaXRfYXV0aF9jb2RlIjpudWxsLCJmcHhfZGViaXRfc3RhdHVzIjoiIiwidHJhbnNhY3Rpb25fcmVzcG9uc2VfdGltZSI6IjIxIEF1Z3VzdCAyNCAwMzoxNjozMSBQTSIsIm9yaWdpbmFsX3RyYW5zYWN0aW9uX3Jlc3BvbnNlX3RpbWUiOiIyMDI0LTA4LTIxIDE1OjE2OjMxIn0.1DQSTWKPoiIhzYfHzLrtqAeokUoR59AofSJnAOvDTuc';

$response = $sdk->DecodeCallback($callbackData);
print_r($response);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Every ~0 days

Total

6

Last Release

629d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63f48b453766089677972ed784dd1c13329c28b001bd02feae76978e275a2d29?d=identicon)[wiraazharan](/maintainers/wiraazharan)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/wiraazharan-leanx-sdk/health.svg)

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

###  Alternatives

[get-stream/stream

A PHP client for Stream (https://getstream.io)

1451.3M8](/packages/get-stream-stream)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[agence104/livekit-server-sdk

Server-side SDK for LiveKit.

79189.9k1](/packages/agence104-livekit-server-sdk)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[hoels/app-store-server-library-php

The PHP server library for the App Store Server API and App Store Server Notifications.

44162.2k](/packages/hoels-app-store-server-library-php)[tamara-solution/php-sdk

Tamara PHP Client Library

10259.4k1](/packages/tamara-solution-php-sdk)

PHPackages © 2026

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