PHPackages                             ttrig/laravel-billmate - 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. ttrig/laravel-billmate

ActiveLibrary[Payment Processing](/categories/payments)

ttrig/laravel-billmate
======================

Laravel package for working with Billmate API

v3.0.0(2y ago)1237↓75%1MITPHPPHP ^8.2CI failing

Since Sep 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ttrig/laravel-billmate)[ Packagist](https://packagist.org/packages/ttrig/laravel-billmate)[ Docs](https://github.com/ttrig/laravel-billmate)[ RSS](/packages/ttrig-laravel-billmate/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (6)Versions (11)Used By (0)

[![Build Status](https://github.com/ttrig/laravel-billmate/actions/workflows/build.yml/badge.svg)](https://github.com/ttrig/laravel-billmate/actions)[![Codecov](https://camo.githubusercontent.com/f9513075948f1bacf581faaad3ac01c576ff20f311b27b701630eca7b6dfeeb8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f74747269672f6c61726176656c2d62696c6c6d6174652f6d61737465722e737667)](https://codecov.io/gh/ttrig/laravel-billmate)[![Packagist Version](https://camo.githubusercontent.com/23189057e489c1014e21f0efec117faa7460cbd48e8b31de0f5b0a86a103985f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74747269672f6c61726176656c2d62696c6c6d617465)](https://packagist.org/packages/ttrig/laravel-billmate)[![License](https://camo.githubusercontent.com/f103d8b43294ad9db7fe203d36e70f008d30c38d62d560bd24421ac04a1babb5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74747269672f6c61726176656c2d62696c6c6d6174652e737667)](https://github.com/ttrig/laravel-billmate/blob/master/LICENSE.md)

Laravel Billmate
================

[](#laravel-billmate)

Laravel package for interacting with Billmate API.

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

[](#installation)

```
composer require ttrig/laravel-billmate
```

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

[](#configuration)

Publish the configuration file using this command:

```
php artisan vendor:publish --provider="Ttrig\Billmate\ServiceProvider"
```

Add a Billmate ID and key in `.env`.

```
BILLMATE_ID=123
BILLMATE_KEY=abc
BILLMATE_TEST=true
```

Update `config/billmate.php` to use your own controller(s).

```
'accept_action' => 'App\Http\Controllers\BillmateController@accept',
'cancel_action' => 'App\Http\Controllers\BillmateController@cancel',
'callback_action' => \Ttrig\Billmate\Controllers\CallbackController::class,
```

General payment flow
--------------------

[](#general-payment-flow)

-
-
-

Usage example
-------------

[](#usage-example)

### Checkout

[](#checkout)

```
use Ttrig\Billmate\Article as BillmateArticle;
use Ttrig\Billmate\Service as BillmateService;

class CheckoutController extends Controller
{
    public function index(BillmateService $billmate)
    {
        $articles = collect()->push(new BillmateArticle([
            'title' => '1kg potatoes',
            'price' => 30,
        ]));

        $checkout = $billmate->initCheckout($articles);

        return view('checkout', compact('checkout'));
    }
}
```

You can view or update the data to be sent to Billmate by passing a callback as second argument to `initCheckout`.

```
$billmate->initCheckout($articles, function (&$data) {
    data_set($data, 'PaymentData.autoactivate', '1');
});
```

#### View

[](#view)

To render the Billmate Checkout iframe you can use `$checkout->iframe()` in your blade template or write your own iframe and pass `$checkout->url` to its `src`attribute.

#### JavaScript

[](#javascript)

To update height of the Checkout when it updates, we need this JavaScript.

```
window.addEventListener('message', function (event) {
    if (event.origin !== 'https://checkout.billmate.se') {
        return
    }

    try {
        var json = JSON.parse(event.data)
    } catch (e) {
        return
    }

    if (json.event === 'content_height') {
        $('#checkout').height(json.data)
    }
})
```

#### Redirect controller

[](#redirect-controller)

You need your own controller(s) for handling the accept and cancel redirections.

```
use Ttrig\Billmate\Order as BillmateOrder;
use Ttrig\Billmate\Service as BillmateService;

class YourRedirectController extends Controller
{
    public function accept(BillmateService $billmate)
    {
        $order = new BillmateOrder(request()->data);

        $paymentInfo = $billmate->getPaymentInfo($order);

        return view('payment.accept');
    }

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

#### Callback controller

[](#callback-controller)

If you use `Ttrig\Billmate\Controllers\CallbackController::class` as your "callback\_action" in `config/billmate.php`, you need to listen to the `Ttrig\Billmate\Events\OrderCreated` event in your `EventServiceProvider`to handle the order.

```
protected $listen = [
    \Ttrig\Billmate\Events\OrderCreated::class => [
        \App\Listeners\DoSomething::class,
    ],
];
```

Read more about events at .

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

[](#contributing)

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b amazing-feature`)
3. Commit your Changes (`git commit -m 'Add some amazing feature`)
4. Push to the Branch (`git push origin amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

laravel-billmate is open-sourced software licensed under the [MIT license](./LICENSE.md).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

Established project with proven stability

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

Recently: every ~285 days

Total

9

Last Release

1077d ago

Major Versions

v0.2.2 → v1.0.02020-04-14

v1.2.0 → v2.0.02023-03-20

v2.0.0 → v3.0.02023-05-30

PHP version history (5 changes)v0.1.0PHP ^7.3

v0.2.0PHP ^7.2

v1.0.0PHP ^7.4

v1.2.0PHP ^7.4|^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2156132?v=4)[Markus Lilienberg](/maintainers/ttrig)[@ttrig](https://github.com/ttrig)

---

Top Contributors

[![ttrig](https://avatars.githubusercontent.com/u/2156132?v=4)](https://github.com/ttrig "ttrig (25 commits)")

---

Tags

laravelpaymentwebshope-commercebillmate

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ttrig-laravel-billmate/health.svg)

```
[![Health](https://phpackages.com/badges/ttrig-laravel-billmate/health.svg)](https://phpackages.com/packages/ttrig-laravel-billmate)
```

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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