Download the PHP package hyperbolaa/unionpay without Composer

On this page you can find all versions of the php package hyperbolaa/unionpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package unionpay

Unionpay & laravel & 银联支付

交易类型

产品类型:bizType

接入类型:accessType

渠道类型:channelType

应答码:respCode

备注

version5.0.0 与 version5.1.0 验签方式不一样
本项目使用的是version5.0.0   (使用其他版本会存在问题)

安装

composer require hyperbolaa/unionpay dev-master

laravel 配置

 'providers' => [
     // ...
     Hyperbolaa\Unionpay\UnionpayServiceProvider::class,
 ]

生成配置文件

运行 `php artisan vendor:publish` 命令,
发布配置文件到你的项目中。

app代码使用

$unionpay = app('unionpay.mobile');
$unionpay->setOrderId('order_id');
$unionpay->setTxnAmt('order_amount');
$unionpay->setTxnTime('req_time');

//返回签名后的支付参数给移动端的sdk-》{539512046523081531300}
return $unionpay->consume();

wap代码使用

$unionpay = app('unionpay.wap');
$unionpay->setOrderId('order_id');
$unionpay->setTxnAmt('order_amount');
$unionpay->setTxnTime('req_time');

//返回一个表单
return $unionpay->consume();

异步通知

    public function unionpayNotify()
    {
        if (! app('unionpay.mobile')->verify()) {
            Log::notice('unionpay notify post data verification fail.', [
                'data' => Request::instance()->getContent()
            ]);
            return 'fail';
        }

        // 判断通知类型。
        if (Input::get('respCode') == '00') {
                // TODO: 支付成功,取得订单号进行其它相关操作。
                Log::debug('unionpay notify get data verification success.', [
                    'out_trade_no'  => Input::get('orderId'),
                    'trade_no'      => Input::get('queryId')
                ]);
        }

        return 'success';
    }

稳定版本使用

composer require hyperbolaa/unionpay:1.0

happy coding

联系&打赏

如果真心觉得项目帮助到你,为你节省了成本,欢迎鼓励一下。

如果有什么问题,可通过以下方式联系我。提供有偿技术服务。

也希望更多朋友可用提供代码支持。欢迎交流与打赏。

加入QQ群:60973229

Related


All versions of unionpay with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version 5.*
illuminate/events Version 5.*
illuminate/config Version 5.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hyperbolaa/unionpay contains the following files

Loading the files please wait ....