项目作者: lakshmaji

项目描述 :
:moneybag: Razorpay libray for Laravel framework
高级语言: PHP
项目地址: git://github.com/lakshmaji/razorpay.git
创建时间: 2017-12-03T11:43:39Z
项目社区:https://github.com/lakshmaji/razorpay

开源协议:

下载


Razorpay

Latest Stable Version
Total Downloads
Latest Unstable Version
License
Monthly Downloads
Daily Downloads
composer.lock

Razorpay officail documentation
Razorpay php library

What it is

  • Razorpay is providing single vendor platform for all payment gateway integrations. This package is used to integrate the razorpay with Laravel framework
  • This uses razorpy-php.

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

  • This package is available on packagist
    1. composer require lakshmaji/razorpay

NOTE : This package service providers will be automatically registered with Laravel (uses package auto discovery feature :musical_note:)

  • For applications which uses below 5.5, it is required to add the service providers and aliases to configuration file.

    • Add the Service Provider to providers array
      1. Lakshmaji\Razorpay\RazorpayServiceProvider::class,
    • Add the Facade to aliases array
      1. 'Razorpay' => Lakshmaji\Razorpay\Facade\Razorpay::class,
    • Try updating the application with composer (dependencies but not mandatory :wink: )
      1. composer update


Configurations

  • Publish the configuration file , this will publish razorpay.php file to your application config directory.
    1. php artisan vendor:publish
  • Configure the required Razorpay configurations. You can configure them from laravel .env file, the sample configurations in .env file
    1. #Razorpay configurations
    2. RAZORPAY_KEY_ID=rzp_jhg54HVyt465fhj6FG
    3. RAZORPAY_KEY_SECRET=hsjhgfYU76ghf56R^JH

Usage

  • With Constructor instantiaon
    ```php
    <?php

use Razorpay;

protected $request;
protected $razorpay;

public function __construct(
Request $request,
Razorpay $razorpay
) {
// Set the properties
$this->request = $request;
$this->razorpay = $razorpay;
}

  1. - Fetch payment details
  2. ```php
  3. $this->razorpay->getPaymentDetails($paymentId);
  • Capture (verify) payment details
    1. $this->razorpay->getPaymentDetails($paymentId, ['amount' => 500]);

LICENSE

MIT