PHPackages                             rstacode/nass - 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. rstacode/nass

ActiveLibrary[Payment Processing](/categories/payments)

rstacode/nass
=============

Laravel SDK for Nass Payment Gateway - Iraq

1.0.2(2mo ago)546MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Mar 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Rstacode/nass)[ Packagist](https://packagist.org/packages/rstacode/nass)[ Docs](https://github.com/rstacode/nass)[ RSS](/packages/rstacode-nass/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Nass Payment Gateway — Laravel SDK
==================================

[](#nass-payment-gateway--laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7c35f86b4173532a28261349e8344b15e16c77653eb19cd873a4b52e2d1855b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72737461636f64652f6e6173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rstacode/nass)[![Total Downloads](https://camo.githubusercontent.com/dd505a1403929105e2e0f4dfeb0cf091cca24c1ba97daf9635cf753ba6734383/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72737461636f64652f6e6173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rstacode/nass)[![License](https://camo.githubusercontent.com/b778217e634d215c8fbf9588b5199beaec6003e5f188f70cde32976d040e0c13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72737461636f64652f6e6173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rstacode/nass)

[![Image](https://private-user-images.githubusercontent.com/35005761/558233831-65f356bb-4f70-4613-8585-5fd4febb7672.png?jwt=eyJ0eXAi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UFFLNFpBJTJGMjAyNjA0MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA1VDIwMDIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1MDJiYTkzOTM0Mjg5Y2U4N2FjNGU1MGY1MzU4OWIxYTI1YWVkYzFhN2MzZTVlYTVlZjBlNjIxMDk3MjljZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Qk9r_mplnQJwQLNHdEIZ2Ci__eJxzpDdFJ4tUHx315I)Laravel SDK for the [Nass Payment Gateway](https://nass.iq) — Iraq's payment processing platform.

### Requirements

[](#requirements)

- **PHP** 8.1+
- **Laravel** 10.x, 11.x, 12.x, or 13.x

---

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

[](#installation)

```
composer require rstacode/nass
```

Laravel auto-discovers the service provider. Publish the config file:

```
php artisan vendor:publish --tag=nass-config
```

---

Configuration
-------------

[](#configuration)

Add the following to your `.env` file:

```
# Merchant credentials
NASS_USERNAME=your_merchant_username
NASS_PASSWORD=your_merchant_password

# Environment URLs
# UAT:        https://uat-gateway.nass.iq:9746
# Production: https://gateway.nass.iq:9746
NASS_BASE_URL=https://uat-gateway.nass.iq:9746

NASS_TIMEOUT=30
```

---

Usage
-----

[](#usage)

### 1. Authentication

[](#1-authentication)

Login with your merchant credentials to receive a Bearer access token:

```
use Nass\Facades\Nass;

// Uses credentials from config (NASS_USERNAME / NASS_PASSWORD)
$response = Nass::auth()->login();
$token = $response['data']['access_token'];

// Or pass credentials manually
$response = Nass::auth()->login('your_username', 'your_password');
$token = $response['data']['access_token'];

// Set the token for all subsequent requests
Nass::setToken($token);
```

---

### 2. Create a Transaction

[](#2-create-a-transaction)

```
use Nass\Facades\Nass;

// Set Token
$loginResponse = Nass::auth()->login();
Nass::setToken($loginResponse['data']['access_token']);

// Create Transaction
$response = Nass::transactions()->create([
    'orderId'         => '123456',
    'orderDesc'       => 'Purchase of electronics',
    'amount'          => 150.00,
    'currency'        => '368',       // 368 = Iraqi Dinar (IQD)
    'transactionType' => '1',
    'backRef'         => 'https://yoursite.com/payment/callback',
    'notifyUrl'       => 'https://yoursite.com/payment/notify',
]);

// Redirect the customer to complete payment
$paymentUrl = $response['data']['url'];

return redirect($paymentUrl);
```

**Response example:**

```
{
  "success": true,
  "code": 0,
  "status_code": 200,
  "data": {
    "url": "https://3dsecure.nass.iq/gateway/{Transaction Parameters}",
    "pSign": "18f...",
    "transactionParams": {
      "TERMINAL": "",
      "TRTYPE": "1",
      "AMOUNT": "150",
      "ORDER": "123456"
    }
  }
}
```

---

### 3. Check Transaction Status

[](#3-check-transaction-status)

> **Note:** Status checks are available within **24 hours** of transaction initiation. For long-term reference use the `rrn` field.

```
use Nass\Facades\Nass;

// Set Token
$loginResponse = Nass::auth()->login();
Nass::setToken($loginResponse['data']['access_token']);

// Check Transaction
$status = Nass::transactions()->checkStatus('123456');

echo $status['data']['statusMsg'];    // "Approved"
echo $status['data']['responseCode']; // "00" = success
echo $status['data']['rrn'];          // Transaction reference number
```

---

### 4. Handling Callbacks

[](#4-handling-callbacks)

The Nass gateway will POST the transaction result to your `notifyUrl`:

```
// routes/web.php
Route::post('/payment/notify', [PaymentController::class, 'handleCallback']);
```

```
// PaymentController.php
public function handleCallback(Request $request): void
{
    $data = $request->all();

    // responseCode "00" = approved
    if ($data['responseCode'] === '00' && $data['actionCode'] === '0') {
        // Payment successful — store $data['rrn'] as reference
    }
}
```

**Callback payload fields:**

FieldDescription`terminal`Terminal ID`actionCode``0` = success`responseCode``00` = approved`card`Masked card number`amount`Transaction amount`currency`Currency code (368 = IQD)`rrn`Reference number in acquiring bank`intRef`Internal reference (used for reversals)`orderId`Your order ID (stored 7 days only)`tranDate`Transaction date/time`transactionOrigin``local` or `international`---

### 5. Error Handling

[](#5-error-handling)

```
use Nass\Facades\Nass;
use Nass\Exceptions\NassException;

try {
    Nass::setToken($token);

    $response = Nass::transactions()->create([...]);
} catch (NassException $e) {
    $statusCode = $e->getCode();
    $message    = $e->getMessage();
    $response   = $e->getResponse();
}
```

---

UAT Test Cards
--------------

[](#uat-test-cards)

Use these cards exclusively in the UAT environment:

PANExpiryCVV512345000000000801/39100---

API Environments
----------------

[](#api-environments)

EnvironmentBase URLUAT`https://uat-gateway.nass.iq:9746`Production`https://gateway.nass.iq:9746`---

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance88

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0cafb10306186274eb27244cf4f1bce80b8d89eb13c0cb8f6493f3ecb84100df?d=identicon)[codenashwan](/maintainers/codenashwan)

---

Top Contributors

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

---

Tags

iraqkurdistannassnass-paynass-walletnasspaynasswalletpaymentpayment-gatewaypayment-integrationpayment-processingpaymentmethodspaymentslaravelsdkpaymentgatewayiraqnass

### Embed Badge

![Health badge](/badges/rstacode-nass/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)

PHPackages © 2026

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