PHPackages                             wemisc/pay-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. wemisc/pay-sdk

ActiveLibrary[Payment Processing](/categories/payments)

wemisc/pay-sdk
==============

Official PHP client for the WeMisc Pay partner integration and dashboard/mobile APIs.

v2.0.1(today)00MITPHPPHP ^8.2

Since Jul 18Pushed todayCompare

[ Source](https://github.com/Promp-Tech/wemisc-pay-sdk)[ Packagist](https://packagist.org/packages/wemisc/pay-sdk)[ RSS](/packages/wemisc-pay-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

wemisc/pay-sdk
==============

[](#wemiscpay-sdk)

The official WeMisc Pay PHP SDK. The Composer package name is `wemisc/pay-sdk`. It covers both WeMisc Pay APIs with typed results and exceptions instead of hand-rolled HTTP calls:

- **`WeMiscPayClient`** — the partner integration API (`api_token`, server-to-server): create a checkout, confirm an invoice's status. This is what most integrations need.
- **`WeMiscPayDashboardClient`** — the dashboard/mobile API (per-user login): company profile, invoice/payment-session listing, reports. Use this to build a mobile app or an external dashboard on top of the same data a user sees when they log into WeMisc Pay.

Install
-------

[](#install)

```
composer require wemisc/pay-sdk
```

Partner integration — `WeMiscPayClient`
---------------------------------------

[](#partner-integration--wemiscpayclient)

```
use WeMiscPay\Sdk\WeMiscPayClient;
use WeMiscPay\Sdk\Exceptions\ValidationException;
use WeMiscPay\Sdk\Exceptions\ApiException;

$client = new WeMiscPayClient(
    apiToken: 'wm_...',                                         // Companies > Edit in the WeMiscPay dashboard
    baseUrl: 'https://your-wemisc-pay-instance.test/api/v1/integrations',
);

try {
    $checkout = $client->checkout(
        amount: 250.00,
        successUrl: 'https://your-app.test/orders/123/paid',
        failUrl: 'https://your-app.test/orders/123/failed',
        reference: 'order-123',                                 // your own id, echoed back later
    );

    // Send the customer here — WeMiscPay hosts the actual card entry page.
    header("Location: {$checkout->checkoutUrl}");
} catch (ValidationException $e) {
    // $e->errors() is a field => [messages] map, same shape as Laravel validation errors.
} catch (ApiException $e) {
    // e.g. 503 — no payment gateway configured on the WeMiscPay side yet.
    // $e->statusCode(), $e->body()
}
```

### Laravel

[](#laravel)

```
WEMISC_PAY_API_TOKEN=wm_...
WEMISC_PAY_BASE_URL=https://your-wemisc-pay-instance.test/api/v1/integrations

```

```
use WeMiscPay\Sdk\Laravel\Facades\WeMiscPay;

$checkout = WeMiscPay::checkout(250.00, route('orders.paid', $order), route('orders.failed', $order), (string) $order->id);

return redirect($checkout->checkoutUrl);
```

### Handling the redirect back

[](#handling-the-redirect-back)

Once the customer finishes on `checkout_url`, WeMiscPay redirects their browser back to your `success_url` or `fail_url` with `?invoice_id=...` appended (`&status=...` too, on the success and explicit-cancel paths — a generic failure only appends `invoice_id`).

**Don't trust those query params as proof of payment** — they're for UX (which page to show), not confirmation. Always re-check the real state server-side:

```
$invoice = $client->getInvoice((int) $request->query('invoice_id'));

if ($invoice->isPaid()) {
    // fulfil the order
}
```

Dashboard / mobile — `WeMiscPayDashboardClient`
-----------------------------------------------

[](#dashboard--mobile--wemiscpaydashboardclient)

A separate API, authenticated by logging in as a WeMiscPay user (Sanctum token), not the company `api_token` above. A main-account user sees every company through it; everyone else sees only their own — exactly like the web dashboard.

```
use WeMiscPay\Sdk\WeMiscPayDashboardClient;

$dashboard = new WeMiscPayDashboardClient('https://your-wemisc-pay-instance.test/api');

$dashboard->login('you@company.test', 'your-password'); // stores the token on $dashboard for you

$profile = $dashboard->companyProfile();
echo $profile->name, ' — balance: ', $profile->balance;

foreach ($profile->paymentProfiles as $method) {
    echo "{$method->paymentMethod}: {$method->successCount} successful, {$method->commissionTotal} commission\n";
}

$page = $dashboard->invoices(); // DTO\PaginatedResult of DTO\DashboardInvoice
foreach ($page->items as $invoice) {
    echo "{$invoice->invoiceSerial}: {$invoice->status}\n";
}

$one = $dashboard->invoice(42);
$sessions = $dashboard->paymentSessions();

$rows = $dashboard->monthlyPaidPerCompany(); // raw arrays — see "Reports" below

$dashboard->logout();
```

Already have a token from a previous `login()` (e.g. you persisted it in the current user's session)? Skip logging in again:

```
$dashboard = (new WeMiscPayDashboardClient($baseUrl))->withToken($storedToken);
```

### Laravel

[](#laravel-1)

```
WEMISC_PAY_DASHBOARD_BASE_URL=https://your-wemisc-pay-instance.test/api

```

```
use WeMiscPay\Sdk\Laravel\Facades\WeMiscPayDashboard;

WeMiscPayDashboard::login($request->email, $request->password);
$profile = WeMiscPayDashboard::companyProfile();
```

Note this facade resolves a **request-scoped** instance (`Application::scoped()`, not a plain singleton) — safe under Octane/queue workers, where a plain singleton could otherwise leak one user's logged-in token into another request.

### Reports

[](#reports)

`monthlyPaidPerCompany()`, `monthlyPaidPerBank()`, `settledPerCompany()`, `companyWithBanks()` return **plain decoded arrays**, not DTOs — each groups rows differently (by company+month, bank+month, company+batch, company+bank), so a single fixed shape doesn't fit all four honestly. Check the field names against the [in-dashboard API docs](../../resources/views/docs/integration.blade.php) `#mobile-reports` section, or just `var_dump()` a response once.

API surface
-----------

[](#api-surface)

**`WeMiscPayClient`** (partner integration, `api_token`):

MethodMaps toReturns`checkout(amount, successUrl, failUrl, reference?)``POST /checkout``DTO\CheckoutResult``getInvoice(invoiceId)``GET /invoices/{id}``DTO\Invoice`**`WeMiscPayDashboardClient`** (dashboard/mobile, user login):

MethodMaps toReturns`login(email, password)``POST /login``string` (token, also stored on the client)`withToken(token)`—`$this`, for reusing an existing token`logout()``POST /logout``void``companyProfile()``GET /company/profile``DTO\CompanyProfile``invoices(page = 1)``GET /invoices``DTO\PaginatedResult``invoice(invoiceId)``GET /invoices/{id}``DTO\DashboardInvoice``paymentSessions(page = 1)``GET /payment-sessions``DTO\PaginatedResult``monthlyPaidPerCompany()``GET /reports/monthly-paid-company``array``monthlyPaidPerBank()``GET /reports/monthly-paid-banks``array``settledPerCompany()``GET /reports/settled-per-company``array``companyWithBanks()``GET /reports/company-with-banks``array`Exceptions
----------

[](#exceptions)

Both clients throw the same set, all extending `WeMiscPay\Sdk\Exceptions\WeMiscPayException`:

- `AuthenticationException` — invalid/missing credentials (401).
- `ValidationException` — bad input (422); `->errors()` gives the field-level messages.
- `ApiException` — anything else non-2xx (404, 503, ...); `->statusCode()` / `->body()`.

`WeMiscPayDashboardClient` also throws a plain `WeMiscPayException` if you call an authenticated method before `login()`/`withToken()`.

Testing this package
--------------------

[](#testing-this-package)

```
composer install
composer test
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Total

4

Last Release

0d ago

Major Versions

v1.1.0 → v2.0.02026-07-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/123180892?v=4)[Mohamed Saeed Gomaa](/maintainers/mohamedsaeed00451)[@mohamedsaeed00451](https://github.com/mohamedsaeed00451)

---

Top Contributors

[![mohamedsaeed00451](https://avatars.githubusercontent.com/u/123180892?v=4)](https://github.com/mohamedsaeed00451 "mohamedsaeed00451 (2 commits)")

---

Tags

sdkpaymentscheckoutreportswemisc-pay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wemisc-pay-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/wemisc-pay-sdk/health.svg)](https://phpackages.com/packages/wemisc-pay-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)

PHPackages © 2026

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