PHPackages                             mu-hasan/laravel-winpay - 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. mu-hasan/laravel-winpay

ActiveLibrary[Payment Processing](/categories/payments)

mu-hasan/laravel-winpay
=======================

A package that integrate WinPay Payment Gateway with Laravel Framework

0.0.2(4y ago)0351PHPPHP ^5.6|^7.0|^8.0

Since Feb 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mu-hasan/laravel-winpay)[ Packagist](https://packagist.org/packages/mu-hasan/laravel-winpay)[ RSS](/packages/mu-hasan-laravel-winpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Laravel-WinPay
==============

[](#laravel-winpay)

A non-official package that help you to implements WinPay Payment Gateway (winpay.id) into your Laravel applications

### Installation

[](#installation)

Install the package via composer :

```
$ composer require mu-hasan/laravel-winpay "^0.0.1"
```

Add this lines into your `.env` file and fill with your WinPay credentials :

```
# ...
WINPAY_HOST=putWinpayHostHere
WINPAY_PK1=putWinpayPrivateKey1Here
WINPAY_PK2=putWinpayPrivateKey2Here
WINPAY_MK=putWinpayMerchantKeyHere
WINPAY_LISTENER=putWinpayListenerPathHere

```

#### Laravel

[](#laravel)

Please register the service provider :

```
// config/app.php
'Providers' => [
    // ...
    /*
     * Package Service Providers...
     */
    MuHasan\LaravelWinpay\WinpayServiceProvider::class,
    // ...
]
```

You could use the facade by add this line :

```
// config/app.php
'aliases' => [
    // ...
    'Winpay' => MuHasan\LaravelWinpay\WinpayFacade::class,
];
```

Please publish the config file to define your WinPay credentials :

```
$ php artisan vendor:publish --provider="MuHasan\LaravelWinpay\WinpayServiceProvider"
```

#### Lumen

[](#lumen)

Please add this line to the `bootstrap/app.php` file

```
$app->configure('laravel-winpay');
//...
$app->register(MuHasan\LaravelWinpay\WinpayServiceProvider::class);
```

You could get the config file from this [laravel-winpay.php](https://github.com/mu-hasan/laravel-winpay/blob/master/resources/config/laravel-winpay.php). Then copy it into `config/laravel-winpay.php`

### Send Request to WinPay

[](#send-request-to-winpay)

For now, this package only support `getToolbar` and `getPaymentCode`.

#### getToolbar

[](#gettoolbar)

From the [documentation](https://winpayapi.docs.apiary.io/#reference/0/api-daftar-payment-channel), this function will be return list of payment channel. You can use like this:

```
winpay()->getToolbar();
// OR
Winpay::getToolbar();
```

#### getPaymentCode

[](#getpaymentcode)

From the [documentation](https://winpayapi.docs.apiary.io/#reference/0/api-payment-code), this function will be return payment code of choosen payment channel and transaction details. You can use like this:

```
winpay()->getPaymentCode($paymentChannel, $transaction, $user, $items);
// OR
Winpay::getToolbar($paymentChannel, $transaction, $user, $items);
```

You must passing `$paymentChannel` parameter from one of `getToolbar()` response.

The `$transaction` parameter you must passing the model that implements `MuHasan\LaravelWinpay\BillingTransaction` interface and define the `getBillTransactionEndAt()`, `getBillTransactionReff()`, and `getBillTransactionAmount()` functions into it.

```
class FooTransaction extends Model implements BillingTransaction
{
    //...
    public function getBillTransactionEndAt(): \DateTime
    {
        return $this->reff;
    }

    public function getBillTransactionReff(): string
    {
        return $this->reff;
    }

    public function getBillTransactionAmount(): int
    {
        return $this->total;
    }
    //...
}
```

The `$user` parameter you must passing the model that implements `MuHasan\LaravelWinpay\BillingUser` interface and define the `getgetBillUserName()`, `getgetBillUserPhone()`, and `getgetBillUserEmail()` functions into it.

```
class FooUser extends Model implements BillingUser
{
    //...
    public function getBillUserName(): string
    {
        return $this->name;
    }

    public function getBillUserPhone(): string
    {
        return $this->phone;
    }

    // nullable
    public function getBillUserEmail(): ?string
    {
        return $this->email;
        // OR
        // return null;
    }
    //...
}
```

The `$items` parameter you must passing array of the model that implements `MuHasan\LaravelWinpay\BillingItem` interface and define the `getBillItemName()`, `getBillItemQty()`, `getBillItemUnitPrice()`, `getBillItemSku()`, and `getBillItemDesc()` functions into it.

```
class FooItem extends Model implements BillingItem
{
    //...
    public function getBillItemName(): string
    {
        return $this->name;
    }

    public function getBillItemQty(): int
    {
        return $this->qty;
    }

    public function getBillItemUnitPrice(): int
    {
        return $this->amount;
    }

    // nullable
    public function getBillItemSku(): ?string
    {
        return $this->short_id;
        // OR
        // return null;
    }

    // nullable
    public function getBillItemDesc(): ?string
    {
        return $this->note;
        // OR
        // return null;
    }
    //...
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

1533d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33aebf9be9d6441823789909b8959d74a85e5d47b9095af81238ae1450b4623a?d=identicon)[mu-hasan](/maintainers/mu-hasan)

---

Top Contributors

[![mu-hasan](https://avatars.githubusercontent.com/u/8762248?v=4)](https://github.com/mu-hasan "mu-hasan (3 commits)")

### Embed Badge

![Health badge](/badges/mu-hasan-laravel-winpay/health.svg)

```
[![Health](https://phpackages.com/badges/mu-hasan-laravel-winpay/health.svg)](https://phpackages.com/packages/mu-hasan-laravel-winpay)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[karson/mpesa-php-sdk

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

PHPackages © 2026

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