PHPackages                             laraditz/bayar - 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. laraditz/bayar

ActiveLibrary

laraditz/bayar
==============

Expressive and fluent interface to multiple payment gateways.

0.0.6(2y ago)131MITPHPPHP ^7.4|^8.0

Since Aug 30Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (9)Used By (0)

[![Laravel Bayar](./Banner.png)](./Banner.png)

Laravel Bayar
=============

[](#laravel-bayar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a567e5dc9b04a8102ee14e0ab3b441b1b0bef7ffa81f8977390c44e62c99e843/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172616469747a2f62617961722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/bayar)[![Total Downloads](https://camo.githubusercontent.com/6fa742fdf1f1cdab190715af83f898bfdbb95f9abc058d123322c807aac906cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172616469747a2f62617961722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/bayar)[![GitHub Actions](https://github.com/laraditz/bayar/actions/workflows/main.yml/badge.svg)](https://github.com/laraditz/bayar/actions/workflows/main.yml/badge.svg)

Laravel Bayar is a multi-payment processing library for Laravel. It is easy to use and handle most of the tedious tasks when integrating with a payment gateway. You also can easily create a new payment gateway provider to use with this library package.

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

[](#installation)

You can install the package via composer:

```
composer require laraditz/bayar
```

Run the migration command to create the necessary database table.

```
php artisan migrate
```

Then install the payment gateway provider that you wish to use. See [supported providers](#supported-providers) section to see list of all available providers.

```
composer require gerbang-bayar/provider-name
```

Go to respective provider's repository to see how to set it up.

Usage
-----

[](#usage)

To create a payment intent, first create a `PaymentData` object. Then pass it into the `createPayment` method.

Here is the data that you can pass when creating `PaymentData` object. The `extra` prorperties can be used to pass an extra properties needed and it must follows the same property name as in the payment gateway respective's API.

```
public string $currency,
public int $amount, // smallest currency unit
public string $returnUrl,
public string $description,
public array $customer,
public ?string $callbackUrl = null,
public ?string $merchantRefId = null,
public ?array $extra = [],
```

To create payment and get the payment URL to be redirected to.

```
use Laraditz\Bayar\Data\PaymentData;

$paymentData = new PaymentData(
    description: 'Purchase',
    currency: 'MYR',
    amount: 1000,
    returnUrl: 'https://returnurl.here',
    customer: [
        'name' => 'Raditz Farhan',
        'phone' => '6012345678',
        'email' => 'raditzfarhan@gmail.com'
    ],
    extra: [
        'shippingAddress' => [
            'countryCode' => 'MY',
            'lines' => [
                'No 1, Taman ABC',
                'Jalan DCEF'
            ],
            'postCode' => '12345'
        ],
        'items' => [
            [
                'itemId' => 'ITEMSKU',
                'name' => 'Item 1',
                'quantity' => 1,
                'price' => 1000,
            ]
        ]
    ]
);

$bayar = \Bayar::driver('atome')->createPayment($paymentData);
```

Return example:

```
[
  "id" => "01h91mbatnwn27y4y5s88b783k"
  "merchant_ref_id" => null
  "expires_at" => "2023-08-29T21:54:13.000000Z"
  "payment_url" => "http://yourappurl.com/bayar/pay/01h91mbatnwn27y4y5s88b783k"
]

```

Redirect to the `payment_url` to proceed to payment page. Once done, you will be redirected to the `returnUrl`.

Callback
--------

[](#callback)

Callback event will be managed automatically by this package. Each providers have their own callback event to receives payment update from respective payment gateway provider. You just need to add a `listener` for the event. Refer to the provider package for more info.

Supported Providers
-------------------

[](#supported-providers)

Currently it has only one provider which is `Atome`, but the list will grows with time.

- [Atome](https://github.com/gerbang-bayar/atome)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Raditz Farhan](https://github.com/laraditz)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Dependencies
------------

[](#dependencies)

- [Gerbang Bayar Support](https://github.com/gerbang-bayar/support).
- [Saloon](https://docs.saloon.dev/).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

7

Last Release

982d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1203676?v=4)[Raditz Farhan](/maintainers/raditzfarhan)[@raditzfarhan](https://github.com/raditzfarhan)

---

Top Contributors

[![raditzfarhan](https://avatars.githubusercontent.com/u/1203676?v=4)](https://github.com/raditzfarhan "raditzfarhan (29 commits)")

---

Tags

laraditzbayar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laraditz-bayar/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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