Download the PHP package shinidev/paymongo-php without Composer
On this page you can find all versions of the php package shinidev/paymongo-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shinidev/paymongo-php
More information about shinidev/paymongo-php
Files in shinidev/paymongo-php
Package paymongo-php
Short Description A modernized, PHP 7.4+ compatible fork of the official PayMongo PHP library with improved security and reliability.
License MIT
Homepage https://github.com/shinidev/paymongo-php
Informations about the package paymongo-php
Modernized PayMongo PHP SDK
This project is a fork of the official PayMongo PHP SDK, modernized through a collaborative effort. The refactoring process was guided by shinidev and executed with the assistance of Google's Gemini AI to upgrade the codebase to modern PHP 7.4+ standards, improve security, and establish a robust testing foundation.
Key Improvements in This Version
- ✅ PHP 7.4+ Support: The entire codebase now uses modern PHP features, including strict typing.
- ✅ Critical Security Fixes: Webhook signature verification is now protected against timing attacks (
hash_equals) and replay attacks (timestamp verification). - ✅ Improved Developer Experience: All classes and methods are strictly typed, providing better static analysis and autocompletion in modern IDEs.
- ✅ Robust Error Handling: The exception hierarchy has been rebuilt to be more logical and provide detailed error feedback from the API.
- ✅ Testing Foundation: A comprehensive test suite has been established to guarantee the reliability and correctness of the SDK.
Requirements
- PHP >= 7.4
- cURL PHP Extension
- JSON PHP Extension
- Multibyte String (mbstring) PHP Extension
Installation
The only supported installation method is via Composer.
After installation, include Composer's autoloader in your project's startup script:
Manual Installation (
initialize.php) is no longer supported.
Usage
1. Initializing the Client
All interactions with the PayMongo API are done through the PaymongoClient object. You only need your secret API key to get started.
2. Creating a Resource
Access API services (like payments or links) as properties on the client object. The SDK automatically handles wrapping the payload in the required {"data": {"attributes": ...}} structure.
3. Retrieving Resources
4. Handling API Errors
The SDK throws specific exceptions for different types of errors. You can use a try...catch block to handle them gracefully.
5. Verifying Webhook Signatures
Verifying webhook signatures is critical for security. The constructEvent method provides a secure way to do this, including protection against replay attacks.
Official API Documentation
This SDK is a wrapper that provides convenient access to the PayMongo REST API. For comprehensive details on API endpoints, request parameters, response structures, and general API behavior, please always refer to the official PayMongo Developer Documentation.
Development and Testing
To run the test suite for this project:
- Clone the repository.
- Run
composer install. - Run the tests from the project root:
License
This project is a fork of the original paymongo/paymongo-php library, which is copyrighted by PayMongo, Inc. and licensed under the MIT license. Modifications and new work in this repository are copyrighted by shinidev (C) 2025 and are also released under the MIT License.
All versions of paymongo-php with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *