PHPackages                             paylinksa/laravel - 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. paylinksa/laravel

ActiveLibrary[API Development](/categories/api)

paylinksa/laravel
=================

Paylink package for integrating with Paylink gateway.

2.0.1(1y ago)3637—5.6%1MITPHP

Since Mar 7Pushed 1y agoCompare

[ Source](https://github.com/sultan-algarbi/paylink-laravel-package)[ Packagist](https://packagist.org/packages/paylinksa/laravel)[ RSS](/packages/paylinksa-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

Paylink Package
===============

[](#paylink-package)

This package enables seamless integration with the Paylink payment gateway within Laravel applications. and provides convenient methods to interact with the Paylink API, facilitating payment processing and related functionalities.

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

[](#installation)

You can install the `paylinksa/laravel` package via composer. Run the following command in your terminal:

```
composer require paylinksa/laravel
```

Payment Service
---------------

[](#payment-service)

### Environment Setup

[](#environment-setup)

Create an instance of PaylinkService based on your environment

- For Testing

```
use Paylink\Services\PaylinkService;

$paylinkService = PaylinkService::test();
```

- For Production

```
use Paylink\Services\PaylinkService;

$paylinkService = PaylinkService::production('API_ID_xxxxxxxxxx', 'SECRET_KEY_xxxxxxxxxx');
```

### Methods

[](#methods)

1. **Add Invoice**:

    Add an invoice to the system for payment processing.

    ```
       use Paylink\Models\PaylinkProduct;

       $invoiceDetails = $paylinkService->addInvoice(
          amount: 250.0,
          clientMobile: '0512345678',
          clientName: 'Mohammed Ali',
          orderNumber: '123456789',
          products: [
             new PaylinkProduct(title: 'item1', price: 5.0, qty: 10),
             new PaylinkProduct(title: 'item2', price: 20.0, qty: 10)
          ],
          callBackUrl: 'https://example.com',
       );
    ```
2. **Get Invoice**

    Retrieve invoice details.

    ```
       $invoiceDetails = $paylinkService->getInvoice(transactionNo: '1714289084591');

       // $invoiceDetails->orderStatus;
       // $invoiceDetails->transactionNo;
       // $invoiceDetails->url;
       // ...
    ```
3. **Cancel Invoice**

    Cancel an existing invoice initiated by the merchant.

    ```
       $paylinkService->cancelInvoice(transactionNo: '1714289084591'); // true-false
    ```

### Examples:

[](#examples)

- [Paylink Payment Examples](Examples/PaymentExamples.php)
- [Paylink Payment Webhook](Examples/PaymentWebhook.php) (used by merchants)

For detailed usage instructions, refer to the [Paylink Payment Services Documentation](docs/PaylinkService.md)

---

Partner Service
---------------

[](#partner-service)

### Environment Setup

[](#environment-setup-1)

Create an instance of PartnerService based on your environment

- For Testing

```
use Paylink\Services\PartnerService;

$partnerService = PartnerService::test('profileNo_xxxxxxxxxxx', 'apiKey_xxxxxxxxxxxx');
```

- For Production

```
use Paylink\Services\PartnerService;

$partnerService = PartnerService::production('profileNo_xxxxxxxxxxx', 'apiKey_xxxxxxxxxxxx');
```

### Methods

[](#methods-1)

1. **Check License**

    Initiates the first step of the registration process by checking the merchant's license information.

    ```
       $responseData = $partnerService->checkLicense(
          registrationType: "cr", // freelancer or cr
          licenseNumber: "7014832310",
          mobileNumber: "0512345678",
          hijriYear: "1400",
          hijriMonth: "06",
          hijriDay: "16",
          partnerProfileNo: "07537924"
       );
    ```
2. **Validate Mobile**

    Validates the merchant's mobile number by confirming the OTP received via SMS.

    ```
       $responseData = $partnerService->validateMobile(
          signature: "ae135f2506dc3c44152d62265419c09e80dec0b108090bc81d6a1a691c3f0647",
          mobile: "0512345678",
          sessionUuid: "96ea8e22-edef-414b-9724-3bd2d494b710",
          otp: "7615",
          partnerProfileNo: "19039481"
       );
    ```
3. **Add Information**

    Adds information related to the merchant, such as bank details, business category, and personal information.

    ```
       $responseData = $partnerService->addInfo(
          mobile: "0500000001",
          sessionUuid: "96ea8e22-edef-414b-9724-3bd2d494b710",
          signature: "ae135f2506dc3c44152d62265419c09e80dec0b108090bc81d6a1a691c3f0647",
          partnerProfileNo: "19039481",
          iban: "SA1231231231312312313213",
          bankName: "AlRajhi Bank",
          categoryDescription: "Any description for the activity of the merchant. It must match the activity of the merchant.",
          salesVolume: "below_10000",
          sellingScope: "domestic",
          nationalId: "1006170383",
          licenseName: '21012451525',
          email: "mohammed@test.com",
          firstName: "Mohammed",
          lastName: "Ali",
          password: "xxxxxxxxxxx",
       );
    ```
4. **Confirming Account with Nafath**

    Confirms the account with Nafath after submitting the required information.

    ```
       $responseData = $partnerService->confirmingWithNafath(
          signature: 'ae135f2506dc3c44152d62265419c09e80dec0b108090bc81d6a1a691c3f0647',
          sessionUuid: '96ea8e22-edef-414b-9724-3bd2d494b710',
          mobile: '0512345678',
          partnerProfileNo: '19039481',
       );
    ```
5. **Get My Merchants**

    Retrieves a list of merchants associated with the partner's account.

    ```
       $responseData = $partnerService->getMyMerchants();
    ```
6. **Get Merchant Keys**

    Retrieves API credentials (API ID and Secret Key) for a specific sub-merchant.

    ```
       $responseData = $partnerService->getMerchantKeys(
          searchType: 'cr', // cr, freelancer, mobile, email, accountNo
          searchValue: '20139202930',
          profileNo: '12345687',
       );
    ```

### Examples:

[](#examples-1)

- [Partner Examples](Examples/PartnerExamples.php)
- [Activation Webhook](Examples/ActivationWebhook.php) (used by partners)

For detailed usage instructions, refer to the [Partner Service Documentation](docs/PartnerService.md)

---

Support
-------

[](#support)

If you encounter any issues or have questions about the Paylink Package, please [contact us](https://paylink.sa/).

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](LICENSE).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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 ~25 days

Recently: every ~36 days

Total

9

Last Release

638d ago

Major Versions

1.0.6 → 2.0.02024-09-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f12e0fabd4b4de02155b5792a38488336f6bde34d8aef4c01978f8804889840?d=identicon)[SultanAlgarbi](/maintainers/SultanAlgarbi)

---

Tags

apisdkpackagepaymentintegrationpayment gatewaypaylink

### Embed Badge

![Health badge](/badges/paylinksa-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/paylinksa-laravel/health.svg)](https://phpackages.com/packages/paylinksa-laravel)
```

PHPackages © 2026

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