luigel / laravel-paymongo
A laravel wrapper for Paymongo API
v3.0.1
2026-09-26 05:35 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.13
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-type-coverage: ^3.0|^4.0
- phpmd/phpmd: ^2.15
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-26 05:41:45 UTC
README
A Laravel client for the PayMongo API. Typed responses, first-class webhooks, built-in testing fakes.
This package is not affiliated with PayMongo.
- Full documentation: https://paymongo.rigelkentcarbonel.com/docs
- Upgrading from 2.x? Read the upgrade guide.
Requirements
- PHP 8.2 or newer (Laravel 13 itself requires PHP 8.3+)
- Laravel 11, 12, or 13
Installation
composer require luigel/laravel-paymongo:^3.0
Add your keys to .env (grab them from the PayMongo dashboard):
PAYMONGO_SECRET_KEY=sk_test_... PAYMONGO_PUBLIC_KEY=pk_test_... # The endpoint secret_key returned when you register a webhook. PAYMONGO_WEBHOOK_SECRET=whsk_...
Optionally publish the config file to config/paymongo.php:
php artisan vendor:publish --tag=paymongo-config
Example
use Luigel\Paymongo\Enums\PaymentIntentStatus; use Luigel\Paymongo\Facades\Paymongo; // 1. Create the intent. Amounts are integer centavos: 150050 = PHP 1,500.50. $intent = Paymongo::paymentIntents()->create([ 'amount' => 150050, 'currency' => 'PHP', 'payment_method_allowed' => ['card'], 'description' => 'Order #1234', ]); // 2. Create a payment method (normally done client-side with your public key). $method = Paymongo::paymentMethods()->create([ 'type' => 'card', 'details' => [ 'card_number' => '4343434343434345', 'exp_month' => 12, 'exp_year' => 34, 'cvc' => '123', ], ]); // 3. Attach it to the intent to trigger the payment. $intent = Paymongo::paymentIntents()->attach($intent->id, $method->id); if ($intent->status === PaymentIntentStatus::Succeeded) { // Paid. $intent->payments holds the resulting Payment resources. }
Documentation
Guides for every flow (Checkout Sessions, Payment Intents, Payment Links, QR Ph, refunds, subscriptions), webhooks, testing with Paymongo::fake(), and the full reference live at https://paymongo.rigelkentcarbonel.com/docs.
License
The MIT License (MIT). Please see License File for more information.