:moneybag: Razorpay libray for Laravel framework
Razorpay officail documentation
Razorpay php library
What it is
Version
1.0.5
Compatibility
Laravel version | Razorpay version |
---|---|
5.5 | 1.0.5 |
5.4 <= | 1.0.5 |
Note: This package is completely relays on razorpay-php library, refer here
Installation
composer require lakshmaji/razorpay
NOTE : This package service providers will be automatically registered with Laravel (uses package auto discovery feature )
For applications which uses below 5.5, it is required to add the service providers and aliases to configuration file.
Lakshmaji\Razorpay\RazorpayServiceProvider::class,
'Razorpay' => Lakshmaji\Razorpay\Facade\Razorpay::class,
composer update
Configurations
php artisan vendor:publish
#Razorpay configurations
RAZORPAY_KEY_ID=rzp_jhg54HVyt465fhj6FG
RAZORPAY_KEY_SECRET=hsjhgfYU76ghf56R^JH
Usage
use Razorpay;
protected $request;
protected $razorpay;
public function __construct(
Request $request,
Razorpay $razorpay
) {
// Set the properties
$this->request = $request;
$this->razorpay = $razorpay;
}
- Fetch payment details
```php
$this->razorpay->getPaymentDetails($paymentId);
$this->razorpay->getPaymentDetails($paymentId, ['amount' => 500]);
LICENSE