Download the PHP package laraditz/razorpay without Composer
On this page you can find all versions of the php package laraditz/razorpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package razorpay
Laravel Curlec by Razorpay
A Laravel wrapper package for the Razorpay Curlec API. Built directly on Laravel's HTTP client, it provides a fluent facade for Payment Links, Orders, Payments, Refunds, and Settlements with database persistence and webhook-driven, event-based sync out of the box.
Features
- ๐ Payment Links โ create, fetch, update, cancel, list, resend notification
- ๐งพ Orders โ create, fetch, list, update, fetch payments for an order, plus Checkout payment-signature verification
- ๐ณ Payments โ fetch, capture, update, list โ synced locally from both the API response and the
payment.authorized/captured/failedwebhooks - ๐ธ Refunds โ create, fetch, list (account-wide and per-payment), update
- ๐ฆ Settlements โ fetch, list โ synced locally from both the API response and the
settlement.processedwebhook - ๐๏ธ Local database persistence for every resource (
RazorpayPaymentLink,RazorpayOrder,RazorpayPayment,RazorpayRefund,RazorpaySettlement), each apayment_id/razorpay_idjoin away from the others - ๐ API request/response logging โ every outbound call recorded, with customer PII redacted and configurable retention
- ๐ต๏ธ Webhook audit log โ every signature-valid inbound webhook recorded for later audit, separately from signature-failure diagnostics in your app's log channel
- ๐ Automatic webhook handling with HMAC-SHA256 signature verification
- ๐ Idempotent webhook sync โ local records stay correct even if Razorpay retries a delivery
- ๐ฏ Generic + typed events for every webhook-driven state change
- ๐ฆ Uses Laravel's HTTP client only โ no Guzzle, no vendor SDK
- ๐ก๏ธ Type-safe with PHP 8.2+ backed enums
- ๐ซ Package-owned exception hierarchy โ never leaks raw HTTP or vendor exceptions
Requirements
- PHP 8.2+ (Laravel 13.x itself requires PHP 8.3+)
- Laravel 10.x, 11.x, 12.x, or 13.x
Installation
Install the package via composer:
Publish the configuration and migrations:
Run the migrations:
Add your Razorpay credentials to .env:
Configuration
config/razorpay.php:
Usage
Every service is accessed through the Razorpay facade. Full method reference, parameters, and more examples for each are in Documentation section.
Payment Links
โ Full documentation
Orders
โ Full documentation
Payments
โ Full documentation
Refunds
โ Full documentation
Settlements
โ Full documentation
Querying local records
Every create() call (and, for Payments/Settlements, every fetch()/capture()/update()/all() call too) persists a local Eloquent record, kept in sync automatically as webhooks arrive โ no manual polling required:
Error Handling
Every non-2xx API response is caught and rethrown as a package-owned exception โ you never need to catch raw HTTP client exceptions:
Webhooks
A webhook route is registered automatically at POST /razorpay/webhook (configurable via RAZORPAY_WEBHOOK_PATH) โ never part of Laravel's web middleware group, so the X-Razorpay-Signature header is the sole authentication boundary. Point your Razorpay Dashboard's webhook URL at it and set RAZORPAY_WEBHOOK_SECRET.
Typed events fire for the events this package understands (PaymentLinkPaid, PaymentAuthorized, PaymentCaptured, PaymentFailed, OrderPaid, RefundCreated/Processed/Failed, SettlementProcessed), each keeping the matching local record in sync โ plus a generic RazorpayWebhookReceived event for every verified delivery, regardless of type.
โ Full documentation โ event reference, listener setup, idempotency notes
Logging
Outbound API calls and inbound webhook deliveries can each be optionally recorded for troubleshooting/audit, independently toggled and retained:
โ Full documentation
Documentation
For detailed documentation on each service, please refer to:
- Payment Links โ create, fetch, update, cancel, list, resend notification
- Orders โ create, fetch, list, update, fetch payments for an order, Checkout signature verification
- Payments โ fetch, capture, update, list
- Refunds โ full/partial refunds, account-wide and per-payment listing
- Settlements โ fetch, list, reconciliation
- Webhooks โ event reference, listener setup, idempotency
- Logging โ API request/response logging and webhook audit log
Testing
The test suite uses Http::fake()/Event::fake() throughout โ no real network access or live Razorpay credentials are required.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT).