PHPackages                             kirame/laravel-paymongo - 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. kirame/laravel-paymongo

ActiveLibrary[Payment Processing](/categories/payments)

kirame/laravel-paymongo
=======================

Laravel package for PayMongo payment gateway integration

v1.0.1(3mo ago)09MITPHPPHP ^8.2

Since Feb 9Pushed 1mo agoCompare

[ Source](https://github.com/kirame09/laravel-paymongo)[ Packagist](https://packagist.org/packages/kirame/laravel-paymongo)[ RSS](/packages/kirame-laravel-paymongo/feed)WikiDiscussions main Synced 1mo ago

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

Laravel PayMongo
================

[](#laravel-paymongo)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c70d1ec9bc22567a2078260a902dbf66f76a5beee57245284dd0fe1148be4f5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6972616d652f6c61726176656c2d7061796d6f6e676f2e737667)](https://packagist.org/packages/kirame/laravel-paymongo)[![GitHub Tests](https://github.com/kirame09/laravel-paymongo/actions/workflows/tests.yml/badge.svg)](https://github.com/kirame09/laravel-paymongo/actions)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A Laravel package for integrating with the [PayMongo](https://paymongo.com) payment gateway API.

Supports all PayMongo payment methods including GCash, Maya, GrabPay, Card, and QR Ph.

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

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12

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

[](#installation)

```
composer require kirame/laravel-paymongo
```

Publish the config file:

```
php artisan vendor:publish --tag=paymongo-config
```

Add your keys to `.env`:

```
PAYMONGO_PUBLIC_KEY=pk_test_...
PAYMONGO_SECRET_KEY=sk_test_...
PAYMONGO_WEBHOOK_SECRET=whsec_...
PAYMONGO_ENVIRONMENT=sandbox
```

Usage
-----

[](#usage)

### Checkout Session

[](#checkout-session)

The simplest way to accept payments. Redirects the customer to a PayMongo-hosted checkout page.

```
use Kirame\PayMongo\PayMongo;

public function checkout(PayMongo $paymongo)
{
    $session = $paymongo->createCheckoutSession([
        'billing' => [
            'name' => 'Juan Dela Cruz',
            'email' => 'juan@example.com',
        ],
        'line_items' => [[
            'name' => 'Premium Plan',
            'amount' => 99900, // in centavos (₱999.00)
            'currency' => 'PHP',
            'quantity' => 1,
        ]],
        'payment_method_types' => ['gcash', 'card', 'grab_pay', 'paymaya'],
        'success_url' => 'https://example.com/success',
        'cancel_url' => 'https://example.com/cancel',
    ]);

    return redirect($session['attributes']['checkout_url']);
}
```

### QR Ph Payment (Payment Intent API)

[](#qr-ph-payment-payment-intent-api)

Displays an inline QR code scannable by any Philippine e-wallet or bank app.

```
use Kirame\PayMongo\PayMongo;

public function qrPayment(PayMongo $paymongo)
{
    // Step 1: Create Payment Intent
    $intent = $paymongo->createPaymentIntent([
        'amount' => 50000, // ₱500.00
        'currency' => 'PHP',
        'payment_method_allowed' => ['qrph'],
        'description' => 'Order #123',
    ]);

    // Step 2: Create Payment Method
    $method = $paymongo->createPaymentMethod([
        'type' => 'qrph',
        'billing' => ['name' => 'Juan Dela Cruz'],
    ]);

    // Step 3: Attach to get QR code
    $result = $paymongo->attachPaymentMethod(
        $intent['id'],
        $method['id'],
        $intent['attributes']['client_key']
    );

    $qrImage = $result['attributes']['next_action']['code']['image_url'];

    return view('payment.qr', ['qr_image' => $qrImage]);
}
```

### Webhooks

[](#webhooks)

Verify incoming PayMongo webhook signatures:

```
use Kirame\PayMongo\WebhookVerifier;

public function handleWebhook(Request $request, WebhookVerifier $verifier)
{
    $payload = $request->getContent();
    $signature = $request->header('Paymongo-Signature');

    try {
        $event = $verifier->verify(
            $payload,
            $signature,
            config('paymongo.webhook_secret'),
            config('paymongo.environment')
        );
    } catch (\Exception $e) {
        return response('OK', 200); // Always return 200 to avoid webhook disabling
    }

    $eventType = $event->data->attributes->type;

    switch ($eventType) {
        case 'checkout_session.payment.paid':
            // Handle successful payment
            break;
        case 'payment.paid':
            // Handle direct payment (QR Ph, etc.)
            break;
        case 'payment.failed':
            // Handle failed payment
            break;
    }

    return response('OK', 200);
}
```

### Customers

[](#customers)

```
$customer = $paymongo->createCustomer([
    'first_name' => 'Juan',
    'last_name' => 'Dela Cruz',
    'email' => 'juan@example.com',
    'phone' => '+639171234567',
]);

$customer = $paymongo->getCustomer('cust_...');
```

### Subscriptions

[](#subscriptions)

```
// Create a plan
$plan = $paymongo->createPlan([
    'name' => 'Pro Plan',
    'amount' => 99900,
    'currency' => 'PHP',
    'interval' => 'month',
    'interval_count' => 1,
]);

// Create a subscription
$subscription = $paymongo->createSubscription([
    'customer_id' => 'cust_...',
    'plan_id' => $plan['id'],
]);

// Cancel
$paymongo->cancelSubscription('sub_...');
```

### Refunds

[](#refunds)

```
$refund = $paymongo->createRefund('pay_...', 50000, 'requested_by_customer');
```

### Retrieve Resources

[](#retrieve-resources)

```
$session = $paymongo->retrieveCheckoutSession('cs_...');
$intent = $paymongo->retrievePaymentIntent('pi_...');
$payment = $paymongo->retrievePayment('pay_...');
```

### Facade

[](#facade)

You can also use the facade:

```
use Kirame\PayMongo\Facades\PayMongo;

$session = PayMongo::createCheckoutSession([...]);
```

API Reference
-------------

[](#api-reference)

### PayMongo Client

[](#paymongo-client)

MethodDescription`createCustomer(array $attributes)`Create a customer`getCustomer(string $id)`Retrieve a customer`createPaymentIntent(array $attributes)`Create a payment intent`retrievePaymentIntent(string $id)`Retrieve a payment intent`createPaymentMethod(array $attributes)`Create a payment method`attachPaymentMethod(string $intentId, string $methodId, ?string $clientKey)`Attach payment method to intent`createCheckoutSession(array $attributes)`Create a checkout session`retrieveCheckoutSession(string $id)`Retrieve a checkout session`retrievePayment(string $id)`Retrieve a payment`createRefund(string $paymentId, int $amount, string $reason)`Create a refund`createPlan(array $attributes)`Create a subscription plan`createSubscription(array $attributes)`Create a subscription`cancelSubscription(string $id)`Cancel a subscription`updateSubscriptionPlan(string $id, string $planId)`Change subscription plan`getSubscription(string $id)`Retrieve a subscription`changePaymentMethod(string $subscriptionId, string $paymentMethodId)`Update payment method`payInvoice(string $invoiceId)`Pay an invoice`listWebhooks()`List all webhooks`createWebhook(string $url, array $events)`Create a webhook`enableWebhook(string $id)`Enable a webhook`disableWebhook(string $id)`Disable a webhook### WebhookVerifier

[](#webhookverifier)

MethodDescription`verify(string $payload, string $signature, string $secret, string $environment)`Verify signature and return parsed event (throws on failure)`isValid(string $payload, string $signature, string $secret, string $environment)`Check if signature is valid (returns boolean)Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/705d72a6a1a3eac55fc2ad378f3da6941133f660722b1e2a3707b686d4083b49?d=identicon)[kirame09](/maintainers/kirame09)

---

Top Contributors

[![kirame09](https://avatars.githubusercontent.com/u/13214437?v=4)](https://github.com/kirame09 "kirame09 (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kirame-laravel-paymongo/health.svg)

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

###  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)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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