PHPackages                             webimpian/bayarcash-php-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. [Payment Processing](/categories/payments)
4. /
5. webimpian/bayarcash-php-sdk

ActiveSdk[Payment Processing](/categories/payments)

webimpian/bayarcash-php-sdk
===========================

Bayarcash payment gateway PHP Sdk.

2.1.2(3mo ago)24.9k↑134%3MITPHPPHP ^7.4|^8.0|^8.1

Since Aug 30Pushed 3mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (19)Used By (0)

Bayarcash Payment Gateway PHP SDK
=================================

[](#bayarcash-payment-gateway-php-sdk)

Introduction
------------

[](#introduction)

The [Bayarcash](https://bayarcash.com/) SDK provides an expressive interface for interacting with Bayarcash's Payment Gateway API. This SDK supports both API v2 and v3, with enhanced features available in v3.

Official Documentation
----------------------

[](#official-documentation)

### Installation

[](#installation)

To install the SDK in your project you need to require the package via composer:

```
composer require webimpian/bayarcash-php-sdk
```

### Basic Usage

[](#basic-usage)

You can create an instance of the SDK like so:

```
$bayarcash = new Webimpian\BayarcashSdk\Bayarcash(TOKEN_HERE);
$bayarcash->useSandbox(); // call this method to switch to use sandbox
```

For Laravel user:

```
// set value for BAYARCASH_API_TOKEN and BAYARCASH_API_SECRET_KEY in the .env file
BAYARCASH_API_TOKEN=
BAYARCASH_API_SECRET_KEY=
```

```
$bayarcash = app(\Webimpian\BayarcashSdk\Bayarcash::class);
$bayarcash->useSandbox(); // call this method to switch to use sandbox
```

### Configuration Options

[](#configuration-options)

```
// Optional: Set API version (default is 'v2')
$bayarcash->setApiVersion('v3');
```

Available Payment Channels
--------------------------

[](#available-payment-channels)

The SDK supports multiple payment channels:

```
Bayarcash::FPX                 // FPX Online Banking
Bayarcash::MANUAL_TRANSFER     // Manual Bank Transfer
Bayarcash::FPX_DIRECT_DEBIT    // FPX Direct Debit
Bayarcash::FPX_LINE_OF_CREDIT  // FPX Line of Credit
Bayarcash::DUITNOW_DOBW        // DuitNow Online Banking
Bayarcash::DUITNOW_QR          // DuitNow QR
Bayarcash::SPAYLATER           // ShopeePayLater
Bayarcash::BOOST_PAYFLEX       // Boost PayFlex
Bayarcash::QRISOB              // QRIS Online Banking
Bayarcash::QRISWALLET          // QRIS Wallet
Bayarcash::NETS                // NETS
Bayarcash::CREDIT_CARD         // Credit Card
Bayarcash::ALIPAY              // Alipay
Bayarcash::WECHATPAY           // WeChat Pay
Bayarcash::PROMPTPAY           // PromptPay
Bayarcash::TOUCH_N_GO          // Touch 'n Go eWallet
Bayarcash::BOOST_WALLET        // Boost Wallet
Bayarcash::GRABPAY             // GrabPay
Bayarcash::GRABPL              // Grab PayLater
Bayarcash::SHOPEE_PAY          // ShopeePay
```

Core Features
-------------

[](#core-features)

### Portal Management

[](#portal-management)

```
// Get all available portals
$portals = $bayarcash->getPortals();

// Get available payment channels for a specific portal
$channels = $bayarcash->getChannels('your_portal_key');
```

### FPX Bank Integration

[](#fpx-bank-integration)

```
// Get list of available FPX banks
$banks = $bayarcash->fpxBanksList();
```

### Payment Processing

[](#payment-processing)

> Note: The checksum value and checksum validation are optional, but it is recommended for enhanced security.

```
// Generate checksum for payment intent
$paymentIntentRequestChecksum = $bayarcash->createPaymentIntenChecksumValue(API_SECRET_KEY, REQUEST_DATA);

// append checksum value to your REQUEST_DATA
$data['checksum'] = $paymentIntentRequestChecksum;

// Send payment request
$response = $bayarcash->createPaymentIntent(REQUEST_DATA);
header("Location: " . $response->url); // redirect payer to Bayarcash checkout page.
```

### Callback Verification

[](#callback-verification)

```
// Verify callbacks
// pre-transaction callback
$validPreTransaction = $bayarcash->verifyPreTransactionCallbackData(CALLBACK_DATA, API_SECRET_KEY);

// transaction callback
$validTransaction = $bayarcash->verifyTransactionCallbackData(CALLBACK_DATA, API_SECRET_KEY);

// return URL callback
$validReturnUrl = $bayarcash->verifyReturnUrlCallbackData(CALLBACK_DATA, API_SECRET_KEY);
```

### Payment Intent Management

[](#payment-intent-management)

```
// Get payment intent details (V3 API only)
$paymentIntent = $bayarcash->getPaymentIntent('payment_intent_id');
```

### Transaction Management

[](#transaction-management)

```
// Get single transaction
$transaction = $bayarcash->getTransaction('transaction_id');

// V3 API Features
if ($bayarcash->getApiVersion() === 'v3') {
    // Get all transactions with filters
    $transactions = $bayarcash->getAllTransactions([
        'order_number' => 'ORDER123',
        'status' => '3',
        'payment_channel' => Bayarcash::FPX,
        'exchange_reference_number' => 'REF123',
        'payer_email' => 'customer@example.com'
    ]);

    // Specialized transaction queries
    $orderTransactions = $bayarcash->getTransactionByOrderNumber('ORDER123');
    $emailTransactions = $bayarcash->getTransactionsByPayerEmail('customer@example.com');
    $statusTransactions = $bayarcash->getTransactionsByStatus('3');
    $channelTransactions = $bayarcash->getTransactionsByPaymentChannel(Bayarcash::FPX);
    $refTransaction = $bayarcash->getTransactionByReferenceNumber('REF123');
}
```

### FPX Direct Debit Features

[](#fpx-direct-debit-features)

#### 1. FPX Direct Debit Enrolment

[](#1-fpx-direct-debit-enrolment)

```
$enrolmentRequestChecksum = $bayarcash->createFpxDirectDebitEnrolmentChecksumValue(API_SECRET_KEY, REQUEST_DATA);

// append checksum value to your REQUEST_DATA
$data['checksum'] = $enrolmentRequestChecksum;

$response = $bayarcash->createFpxDirectDebitEnrollmentIntent($data);
header("Location: " . $response->url); // redirect payer to Bayarcash Fpx Direct Debit enrolment page.
```

#### 2. FPX Direct Debit Maintenance

[](#2-fpx-direct-debit-maintenance)

```
$maintenanceRequestChecksum = $bayarcash->createFpxDirectDebitMaintenanceChecksumValue(API_SECRET_KEY, REQUEST_DATA);

// append checksum value to your REQUEST_DATA
$data['checksum'] = $maintenanceRequestChecksum;

$response = $bayarcash->createFpxDirectDebitMaintenanceIntent($data);
header("Location: " . $response->url); // redirect payer to Bayarcash Fpx Direct Debit maintenance page.
```

#### 3. FPX Direct Debit Termination

[](#3-fpx-direct-debit-termination)

```
$response = $bayarcash->createFpxDirectDebitTerminationIntent($data);
header("Location: " . $response->url); // redirect payer to Bayarcash Fpx Direct Debit termination page.
```

Security Recommendations
------------------------

[](#security-recommendations)

1. Always use checksums for payment requests when possible
2. Verify all callbacks using the provided verification methods
3. Store and validate transaction IDs to prevent duplicate processing
4. Use HTTPS for all API communications
5. Keep your API tokens and secret keys secure

API Documentation
-----------------

[](#api-documentation)

Please refer to the [Official Bayarcash API Documentation](https://api.webimpian.support/bayarcash) for detailed information about our API.

Support
-------

[](#support)

For support questions, please contact Bayarcash support or raise an issue in the repository.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for version update history.

License
-------

[](#license)

This SDK is open-sourced software licensed under the MIT license.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance80

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.5% 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 ~30 days

Recently: every ~47 days

Total

18

Last Release

105d ago

Major Versions

1.2.5 → 2.0.02025-01-17

### Community

Maintainers

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

---

Top Contributors

[![khairulimran-97](https://avatars.githubusercontent.com/u/105085586?v=4)](https://github.com/khairulimran-97 "khairulimran-97 (22 commits)")[![imanifaiz](https://avatars.githubusercontent.com/u/7203373?v=4)](https://github.com/imanifaiz "imanifaiz (13 commits)")[![hannyramzy](https://avatars.githubusercontent.com/u/10192653?v=4)](https://github.com/hannyramzy "hannyramzy (1 commits)")[![webimpianteam](https://avatars.githubusercontent.com/u/66111282?v=4)](https://github.com/webimpianteam "webimpianteam (1 commits)")

### Embed Badge

![Health badge](/badges/webimpian-bayarcash-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/webimpian-bayarcash-php-sdk/health.svg)](https://phpackages.com/packages/webimpian-bayarcash-php-sdk)
```

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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