PHPackages                             paymongo/paymongo-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. [API Development](/categories/api)
4. /
5. paymongo/paymongo-php

ActiveLibrary[API Development](/categories/api)

paymongo/paymongo-php
=====================

PayMongo PHP Library

v0.0.0(3y ago)78.5k—8.1%9[1 PRs](https://github.com/paymongo/paymongo-php/pulls)MITPHPPHP &gt;=5.6.0

Since Nov 21Pushed 2y ago7 watchersCompare

[ Source](https://github.com/paymongo/paymongo-php)[ Packagist](https://packagist.org/packages/paymongo/paymongo-php)[ Docs](https://paymongo.com/)[ RSS](/packages/paymongo-paymongo-php/feed)WikiDiscussions development Synced 1mo ago

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

PayMongo PHP
============

[](#paymongo-php)

PayMongo PHP library provides PHP applications an easy access to the PayMongo API. Explore various classes that can represent API resources on object instantiation. The goal of this library is simplify PayMongo integration with any PHP applications.

Check [example.php](https://github.com/paymongo/paymongo-php/blob/development/example.php) see usage examples.

Pending Todos
-------------

[](#pending-todos)

- Unit Tests
- Code Cleanup and Improvements

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

[](#requirements)

PHP 5.6.0 and later.

Composer
--------

[](#composer)

You can install the library via [Composer](http://getcomposer.org/). Run the following command:

```
composer require paymongo/paymongo-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Manual Installation
-------------------

[](#manual-installation)

If you prefer to manually install the library instead of using composer, you can download the [latest release](https://github.com/paymongo/paymongo-php/releases). Then, to use the bindings, include the `initialize.php` file.

```
require_once('/path/to/paymongo-php/initialize.php');
```

Dependencies
------------

[](#dependencies)

The bindings require the following extensions in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php)
- [`json`](https://secure.php.net/manual/en/book.json.php)
- [`mbstring`](https://www.php.net/manual/en/book.mbstring.php)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that the required extensions are available.

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

[](#getting-started)

Simple usage looks like:

```
$client = new \Paymongo\PaymongoClient('sk_test_BQokikJOvBiI2HlWgH4b2fQ2');
$paymentIntent = $client->paymentIntents->create([
    'amount' => 10000,
    'currency' => 'PHP',
    'payment_method_allowed' => ['card']
]);

echo $paymentIntent->id;
```

Handle errors
-------------

[](#handle-errors)

```
try {
    $client = new \Paymongo\PaymongoClient('sk_test_BQokikJOvBiI2HlWgH4b2fQ2');
    $paymentIntent = $client->paymentIntents->create([
        'amount' => 10000,
        'currency' => 'PHP',
        'payment_method_allowed' => ['card']
    ]);
} catch(\Paymongo\Exceptions\InvalidRequestException $e) {
   print "";
   print_r($e->getError());
   print "";
}
```

Verifying webhook signature
---------------------------

[](#verifying-webhook-signature)

```
try {
    $payload = @file_get_contents('php://input');
    $signatureHeader = $_SERVER['HTTP_PAYMONGO_SIGNATURE'];
    $webhookSecretKey = 'your webhook secret key here';

    $event = $client->webhooks->constructEvent([
        'payload' => $payload,
        'signature_header' => $signatureHeader,
        'webhook_secret_key' => $webhookSecretKey
    ]);

    echo $event->id;
    echo $event->type;
    print "";
    print_r($event->resource);
    print "";
    die();

} catch (\Paymongo\Exceptions\SignatureVerificationException $e) {
    echo 'invalid signature';
}
```

To learn more about PayMongo's API, please check our developer [documentation](https://developers.paymongo.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

1275d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cade643378a6b498d470543f32ec0770733dcc3f0fc4e7a820d66adb5b24685b?d=identicon)[Paymongo-Devops](/maintainers/Paymongo-Devops)

---

Top Contributors

[![jaimehing](https://avatars.githubusercontent.com/u/6761602?v=4)](https://github.com/jaimehing "jaimehing (1 commits)")[![ronilo-penero](https://avatars.githubusercontent.com/u/104755830?v=4)](https://github.com/ronilo-penero "ronilo-penero (1 commits)")

---

Tags

apipayment processingpaymongo

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ebanx/ebanx

EBANX PHP library

24648.5k](/packages/ebanx-ebanx)[pay-now/paynow-php-sdk

PHP client library for accessing Paynow API

18193.9k2](/packages/pay-now-paynow-php-sdk)[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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