PHPackages                             iss/laravel-maya-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. [API Development](/categories/api)
4. /
5. iss/laravel-maya-sdk

ActiveLibrary[API Development](/categories/api)

iss/laravel-maya-sdk
====================

Laravel Package for Maya SDK

v1.0.1(2y ago)111MITPHP

Since Aug 14Pushed 2y agoCompare

[ Source](https://github.com/innovativesprout/laravel-maya-sdk)[ Packagist](https://packagist.org/packages/iss/laravel-maya-sdk)[ RSS](/packages/iss-laravel-maya-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

 [ ![Logo](https://github.com/innovativesprout/laravel-maya-sdk/raw/main/MayaLaravelPackage.png) ](https://github.com/innovativesprout/laravel-maya-sdk)

### Laravel Maya SDK

[](#laravel-maya-sdk)

 Laravel Package that will handle the Maya Payments / Checkout and other Maya API

 [Request Feature](https://github.com/innovativesprout/laravel-maya-sdk/issues)

[![Downloads](https://camo.githubusercontent.com/e80dcd2032540394eb78e49253e812f327c4d3bed33942b2e8030f8d9a257b28/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b2f746f74616c)](https://camo.githubusercontent.com/e80dcd2032540394eb78e49253e812f327c4d3bed33942b2e8030f8d9a257b28/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b2f746f74616c) [![Contributors](https://camo.githubusercontent.com/1f0e632116a8e27ae6ea63298f04cfec940dfc119cdfa20da5f529a40996a985/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b3f636f6c6f723d6461726b2d677265656e)](https://camo.githubusercontent.com/1f0e632116a8e27ae6ea63298f04cfec940dfc119cdfa20da5f529a40996a985/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b3f636f6c6f723d6461726b2d677265656e) [![Issues](https://camo.githubusercontent.com/4c93cd28c50dbe23fb3071062136816375a629f0a0f8d4d8869b08cc0adab84e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b)](https://camo.githubusercontent.com/4c93cd28c50dbe23fb3071062136816375a629f0a0f8d4d8869b08cc0adab84e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696e6e6f7661746976657370726f75742f6c61726176656c2d6d6179612d73646b) [![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/innovativesprout/laravel-maya-sdk/blob/main/LICENSE.md) [![Laravel](https://github.com/innovativesprout/laravel-maya-sdk/actions/workflows/laravel.yml/badge.svg)](https://github.com/innovativesprout/laravel-maya-sdk/actions/workflows/laravel.yml)

Table Of Contents
-----------------

[](#table-of-contents)

- [What It Does](#what-it-does)
- [Getting Started](#getting-started)
    - [Installation](#installation)
- [Usage](#usage)
    - [Adding An Item](#adding-an-item)
    - [Customer Shipping](#customer-shipping-address)
    - [Customer Billing](#customer-billing-address)
    - [Buyer Details](#buyers-details)
    - [Redirect URLs](#redirect-urls)
    - [Checkout](#checkout)
    - [Webhook Management](#webhooks-management)
        - [Get All Webhook](#get-all-webhooks)
        - [Create New Webhook](#create-new-webhook)
        - [Get Webhook](#get-webhook)
        - [Update Webhook](#update-webhook)
        - [Delete Webhook](#delete-webhook)
    - [Customizations](#customizations)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
    - [Etiquette](#etiquette)
    - [Viability](#viability)
    - [Procedure](#procedure)
- [Credits](#credits)
- [License](#license)

What It Does
------------

[](#what-it-does)

This package allows you manage your customer checkouts, webhooks, and other payments using Maya API.

#### Supported Features:

[](#supported-features)

- Checkout
- Wallet
    - Create Single Payment
- Webhooks
- Customizations

#### Next Release:

[](#next-release)

- Payment Transactions
- Card Payment Vault
- Wallet
- QR

Getting Started
---------------

[](#getting-started)

This is how you can install or use the library.

### Installation

[](#installation)

1. Install Maya Payment to your Laravel Application

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

2. Publish the configuration

```
  php artisan vendor:publish --tag=maya
```

3. In your `config/maya.php`, add your `public_key` and `private_key` from your PayMaya account.

#### config/maya.php

[](#configmayaphp)

```
return [
    "public_key" => env('MAYA_PUBLIC_KEY', ""),
    "private_key" => env('MAYA_PRIVATE_KEY', ""),

   // other configurations...
];
```

Usage
-----

[](#usage)

Integrate to your Laravel Application.

### Adding an Item

[](#adding-an-item)

```
use Iss\LaravelMayaSdk\Facades\Maya;

$itemService = Maya::item();
$itemService->addItem([
    "amount" => [
        "value" => 1200
    ],
    "totalAmount" => [
        "value" => 1200
    ],
    "name" => "Shoes",
    "code" => "SHOE-1",
    "description" => "Nike Shoes",
    "quantity" => "1"
]);
```

### Calculating the total amount, discounts, shipping fee and other charges

[](#calculating-the-total-amount-discounts-shipping-fee-and-other-charges)

```
use Iss\LaravelMayaSdk\Facades\Maya;
```

You need to pass the `Maya::item()->getItems()` to calculate the total amount.

```
$itemService = Maya::item();
$totalAmountService = Maya::totalAmount();

$totalAmountService->setItems($itemService->getItems());
$totalAmountService->setDiscount("0.05");
$totalAmountService->setCurrency("PHP");
$totalAmountService->setServiceCharge("100");
$totalAmountService->setShippingFee("250");
$totalAmountService->setTax("100");
```

or

```
$totalAmountService = Maya::totalAmount();

$totalAmountService->setItems(Maya::item()->getItems());
$totalAmountService->setDiscount("0.05");
$totalAmountService->setCurrency("PHP");
$totalAmountService->setServiceCharge("100");
$totalAmountService->setShippingFee("250");
$totalAmountService->setTax("100");
```

To get the totalAmount object you can call the `get()` method:

```
return $totalAmountService->get();
```

Result:

```
[
    "currency" => "PHP",
    "value" => 1649.95, // float
    "details" => [
        "discount" => "0.05",
        "serviceCharge" => "100",
        "shippingFee" => "250",
        "tax" => "100",
        "subtotal" => "1200"
    ]
];
```

### Customer Shipping Address

[](#customer-shipping-address)

```
use Iss\LaravelMayaSdk\Facades\Maya;

$shippingService = Maya::shippingAddress();
$shippingService->setFirstName('Test First Name')
    ->setLastName('Test Last Name')
    ->setPhone('+63912345678')
    ->setEmail('client@innovativesprout.com')
    ->setCity('Test City')
    ->setLine1('Test Line 1')
    ->setLine2('Test Line 2')
    ->setState('Test State')
    ->setZipCode("2222")
    ->setCountryCode("PH");
```

### Customer Billing Address

[](#customer-billing-address)

```
use Iss\LaravelMayaSdk\Facades\Maya;

$billingService = Maya::billingAddress();
$billingService->setLine1('Test Line 1');
$billingService->setLine2('Test Line  2');
$billingService->setCity('Test City');
$billingService->setState('Test State');
$billingService->setZipCode("2222");
$billingService->setCountryCode("PH");
```

### Buyer's Details

[](#buyers-details)

```
use Iss\LaravelMayaSdk\Facades\Maya;

$buyerService = Maya::buyer();
$buyerService->setFirstName('Jerson')
    ->setLastName('Ramos')
    ->setEmail('jerson@innovativesprout.com')
    ->setPhone('+639052537600');
```

To add shipping / billing address to the buyer, you can use this:

#### For shipping address:

[](#for-shipping-address)

```
$buyerService->setShippingAddress(Maya::shippingAddress()->get());
```

#### For billing address:

[](#for-billing-address)

```
$buyerService->setBillingAddress(Maya::billingAddress()->get());
```

### Redirect URLs

[](#redirect-urls)

You can use route name from your `web.php` or `api.php` file or use static URL with parameters.

The `$custom_uuid` is from your order's table or any reference ID from your application.

```
use Iss\LaravelMayaSdk\Facades\Maya;

$redirectService = Maya::redirect();
$redirectService->setCancel(route('checkout.cancel') . '?id=' . $custom_uuid);
$redirectService->setFailure(route('checkout.failure') . '?id=' . $custom_uuid);
$redirectService->setSuccess(route('checkout.success') . '?id=' . $custom_uuid);
```

### Checkout

[](#checkout)

Build body request for your checkout based on our created objects above.

```
$parameters = [
    "totalAmount" => Maya::totalAmount()->get(),
    "items" => Maya::item()->getItems(),
    "buyer" => Maya::buyer()->get(),
    "redirectUrl" => Maya::redirect()->getRedirectUrls(),
    "requestReferenceNumber" => $custom_uuid
];

$checkoutService = Maya::checkout();
return $checkoutService->checkout($parameters);
```

#### Array Response from Maya Checkout Request:

[](#array-response-from-maya-checkout-request)

```
[
  "data" => [
    'checkoutId' => '',
    'redirectUrl' => ''
  ],
  "code" => 200,
  "message" => "success",
]
```

Webhooks Management
-------------------

[](#webhooks-management)

Use the `MayaWebhook` by injecting the facade to your application and to be able to manage your webhooks.

```
use Iss\LaravelMayaSdk\Facades\Maya;
```

### Get All Webhooks

[](#get-all-webhooks)

```
return Maya::webhook()->get();
```

#### Response:

[](#response)

```
[
  "data" => [
    {
        "id": "7549dd53-38fb-49b9-9ad8-af6223937e92",
        "name": "PAYMENT_FAILED",
        "callbackUrl": "https://store-philippines.worldcup.basketball?wc-api=cynder_paymaya_payment",
        "createdAt": "2023-04-24T06:57:35.000Z",
        "updatedAt": "2023-04-24T06:57:35.000Z"
    },
    {
        "id": "e63c832b-e9dc-426e-831f-6756bbd33bbc",
        "name": "PAYMENT_EXPIRED",
        "callbackUrl": "https://store-philippines.worldcup.basketball?wc-api=cynder_paymaya_payment",
        "createdAt": "2023-04-24T06:57:30.000Z",
        "updatedAt": "2023-04-24T06:57:30.000Z"
    }
],
  "code" => 200,
  "message" => "success",
]
```

### Create New Webhook

[](#create-new-webhook)

The supported events that you can pass through `for` method are the following:

`AUTHORIZED`,`PAYMENT_SUCCESS`,`PAYMENT_FAILED`,`PAYMENT_EXPIRED`,`PAYMENT_CANCELLED`,`3DS_PAYMENT_SUCCESS`,`3DS_PAYMENT_FAILURE`,`3DS_PAYMENT_DROPOUT`,`RECURRING_PAYMENT_SUCCESS`,`RECURRING_PAYMENT_FAILURE`,`CHECKOUT_SUCCESS`,`CHECKOUT_FAILURE`,`CHECKOUT_DROPOUT`,`CHECKOUT_CANCELLED`

Pass the `URL` parameter on `create()` method.

```
return Maya::webhook()->for("PAYMENT_SUCCESS")->create('http://www.merchantsite.com/success');
```

#### Response:

[](#response-1)

```
[
  "data" => [
    "id" => "98397531-e6cd-4c5c-ba6c-089546098989",
    "name" => "PAYMENT_SUCCESS",
    "callbackUrl" => "http://www.merchantsite.com/success",
    "createdAt" => "2023-05-07T05:28:27.000Z",
    "updatedAt" => "2023-05-07T05:28:27.000Z"
  ],
  "code" => 200,
  "message" => "success",
]
```

### Get Webhook

[](#get-webhook)

Pass the ID of the webhook

```
return Maya::webhook()->getById('98397531-e6cd-4c5c-ba6c-089546098989');
```

#### Response:

[](#response-2)

```
[
  "data" => [
    "id" => "98397531-e6cd-4c5c-ba6c-089546098989",
    "name" => "PAYMENT_SUCCESS",
    "callbackUrl" => "http://www.merchantsite.com/success",
    "createdAt" => "2023-05-07T05:28:27.000Z",
    "updatedAt" => "2023-05-07T05:28:27.000Z"
  ],
  "code" => 200,
  "message" => "success",
]
```

### Update Webhook

[](#update-webhook)

Pass the ID of the webhook that you want update and the new `URL`. The `first` parameter will be the ID of the webhook and the `second` parameter will be the new `URL`.

```
return Maya::webhook()->update('98397531-e6cd-4c5c-ba6c-089546098989', 'http://www.merchantsite.com/success');
```

#### Response:

[](#response-3)

```
[
  "data" => [
    "id" => "98397531-e6cd-4c5c-ba6c-089546098989",
    "name" => "PAYMENT_SUCCESS",
    "callbackUrl" => "http://www.merchantsite.com/success",
    "createdAt" => "2023-05-07T05:28:27.000Z",
    "updatedAt" => "2023-05-07T05:28:27.000Z"
  ],
  "code" => 200,
  "message" => "success",
]
```

### Delete Webhook

[](#delete-webhook)

Pass the ID of the webhook that you want to delete.

```
return Maya::webhook()->delete('98397531-e6cd-4c5c-ba6c-089546098989');
```

#### Response:

[](#response-4)

```
[
  "data" => [
    "id" => "98397531-e6cd-4c5c-ba6c-089546098989",
    "name" => "PAYMENT_SUCCESS",
    "callbackUrl" => "http://www.merchantsite.com/success",
    "createdAt" => "2023-05-07T05:28:27.000Z",
    "updatedAt" => "2023-05-07T05:28:27.000Z"
  ],
  "code" => 200,
  "message" => "success",
]
```

Customizations
--------------

[](#customizations)

Use the `MayaCustomization` by injecting the facade to your application.

```
use Iss\LaravelMayaSdk\Facades\Maya;
```

### Set Customization

[](#set-customization)

Set your `LogoUrl`, `IconUrl`, `AppleTouchIconUrl`, `CustomTitle` and `ColorScheme`. These are the required fields.

#### Helper functions:

[](#helper-functions)

- `hideReceipt()` or `showReceipt()` - Indicates if the merchant does not allow its payers to freely send transaction receipts.
- `skipResultPage()` or `doNotSkipResultPage()` - Indicates if the merchant does not want to show the payment result page. When skipped, the payment page redirects immediately to the merchant's redirect URL.
- `showMerchantName()` or `hideMerchantName()` - Indicates if the merchant name on the result page is displayed.

```
return Maya::customization()->setLogoUrl("https://www.merchantsite.com/icon-store.b575c975.svg")
        ->setIconUrl("https://www.merchantsite.com/favicon.ico")
        ->setAppleTouchIconUrl("https://www.merchantsite.com/touch-icon-ipad-retina.png")
        ->setCustomTitle("Merchant Store")
        ->setColorScheme("#85c133")
        ->showReceipt()
        ->skipResultPage()
        ->showMerchantName()
        ->setRedirectTimer(10)
        ->set();
```

#### Response:

[](#response-5)

```
[
  "data" => [
    "logoUrl" => "https://www.merchantsite.com/icon-store.b575c975.svg",
    "iconUrl" => "https://www.merchantsite.com/favicon.ico",
    "appleTouchIconUrl" => "https://www.merchantsite.com/touch-icon-ipad-retina.png",
    "customTitle" => "Merchant Store",
    "colorScheme" => "#85c133",
    "redirectTimer" => 10,
    "hideReceiptInput" => false,
    "skipResultPage" => true,
    "showMerchantName" => true
],
  "code" => 200,
  "message" => "success",
]
```

### Get Customization

[](#get-customization)

```
return Maya::customization()->get();
```

#### Response:

[](#response-6)

```
[
  "data" => [
    "logoUrl" => "https://www.merchantsite.com/icon-store.b575c975.svg",
    "iconUrl" => "https://www.merchantsite.com/favicon.ico",
    "appleTouchIconUrl" => "https://www.merchantsite.com/touch-icon-ipad-retina.png",
    "customTitle" => "Merchant Store",
    "colorScheme" => "#85c133",
    "redirectTimer" => 10,
    "hideReceiptInput" => false,
    "skipResultPage" => true,
    "showMerchantName" => true
],
  "code" => 200,
  "message" => "success",
]
```

### Delete Customization

[](#delete-customization)

```
return Maya::customization()->delete();
```

#### Response:

[](#response-7)

```
// Blank Response
```

Roadmap
-------

[](#roadmap)

See the [open issues](https://github.com/innovativesprout/laravel-maya-sdk/issues) for a list of proposed features (and known issues).

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

[](#contributing)

Contributions are welcome and will be fully credited.

Please read and understand the contribution guide before creating an issue or pull request.

### Etiquette

[](#etiquette)

This project is open source, and as such, the maintainers give their free time to build and maintain the source code held within. They make the code freely available in the hope that it will be of use to other developers. It would be extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.

### Viability

[](#viability)

When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project.

### Procedure

[](#procedure)

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

Credits
-------

[](#credits)

- [Maya](https://developers.maya.ph/docs)
- [All Contributors](../../contributors)

License
-------

[](#license)

Distributed under the MIT License. See [LICENSE](https://github.com/innovativesprout/laravel-maya-sdk/blob/main/LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

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

Total

2

Last Release

1053d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50511287?v=4)[Neither](/maintainers/neither)[@neither](https://github.com/neither)

---

Top Contributors

[![jersonsramos](https://avatars.githubusercontent.com/u/44173253?v=4)](https://github.com/jersonsramos "jersonsramos (10 commits)")

### Embed Badge

![Health badge](/badges/iss-laravel-maya-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/iss-laravel-maya-sdk/health.svg)](https://phpackages.com/packages/iss-laravel-maya-sdk)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M973](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

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