Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Sdk V2 Laravel Package

mangopay/php-sdk-v2

Mangopay PHP SDK is a client library for the Mangopay REST API, letting PHP developers integrate payment flows, wallets, and transactions. Requires PHP 5.6+, cURL, OpenSSL, and psr/log; installable via Composer.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Php Sdk V2
How do I install mangopay/php-sdk-v2 in a Laravel application?
Install the SDK with Composer using the package name shown on Packagist, mangopay/php-sdk-v2. Some README badges and older examples still reference mangopay4/php-sdk, so confirm the current name for your version. After installation, create your own Laravel service provider binding to configure credentials and expose the API client to the container.
Is mangopay/php-sdk-v2 compatible with Laravel 10 and Laravel 11?
The SDK is framework-agnostic but installs via Composer and uses PSR-4 autoloading plus PSR-3 logging, so it integrates with modern Laravel versions as long as your PHP version satisfies both Laravel and the SDK. There is no official Laravel package or service provider, so you register your own singleton binding and configuration. Laravel's container and Monolog work cleanly with the SDK's logging interface.
How should I bind the Mangopay API client in Laravel's service container?
Register a singleton in AppServiceProvider that instantiates MangoPayApi and sets Config->ClientId, Config->ClientSecret, Config->BaseUrl, and Config->TemporaryFolder from config/services.php. Keep credentials in .env and resolve the client through the container in your services or jobs. Because the client holds configuration state, avoid mutating a shared instance at runtime and rehydrate configuration in long-running queue workers.
What PHP version and extensions does the Mangopay PHP SDK require?
The SDK's stated minimum is PHP 5.6 with cURL, OpenSSL, and psr/log, but current Laravel versions already require newer PHP releases. For mTLS with Base64-encoded certificates, plan on PHP 8.1 or newer and cURL 7.71.0 or newer as noted in the technical assessment. Otherwise the SDK falls back to filesystem certificate files, which adds secrets-management overhead.
How do I handle Mangopay webhooks and new event types in Laravel?
Mangopay sends event types as constants on EventType, and v5.1.0 adds eight extended-preauthorization event types plus ten settlement event types. Your Laravel webhook controller should verify the payload, map known constants, and gracefully log or ignore unknown values instead of returning a 500. Store raw payloads for replay and keep webhook handlers idempotent because retries are normal.
What are extended preauthorizations and why do SDK methods return different classes?
Extended preauthorizations mirror the existing deposits API and support a full-capture PayIn flow through ApiPayIns::CreatePayInExtendedPreauthorized(). Get(), Update(), and GetAllForUser() can return either PayPalExtendedPreauthorization or ExtendedPreauthorization depending on how the record was created, so check with instanceof or map to your own DTO before reading fields. Use ExtendedPreauthorizationStatus for enum casts where possible.
Are Mangopay deposits deprecated in v5.1.0?
Yes, ApiDeposits, DepositStatus, Transaction::$DepositId, and ApiPayIns::CreatePayInDepositPreauthorizedWithoutComplement() still work in v5.1.0 but are marked for removal in a future major version. Treat this as a scheduled migration rather than an emergency, and avoid adding new deposit_id persistence or reports. If you run deposits and extended preauthorizations side by side, gate the cutover with a configuration flag per environment.
How do I test Mangopay payment flows in a Laravel test suite?
Wrap SDK calls in your own service or repository so you can mock them in Laravel tests, because the SDK uses cURL directly and Laravel's Http::fake() will not intercept it. Use Mangopay sandbox credentials for integration tests and fixture payloads for webhook consumers. Assert both standard and PayPal preauthorization branches because the polymorphic return is easy to miss and may only fail on PayPal traffic.
How do I configure mTLS certificates and the temporary token folder in Laravel?
Set Config->TemporaryFolder to a private, writable path outside the public directory and ensure it is gitignored with restrictive permissions. For Base64-encoded certificate support you need PHP 8.1 or newer and cURL 7.71.0 or newer; otherwise the SDK uses filesystem certificate files and you must manage those secrets carefully. In containerized deployments, ensure the temporary folder is writable and consider warming token files during deployment.
What are alternatives to the official Mangopay PHP SDK for Laravel?
Alternatives include calling the Mangopay REST API directly with Laravel's HTTP client, using a generic HTTP wrapper such as Saloon, or building a thin repository layer around the official SDK. The official SDK remains the safest choice for API coverage, enums, and event constants, while direct HTTP gives you more control over transport, retries, and testing. Many teams combine both: the SDK for domain calls and Laravel's HTTP client for custom endpoints.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator