PHPackages                             lloricode/paymaya-sdk-php - 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. lloricode/paymaya-sdk-php

ActiveLibrary

lloricode/paymaya-sdk-php
=========================

Paymaya SDK for PHP

v3.1.2(8mo ago)58.7k↓42.9%2MITPHPPHP ^8.3CI failing

Since Oct 22Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/lloricode/paymaya-sdk-php)[ Packagist](https://packagist.org/packages/lloricode/paymaya-sdk-php)[ Docs](https://github.com/lloricode/paymaya-sdk-php)[ GitHub Sponsors](https://github.com/lloricode)[ RSS](/packages/lloricode-paymaya-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (34)Used By (2)

[![Paymaya SDK](https://camo.githubusercontent.com/0aa23ed9a62b40afab4ec572cc6cf3f3707a0e6350bdbad5cb7f3a3dfe6f1529/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f5061796d61796125323053444b2532305048502e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6c6c6f7269636f64652532467061796d6179612d73646b2d706870267061747465726e3d617263686974656374267374796c653d7374796c655f32266465736372697074696f6e3d5061796d6179612b53444b2b666f722b504850266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532467777772e7068702e6e6574253246696d616765732532466c6f676f732532466e65772d7068702d6c6f676f2e737667)](https://camo.githubusercontent.com/0aa23ed9a62b40afab4ec572cc6cf3f3707a0e6350bdbad5cb7f3a3dfe6f1529/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f5061796d61796125323053444b2532305048502e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6c6c6f7269636f64652532467061796d6179612d73646b2d706870267061747465726e3d617263686974656374267374796c653d7374796c655f32266465736372697074696f6e3d5061796d6179612b53444b2b666f722b504850266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532467777772e7068702e6e6574253246696d616765732532466c6f676f732532466e65772d7068702d6c6f676f2e737667)

PayMaya SDK for PHP
===================

[](#paymaya-sdk-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/50d9a28b48d1af2696a6f5db7f991d73a811b850f9cecd1de8d412496be09224/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6f7269636f64652f7061796d6179612d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloricode/paymaya-sdk-php)[![Tests](https://camo.githubusercontent.com/123b93a7cffd286dcb5916806522c9ff1d024ba1653d0fe16eee3bfbb2a59c8f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6c6f7269636f64652f7061796d6179612d73646b2d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/lloricode/paymaya-sdk-php/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/0f35bf06fa6ef0075fd7730320e2ec25e29175ad828c6bfb56d4b87b5948f26b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6f7269636f64652f7061796d6179612d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloricode/paymaya-sdk-php)[![codecov](https://camo.githubusercontent.com/9274ba49a328148c4cc7a55cdaa669f4a79cd48854305d113ebe4ee0dd3cf090/68747470733a2f2f636f6465636f762e696f2f67682f6c6c6f7269636f64652f7061796d6179612d73646b2d7068702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d5331494e434148565356)](https://app.codecov.io/gh/lloricode/paymaya-sdk-php/tree/main)

---

A modern and type-safe **PayMaya SDK for PHP**, built with [Saloon](https://docs.saloon.dev/) on top of Guzzle.
Provides an elegant API for working with **Checkout**, **Customizations**, and **Webhooks**.

---

Support us
----------

[](#support-us)

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/D1D71HJZD)
If you find this package helpful, consider supporting its development via Ko-fi or [PayPal](https://www.paypal.com/donate?hosted_button_id=V8PYXUNG6QP44).

---

Requirements
------------

[](#requirements)

- **PHP 8.3+**
- Composer

We always encourage using the **latest PHP versions** for better performance and security.
See [supported PHP versions](https://www.php.net/supported-versions.php) and [what's new](https://php.watch/versions).

---

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

[](#installation)

You can install the package via Composer:

```
composer require lloricode/paymaya-sdk-php
```

> **Upgrading from v2?** Check the [Upgrade Guide](UPGRADING.md).

---

Upgrading from v2 to v3
-----------------------

[](#upgrading-from-v2-to-v3)

We have introduced **breaking changes** in v3, including:

- PHP 8.3 requirement
- Switch to [Saloon](https://docs.saloon.dev/) for HTTP requests
- DTOs and Enums for better type safety
- Unified `PaymayaConnector` instead of multiple clients

➡ **See full details in the [Upgrade Guide](UPGRADING.md).**

---

Laravel Integration
-------------------

[](#laravel-integration)

If you're using **Laravel**, we recommend installing the official Laravel package for a seamless experience:

```
composer require lloricode/laravel-maya-sdk
```

This package provides:

- **Service Provider &amp; Facade** for easy access
- **Configuration file** for managing API keys and environment
- **Laravel-specific helpers** for better developer experience

📘 Learn more here: [Laravel Maya SDK](https://github.com/lloricode/laravel-maya-sdk)

---

Usage
-----

[](#usage)

Below are common usage examples.
Refer to [PayMaya API Docs](https://developers.maya.ph/reference) for full details.

---

### Checkout

[](#checkout)

```
use Lloricode\Paymaya\DataTransferObjects\Checkout\Amount\AmountDetailDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\Amount\AmountDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\Buyer\BillingAddressDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\Buyer\BuyerDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\Buyer\ContactDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\Buyer\ShippingAddressDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\CheckoutDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\ItemDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\MetaDataDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\RedirectUrlDto;
use Lloricode\Paymaya\DataTransferObjects\Checkout\TotalAmountDto;
use Lloricode\Paymaya\Enums\Environment;
use Lloricode\Paymaya\Paymaya;

$api = new Paymaya(
    environment: Environment::Sandbox,
    secretKey: 'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl',
    publicKey: 'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah',
);

$checkout = new CheckoutDto(
    totalAmount: new TotalAmountDto(
        value: 100,
        details: new AmountDetailDto(
            subtotal: 100
        )
    ),
    buyer: new BuyerDto(
        firstName: 'John',
        middleName: 'Paul',
        lastName: 'Doe',
        birthday: '1995-10-24',
        customerSince: '1995-10-24',
        gender: 'M',
        contact: new ContactDto(
            phone: '+639181008888',
            email: 'merchant@merchantsite.com'
        ),
        shippingAddress: new ShippingAddressDto(
            firstName: 'John',
            middleName: 'Paul',
            lastName: 'Doe',
            phone: '+639181008888',
            email: 'merchant@merchantsite.com',
            line1: '6F Launchpad',
            line2: 'Reliance Street',
            city: 'Mandaluyong City',
            state: 'Metro Manila',
            zipCode: '1552',
            countryCode: 'PH',
            shippingType: 'ST'
        ),
        billingAddress: new BillingAddressDto(
            line1: '6F Launchpad',
            line2: 'Reliance Street',
            city: 'Mandaluyong City',
            state: 'Metro Manila',
            zipCode: '1552',
            countryCode: 'PH'
        )
    ),
    items: [
        new ItemDto(
            name: 'Canvas Slip Ons',
            quantity: 1,
            code: 'CVG-096732',
            description: 'Shoes',
            amount: new AmountDto(
                value: 100,
                details: new AmountDetailDto(
                    discount: 0,
                    serviceCharge: 0,
                    shippingFee: 0,
                    tax: 0,
                    subtotal: 100
                )
            ),
            totalAmount: new AmountDto(
                value: 100,
                details: new AmountDetailDto(
                    discount: 0,
                    serviceCharge: 0,
                    shippingFee: 0,
                    tax: 0,
                    subtotal: 100
                )
            )
        ),
    ],
    redirectUrl: new RedirectUrlDto(
        success: 'https://www.merchantsite.com/success',
        failure: 'https://www.merchantsite.com/failure',
        cancel: 'https://www.merchantsite.com/cancel'
    ),
    requestReferenceNumber: '1551191039',
    metadata: new MetaDataDto(
        smi: 'smi',
        smn: 'smn',
        mci: 'mci',
        mpc: 'mpc',
        mco: 'mco',
        mst: 'mst'
    )
);

// submit
$checkoutResponse = $api->createCheckout($checkout);

echo 'id: '.$checkoutResponse->checkoutId."\n";
echo 'url: '.$checkoutResponse->redirectUrl."\n";

// retrieve
$checkoutDto = $api->getCheckout($checkoutResponse->checkoutId);
```

### Customization

[](#customization)

```
use Lloricode\Paymaya\DataTransferObjects\Checkout\Customization\CustomizationDto;
use Lloricode\Paymaya\Enums\Environment;
use Lloricode\Paymaya\Paymaya;

$api = new Paymaya(
    environment: Environment::Sandbox,
    secretKey: 'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl',
    publicKey: 'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah',
);

// register (readonly DTO via constructor)
$api->createCustomization(
    new CustomizationDto(
        logoUrl: 'https://image-logo.png',
        iconUrl: 'https://image-icon.png',
        appleTouchIconUrl: 'https://image-apple.png',
        customTitle: 'Test Title Mock',
        colorScheme: '#e01c44',
    )
);

// retrieve
$customizationDto = $api->customizations();

// delete
$api->deleteCustomization();
```

### Webhook

[](#webhook)

#### Checkout Webhook

[](#checkout-webhook)

```
use Lloricode\Paymaya\DataTransferObjects\Webhook\WebhookDto;
use Lloricode\Paymaya\Enums\Environment;
use Lloricode\Paymaya\Enums\Webhook;
use Lloricode\Paymaya\Paymaya;

$api = new Paymaya(
    environment: Environment::Sandbox,
    secretKey: 'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl',
    publicKey: 'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah',
);

// retrieve
/** @var array $webhooks */
$webhooks = $api->webhooks();

// delete all
foreach ($webhooks as $webhook) {
    $api->deleteWebhook($webhook->id);
}

// register (readonly DTOs via constructors)
$createdWebhookDto = $api->createWebhook(
    new WebhookDto(
        name: Webhook::CHECKOUT_SUCCESS,
        callbackUrl: 'https://web.test/test/success'
    )
);

// update (create a new readonly DTO with the existing id and new callback URL)
$existing = $webhooks[Webhook::CHECKOUT_SUCCESS];
$updatingDto = new WebhookDto(
    id: $existing->id,
    name: $existing->name,
    callbackUrl: 'https://web.test/test/update-success'
);

$webhookDto = $api->updateWebhooks($updatingDto);
```

---

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG](CHANGELOG.md) for details.

---

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for guidelines.

---

Security
--------

[](#security)

Please review [our security policy](../../security/policy) for details.

---

Credits
-------

[](#credits)

- [Lloric Mayuga Garcia](https://github.com/lloricode)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance75

Regular maintenance activity

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.9% 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 ~59 days

Recently: every ~50 days

Total

31

Last Release

251d ago

Major Versions

v0.5.0-alpha4 → v1.0.02023-02-15

v1.0.2 → v2.0.0-alpha2023-02-17

v2.0.1 → v3.0.02025-08-25

PHP version history (5 changes)v0.0.1PHP ^7.4

v0.2.0PHP ^7.4|^8.0

v0.5.0-alphaPHP ^8.0

v2.0.1PHP ^8.2

v3.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cdb70b3c1af4426f87d055490f2337dae57cb3bd884b013c5c068f8ee24fab1?d=identicon)[lloricode](/maintainers/lloricode)

---

Top Contributors

[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (313 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (15 commits)")

---

Tags

hacktoberfestmayapaymayaphpsdkphpsdkMayalloricodepaymayahacktoberfest

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lloricode-paymaya-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/lloricode-paymaya-sdk-php/health.svg)](https://phpackages.com/packages/lloricode-paymaya-sdk-php)
```

###  Alternatives

[helgesverre/milvus

PHP Client for the Milvus Rest API

306.2k](/packages/helgesverre-milvus)

PHPackages © 2026

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