PHPackages                             coolerproyt/razerms-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. coolerproyt/razerms-php

ActiveLibrary

coolerproyt/razerms-php
=======================

A php package for RazerMS API.

1.0.4(2y ago)014↓100%MITPHP

Since Apr 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CoolerProYT/RazerMS-PHP)[ Packagist](https://packagist.org/packages/coolerproyt/razerms-php)[ RSS](/packages/coolerproyt-razerms-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

RazerMS-PHP
===========

[](#razerms-php)

To install the package, run the following command:

```
composer require coolerproyt/razerms-php
```

PaymentChannel
==============

[](#paymentchannel)

In your PHP file, include the following code at the top of your code:

```
use CoolerProYT\RazermsPHP\PaymentChannel;

$rms = new PaymentChannel('YOUR_MERCHANT_ID','YOUR_VERIFY_KEY','SANDBOX_MODE'); // SANDBOX_MODE default value is false
```

Direct Payment API:
-------------------

[](#direct-payment-api)

Read the [RazerMS Direct Server API Documentation](https://github.com/RazerMS/Documentation-RazerMS_API_Spec/blob/aadeac8c3e1773311f644b639137a07b7a895b22/%5BOfficial%5D%20Razer%20Direct%20Server%20API%20v1.6.23.pdf)

Card Payment:

```
$response = $rms->createPayment([
    'MerchantID' => 'YOUR_MERCHANT_ID',
    'ReferenceNo' => 'YOUR_REFERENCE_NO',
    'TxnType' => 'SALS', //Refer to the API documentation for the full list of TxnType
    'TxnChannel' => 'CREDIT7', //Refer to the API documentation for the full list of TxnChannel
    'TxnCurrency' => 'MYR',
    'TxnAmount' => '1.00', //Amount your customer needs to pay
    'Signature' => md5('TnxAmount'.'YOUR_MERCHANT_ID'.'YOUR_REFERENCE_NO'.'YOUR_VERIFY_KEY'),
    'CC_PAN' => '5555555555554444', //Credit Card Number for sandbox mode
    'CC_CVV2' => '444', //Credit Card CVV for sandbox mode
    'CC_MONTH' => '12', //Credit Card Expiry Month for sandbox mode, can be any future date
    'CC_YEAR' => '26', //Credit Card Expiry Year for sandbox mode, can be any future date
    //Other optional and conditional parameters, refer to the API documentation for the full list
],'AUTO_REDIRECT'); //AUTO_REDIRECT will redirect the user to the payment page, default value will be false
```

Other Payment Methods:

```
$response = $rms->createPayment([
    'MerchantID' => 'YOUR_MERCHANT_ID',
    'ReferenceNo' => 'YOUR_REFERENCE_NO',
    'TxnType' => 'SALS', //Refer to the API documentation for the full list of TxnType
    'TxnChannel' => 'TNG-EWALLET', //Refer to the API documentation for the full list of TxnChannel
    'TxnCurrency' => 'MYR',
    'TxnAmount' => '1.00', //Amount your customer needs to pay
    'Signature' => md5('TnxAmount'.'YOUR_MERCHANT_ID'.'YOUR_REFERENCE_NO'.'YOUR_VERIFY_KEY'),
],'AUTO_REDIRECT'); //AUTO_REDIRECT will redirect the user to the payment page, default value will be false
```

Useful optional parameters:

```
    'ReturnURL' => '',
    'NotificationURL' => '',
    'CallbackURL' => '',
    'FailedURL' => '',
```

Redirect Payment to Payment Page:
---------------------------------

[](#redirect-payment-to-payment-page)

If `AUTO_REDIRECT` is set to false, you can redirect the user to the payment page by using the following code:

```
$rms->redirectToPaymentPage(json_decode($response)->TxnData);
```

Livewire Auto Redirect
----------------------

[](#livewire-auto-redirect)

For livewire, auto redirect will not be working, you need to pass the `TxnData` to laravel controller and run `redirectPayment` function in the controller.

### Example:

[](#example)

#### Livewire Controller

[](#livewire-controller)

```
namespace App\Livewire;

use Livewire\Component;
use CoolerProYT\RazermsPHP\PaymentChannel;

class Payment extends Component
{
    public function pay(){
        $rms = new PaymentChannel('YOUR_MERCHANT_ID','YOUR_VERIFY_KEY','SANDBOX_MODE');

        $response = $rms->createPayment([
            'MerchantID' => 'YOUR_MERCHANT_ID',
            'ReferenceNo' => '1',
            'TxnType' => 'SALS', //Refer to the API documentation for the full list of TxnType
            'TxnChannel' => 'CREDITZ', //Refer to the API documentation for the full list of TxnChannel
            'TxnCurrency' => 'MYR',
            'TxnAmount' => '1.00', //Amount your customer needs to pay
            'Signature' => md5('TnxAmount'.'YOUR_MERCHANT_ID'.'YOUR_REFERENCE_NO'.'YOUR_VERIFY_KEY'),
            'CC_PAN' => '5555555555554444', //Credit Card Number for sandbox mode
            'CC_CVV2' => '444', //Credit Card CVV for sandbox mode
            'CC_MONTH' => '12', //Credit Card Expiry Month for sandbox mode, can be any future date
            'CC_YEAR' => '26', //Credit Card Expiry Year for sandbox mode, can be any future date
            //Other optional and conditional parameters, refer to the API documentation for the full list
        ]); //AUTO_REDIRECT will redirect the user to the payment page, default value will be false

        $response = json_decode($response);

        return redirect()->route('pay')->with(['postData' => $response->TxnData]);
    }

    public function render()
    {
        return view('livewire.payment');
    }
}
```

#### Laravel Controller

[](#laravel-controller)

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use CoolerProYT\RazermsPHP\DirectPayment;

class PaymentController extends Controller
{
    public function pay(Request $request){
        $rms = new PaymentChannel('YOUR_MERCHANT_ID','YOUR_VERIFY_KEY','SANDBOX_MODE');

        $rms->redirectToPaymentPage($request->session()->get('postData'));
    }
}
```

Channel Status API:
-------------------

[](#channel-status-api)

This function returns the availability of all channels enabled for a particular merchantID

```
$response = $rms->checkChannelAvailability($merchantID);
```

ApiChannel
==========

[](#apichannel)

Read the [RazerMS Official API Documentation](https://github.com/RazerMS/Documentation-RazerMS_API_Spec/blob/main/%5Bofficial%20API%5D%20Razer%20API%20Spec%20for%20Merchant%20(v13.59).pdf)

In your PHP file, include the following code at the top of your code:

```
use CoolerProYT\RazermsPHP\ApiChannel;

$rms = new ApiChannel('YOUR_MERCHANT_ID','YOUR_VERIFY_KEY','SANDBOX_MODE'); // SANDBOX_MODE default value is false
```

Direct Status Requery
---------------------

[](#direct-status-requery)

This will trigger a query to the payment channel or bank status server and there are cases that bank status server is not in-sync with its payment server that might give different results, that leads to a defer update and will trigger a callback from PG server, once the status is synced and changed.

```
$response = $rms->directStatusRequery([
    'amount' => 'TRANSACTION_AMOUNT_OF_THE_txID',
    'txID' => 'YOUR_txID',
    'domain' => 'YOUR_MERCHANT_ID',
    'skey' => md5('YOUR_txID'.'YOUR_MERCHANT_ID'.'YOUR_VERIFY_KEY'.'TRANSACTION_AMOUNT_OF_THE_txID')
]);
```

Indirect Status Requery
-----------------------

[](#indirect-status-requery)

Request &amp; Response parameters are the same as Direct Status Requery but the format and parameters order of the responses are slightly different.

```
$response = $rms->directStatusRequery([
    'amount' => 'TRANSACTION_AMOUNT_OF_THE_txID',
    'txID' => 'YOUR_txID',
    'domain' => 'YOUR_MERCHANT_ID',
    'skey' => md5('YOUR_txID'.'YOUR_MERCHANT_ID'.'YOUR_VERIFY_KEY'.'TRANSACTION_AMOUNT_OF_THE_txID')
]);
```

Static QR-Code Generator
------------------------

[](#static-qr-code-generator)

For merchant to generate static QR code of e-wallet.

I have modified the response because the default response url is not working.

```
$response = $rms->staticQr([
    'merchantID' => 'YOUR_MERCHANT_ID',
    'channel' => 'DuitNowSQR',
    'orderid' => 'YOUR_ORDER_ID',
    'currency' => 'MYR',
    'bill_name' => 'Item name',
    'bill_desc' => 'Item description',
    'checksum' => md5('YOUR_MERCHANT_ID'.'DuitNowSQR'.'YOUR_ORDER_ID'.'MYR'.'YOUR_VERIFY_KEY')
]);
```

Card BIN Checker
----------------

[](#card-bin-checker)

To retrieve the card BIN information such as card type and the issuer information.

```
$response = $rms->cardBin([
    'domain' => 'YOUR_MERCHANT_ID',
    'skey' => md5('YOUR_MERCHANT_ID'.'YOUR_SECRET_KEY','BIN'),
    'BIN' => '555566' //First 6-digit number of the PAN
]);
```

Void Pending
------------

[](#void-pending)

For merchants to cancel and void the cash payment request order, before getting paid or the expiry time, and force-to-expired.

```
$response = $rms->voidPending([
    'tranID' => 'TRANSACTION_ID',
    'amount' => 'AMOUNT_OF_THE_TRANSACTION',
    'merchantID' => 'YOUR_MERCHANT_ID',
    'checksum' => md5('TRANSACTION_ID'.'AMOUNT_OF_THE_TRANSACTION'.'YOUR_MERCHANT_ID'.'YOUR_VERIFY_KEY')
]);
```

Refund
------

[](#refund)

Merchants can request a full/partial refund for a “captured” or “settled” transaction regardless of the payment method. The request can be sent within 180 days from the transaction creation date and the refund process will take about 7-14 days after the request is sent.

Merchants can enable the “Refund Portal” so that buyers who need a refund could easily provide the bank account details to shorten the refund lead time.

```
$response = $rms->refund([
    'RefundType' => 'P',
    'MerchantID' => 'YOUR_MERCHANT_ID',
    'RefID' => 'ORDER_ID',
    'TxnID' => 'TRANSACTION_ID',
    'Amount' => 'AMOUNT_TO_REFUND',
    'Signature' => md5('P'.'YOUR_MERCHANT_ID'.'REF_ID'.'TXN_ID'.'AMOUNT_TO_REFUND'.'YOUR_SECRET_KEY')
]);
```

Refund Status
-------------

[](#refund-status)

Merchant is able to do a status inquiry for a refund transaction.

```
$response = $rms->refundStatus([
    'TxnID' => 'TRANSACTION_ID',
    'MerchantID' => 'YOUR_MERCHANT_ID',
    'Signature' => md5('TRANSACTION_ID'.'YOUR_MERCHANT'.'YOUR_VERIFY_KEY')
]);
```

Status CodeDescription00Refund successful11Refund rejected22Refund pending

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

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

4

Last Release

744d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/54403b88c1430ae5ee3506239beeb73e15c848777ffa42a0d231afb9d690b87b?d=identicon)[CoolerProYT](/maintainers/CoolerProYT)

---

Top Contributors

[![CoolerProYT](https://avatars.githubusercontent.com/u/118531227?v=4)](https://github.com/CoolerProYT "CoolerProYT (23 commits)")

### Embed Badge

![Health badge](/badges/coolerproyt-razerms-php/health.svg)

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

PHPackages © 2026

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