PHPackages                             maxiewright/laravel-wipay - 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. maxiewright/laravel-wipay

ActiveLibrary[Payment Processing](/categories/payments)

maxiewright/laravel-wipay
=========================

WiPay Caribbean Laravel Integration

v1.0.1(1mo ago)026[1 PRs](https://github.com/maxiewright/laravel-wipay/pulls)MITPHPPHP ^8.4CI passing

Since Jun 10Pushed 1mo agoCompare

[ Source](https://github.com/maxiewright/laravel-wipay)[ Packagist](https://packagist.org/packages/maxiewright/laravel-wipay)[ Docs](https://github.com/maxiewright/laravel-wipay)[ GitHub Sponsors](https://github.com/maxiewright)[ RSS](/packages/maxiewright-laravel-wipay/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (32)Versions (7)Used By (0)

Laravel WiPay
=============

[](#laravel-wipay)

Laravel package for WiPay Caribbean hosted checkout, return verification, webhook handling, and encrypted merchant credential storage.

The package supports two credential modes:

- Platform mode uses credentials from `config/wipay.php`.
- Merchant mode uses encrypted, owner-bound merchant credential records stored by your application.

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

[](#installation)

Install the package with Composer:

```
composer require maxiewright/laravel-wipay
```

Publish the config and migration, then migrate:

```
php artisan vendor:publish --tag="wipay-config"
php artisan vendor:publish --tag="wipay-migrations"
php artisan migrate
```

Merchant API keys are stored with Laravel encrypted casts, so your application must have a stable `APP_KEY`.

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

[](#configuration)

Set platform credentials when your app receives payments through one WiPay account:

```
WIPAY_ENVIRONMENT=sandbox
WIPAY_COUNTRY_CODE=TT
WIPAY_CURRENCY=TTD
WIPAY_ACCOUNT_NUMBER=1234567890
WIPAY_API_KEY=your-api-key
WIPAY_PAYMENT_LINK_URL=https://tt.wipayfinancial.com/to_me/your-account
WIPAY_SCAN_TO_PAY_URL=https://tt.wipayfinancial.com/scan2pay/your-account
```

Supported market request URLs are configured for `TT`, `BB`, `GY`, and `JM`. Override `WIPAY_*_REQUEST_URL` values if WiPay gives you a different endpoint.

Platform Checkout
-----------------

[](#platform-checkout)

Use platform checkout when the application owns the WiPay account.

```
use Maxiewright\LaravelWipay\Data\WipayCheckout;
use Maxiewright\LaravelWipay\Facades\LaravelWipay as Wipay;

$response = Wipay::platformCheckout(new WipayCheckout(
    orderId: 'TS-001',
    total: '99.00',
    responseUrl: route('wipay.return'),
    customerName: 'Anita Mohammed',
    customerPhone: '+18687771111',
    customerEmail: 'anita@example.com',
    data: ['registration_uuid' => $registration->uuid],
))->create();

return redirect()->away($response->url());
```

For direct form integrations, call `form()` instead of `create()` and post the returned fields to `action()`.

Merchant Credentials
--------------------

[](#merchant-credentials)

Use merchant credentials when each shop, vendor, or tenant has its own WiPay account.

```
use Maxiewright\LaravelWipay\Facades\LaravelWipay as Wipay;

Wipay::merchantCredentials()->for($shop)->upsert([
    'environment' => 'sandbox',
    'country_code' => 'TT',
    'currency' => 'TTD',
    'account_number' => $request->string('account_number'),
    'api_key' => $request->string('api_key'),
    'payment_link_url' => $request->string('payment_link_url'),
    'scan_to_pay_url' => $request->string('scan_to_pay_url'),
    'enabled' => true,
]);
```

Then create a checkout for that owner:

```
use Maxiewright\LaravelWipay\Data\WipayCheckout;
use Maxiewright\LaravelWipay\Facades\LaravelWipay as Wipay;

$response = Wipay::merchantCheckout($shop, new WipayCheckout(
    orderId: 'SHOP-1001',
    total: '49.00',
    responseUrl: route('shops.wipay.return', $shop),
))->create();

return redirect()->away($response->url());
```

Merchant checkout never falls back to platform credentials. Missing or disabled merchant credentials throw `WipayUnavailableException`.

Payment Links
-------------

[](#payment-links)

Configured WiPay payment links are exposed without creating a checkout.

```
$platformLink = Wipay::platformLinks()->paymentLink();
$merchantScanToPay = Wipay::merchantLinks($shop)->scanToPay();
```

`merchantLinks($owner)` returns empty links when that owner has no enabled merchant credentials.

Return Verification
-------------------

[](#return-verification)

Verify WiPay return payloads before marking an order paid.

```
use Illuminate\Http\Request;
use Maxiewright\LaravelWipay\Facades\LaravelWipay as Wipay;

public function __invoke(Request $request)
{
    $result = Wipay::verifyReturn($request, [
        'order_id' => $request->input('order_id'),
        'total' => '99.00',
        'currency' => 'TTD',
    ]);

    if ($result->ok()) {
        // Mark the local order paid using $result->transactionId.
    }

    return view('payments.return', ['result' => $result]);
}
```

For merchant credentials, pass the mode and owner:

```
$result = Wipay::verifyReturn($request, $expected, mode: 'merchant', owner: $shop);
```

Webhooks
--------

[](#webhooks)

Enable the package webhook route when WiPay should post server-side updates to your app:

```
WIPAY_WEBHOOK_ENABLED=true
WIPAY_WEBHOOK_PATH=wipay/webhook
WIPAY_WEBHOOK_THROTTLE=60,1
```

Listen for webhook events in your application:

```
use Illuminate\Support\Facades\Event;
use Maxiewright\LaravelWipay\Events\WipayWebhookVerified;

Event::listen(WipayWebhookVerified::class, function (WipayWebhookVerified $event): void {
    $result = $event->result;

    // Reconcile the local payment by $result->orderId and $result->transactionId.
});
```

When verifying webhooks the package will prefer a dedicated webhook secret when available rather than the API key. Behavior:

- Platform mode: uses `config('wipay.platform.webhook_secret')` if set (non-empty).
- Merchant mode: uses the merchant credential `webhook_secret` when present.
- If a webhook secret is not available, fallback to the API key is controlled by `config('wipay.hash.allow_webhook_api_key_fallback')` (default `false`). When that flag is `true` verification will fall back to the API key; when `false` webhook verification will be rejected with the `missing_secret` reason.

Return verification also emits `WipayPaymentVerified` or `WipayPaymentRejected`. Webhook handling emits `WipayWebhookVerified` or `WipayWebhookRejected` and always responds with HTTP 200.

Testing
-------

[](#testing)

Use `Wipay::fake()` to avoid live HTTP calls and assert checkout fields.

```
use Maxiewright\LaravelWipay\Data\WipayCheckout;
use Maxiewright\LaravelWipay\Facades\LaravelWipay as Wipay;

Wipay::fake()->checkoutUrl('https://tt.wipayfinancial.com/hosted-page/test');

$response = Wipay::platformCheckout(new WipayCheckout(
    orderId: 'TS-001',
    total: '99.00',
    responseUrl: 'https://app.test/wipay/return',
))->create();

expect($response->url())->toBe('https://tt.wipayfinancial.com/hosted-page/test');

Wipay::assertCheckoutCreated(
    fn (array $fields): bool => $fields['order_id'] === 'TS-001'
);
```

Run the package test suite with:

```
composer test
composer analyse
composer format
```

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

2

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01df7160f037b372732c65fc33626f5e3ace6ad1b8afe1d5cbdb1bb3e372b818?d=identicon)[MaxieWright](/maintainers/MaxieWright)

---

Top Contributors

[![maxiewright](https://avatars.githubusercontent.com/u/32748178?v=4)](https://github.com/maxiewright "maxiewright (45 commits)")

---

Tags

laravelmaxiewrightlaravel-wipay

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/maxiewright-laravel-wipay/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k21](/packages/fleetbase-core-api)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1613.3k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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