PHPackages                             raziul/shurjopay-php - 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. raziul/shurjopay-php

ActiveLibrary

raziul/shurjopay-php
====================

ShurjoPay payment gateway integration for PHP applications.

v1.0.1(3y ago)663MITPHPPHP &gt;=7.3

Since Jun 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/iRaziul/shurjopay-php)[ Packagist](https://packagist.org/packages/raziul/shurjopay-php)[ RSS](/packages/raziul-shurjopay-php/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![ShurjoPay payment gateway integration for PHP applications](https://camo.githubusercontent.com/48967b09619f1366e3dc74e9d5794c8bfd982e1ab7539204e4b1cb0cd08535a9/68747470733a2f2f7777772e736875726a6f7061792e636f6d2e62642f6465762f696d616765732f736875726a6f5061792e706e67)](https://camo.githubusercontent.com/48967b09619f1366e3dc74e9d5794c8bfd982e1ab7539204e4b1cb0cd08535a9/68747470733a2f2f7777772e736875726a6f7061792e636f6d2e62642f6465762f696d616765732f736875726a6f5061792e706e67)

ShurjoPay PHP Library
=====================

[](#shurjopay-php-library)

Using this library you can integrate **ShurjoPay** payment gateway into your PHP applications.

---

*If you face any problem then create issues or make a PR with your solution.*

Requirement
-----------

[](#requirement)

- PHP 7.3 or Later
- curl extension

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

[](#installation)

The installation is pretty easy using [Composer](https://getcomposer.org/)

```
composer require raziul/shurjopay-php
```

Usage
-----

[](#usage)

You can check the [examples](./examples) directory for full code.

### Configuration

[](#configuration)

```
$config = [
	// set this to false if you are running in live mode
	'sandbox_mode'  =>  true,

	// ShurjoPay credentials [Change these with your details]
	'username' => 'sp_sandbox',
	'password' => 'pyyk97hu&6u6',
	'prefix'  =>  'NOK',
];
```

### Creating a payment

[](#creating-a-payment)

```
require __DIR__ . '/vendor/autoload.php';

// create ShurjoPay instance
$sp = new \Raziul\ShurjoPay\ShurjoPay($config);

// set callback url
$sp->setCallbackUrl($success_url, $cancel_url);

// make payment
$sp->makePayment($payload); // it will redirect to the payment page
```

You can also use method chaining like below

```
ShurjoPay::create($config)->setCallbackUrl($success_url, $cancel_url)->makePayment($payload);
```

> After making a successfull payment, user will be redirected to the *success\_url* with `order_id` query parameter in the URI.

### Verify Payment

[](#verify-payment)

```
// retrieve order id from the URI
$order_id = $_GET['order_id'];

// verify payment
$payment = $sp->verify($order_id);

// check success status
if ($payment->success()) {
	// show the payment method
	echo $payment->paymentMethod();
}
```

Available methods in the **Payment** class.

MethodDescription$payment-&gt;success()Return payment success status$payment-&gt;failed()Return payment failed status$payment-&gt;message()Get the success/error message$payment-&gt;orderId()Get the order ID$payment-&gt;currency()Get currency code$payment-&gt;amount()Get the amount$payment-&gt;customerOrderId()Get customer order ID$payment-&gt;paymentMethod()Get the payment method name$payment-&gt;dateTime()Get the transaction date time$payment-&gt;toArray()Get all the data as array### Error Handling

[](#error-handling)

This package throws `Raziul\ShurjoPay\ShurjoPayException` on error. You can use `try-catch` for better error handling.

```
try {
	// making payment
	ShurjoPay::create($config)
		->setCallbackUrl($success_url, $cancel_url)
		->makePayment($payload);

	// also for verfication
	ShurjoPay::create($config)
		->verify($order_id);

} catch (Raziul\ShurjoPay\ShurjoPayException $e) {
	echo $e->getMessage();
}
```

Suggestion/Issues
-----------------

[](#suggestionissues)

If you found any issues or have any suggestion then please create an [issue](https://github.com/iRaziul/shurjopay-php/issues).

You can also submit PR regarding any issues.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Thank You
---------

[](#thank-you)

Thanks for using this package and If you foound this package useful then consider giving it a star.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

1422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c371b774feadb3bfc182f9309ab6aeac6789b993ac63a213fe3aca070f95100d?d=identicon)[Raziul](/maintainers/Raziul)

---

Top Contributors

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

---

Tags

payment gatewayshurjopayshurjopay gatewayshurjopay phpshurjopay payment gateway php

### Embed Badge

![Health badge](/badges/raziul-shurjopay-php/health.svg)

```
[![Health](https://phpackages.com/badges/raziul-shurjopay-php/health.svg)](https://phpackages.com/packages/raziul-shurjopay-php)
```

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[jomweb/billplz

PHP Agnostic library for working with BillPlz API

77199.0k3](/packages/jomweb-billplz)[coinpaymentsnet/coinpayments-php

A PHP wrapper for the CoinPayments.net v1 API.

55126.2k](/packages/coinpaymentsnet-coinpayments-php)[luigel/laravel-paymongo

A laravel wrapper for Paymongo API

7956.2k1](/packages/luigel-laravel-paymongo)

PHPackages © 2026

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