jlorente/laravel-payu 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jlorente/laravel-payu

最新稳定版本:1.0.2

Composer 安装命令:

composer require jlorente/laravel-payu

包简介

Laravel >=5.7 integration for the PayU PHP SDK package.

README 文档

README

Laravel integration of the PayU PHP SDK.

Installation

The preferred way to install this extension is through composer.

With Composer installed, you can then install the extension using the following commands:

$ php composer.phar require jlorente/laravel-payu

or add

...
    "require": {
        "jlorente/laravel-payu": "*"
    }

to the require section of your composer.json file.

Configuration

  1. Register the ServiceProvider in your config/app.php service provider list.

config/app.php

return [
    //other stuff
    'providers' => [
        //other stuff
        \Jlorente\Laravel\PayU\PayUServiceProvider::class,
    ];
];
  1. Add the following facade to the $aliases section.

config/app.php

return [
    //other stuff
    'aliases' => [
        //other stuff
        'PayU' => \Jlorente\Laravel\PayU\Facades\PayU::class,
    ];
];
  1. Publish the package configuration file.
$ php artisan vendor:publish --provider='Jlorente\Laravel\PayU\PayUServiceProvider'
  1. Set the api_key and api_secret in the config/payu.php file or use the predefined env variables.

config/payu.php

return [
    'api_key' => 'YOUR_API_KEY',
    'api_login' => 'YOUR_API_LOGIN',
    'merchant_id' => 'YOUR_MERCHANT_ID',
    'language' => 'YOUR_LANGUAGE' // Currently 'en, 'es', 'pt (default 'es')
    'is_test' => 'YOUR_IS_TEST' // true or false
    //other configuration
];

or .env

//other configurations
PAYU_API_KEY=<YOUR_API_KEY>
PAYU_API_LOGIN=<YOUR_API_LOGIN>
PAYU_MERCHANT_ID=<YOUR_MERCHANT_ID>
PAYU_LANGUAGE=<YOUR_LANGUAGE>
PAYU_IS_TEST=<YOUR_IS_TEST>

Usage

You can use the facade alias PayU to execute the PHP SDK methods through their classes. Note that the class name PayU prefix should be avoided.

PayU::tokens()::create($params);
PayU::payments()::doAuthorizationAndCapture($params);
PayU::reports()::getOrderDetail($parameters);

The authentication params will be automaticaly injected.

License

Copyright © 2020 José Lorente Martín jose.lorente.martin@gmail.com.

Licensed under the BSD 3-Clause License. See LICENSE.txt for details.

统计信息

  • 总下载量: 5.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-09-22