Skip to content

865826021/laravel5.1-package-yfbwappay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Laravel 5.1 易付宝WAP端支付 扩展使用教程

用法

composer require yuxiaoyang/yfbwappay

或者在你的 composer.json 的 require 部分中添加:

 "yuxiaoyang/yfbwappay": "~1.0"

下载完毕之后,直接配置 config/app.phpproviders:

//Illuminate\Hashing\HashServiceProvider::class,

Yuxiaoyang\YfbwapPay\YfbwapPayProvider::class,

控制器中使用 YfbwapPayController.php :

<?php


use \Yuxiaoyang\YfbwapPay\YfbwapPay;

class YfbwapPayController extends Controller
{
    public $yfbwappay;
    
    public function __construct()
    {
        $this->yfbwappay = new yfbwappay();
    }

    //易付宝WAP支付
    public function yfbwappay()
    {
        $params["out_trade_no"] = rand(1000000000,9999999999);
        $params["subject"] = "易付宝PC在线支付";
        $params["body"] = "订单详细";
        $params["total_fee"] = "0.01";
        $params["returnUrl"] = "http://www.***.com/yiwappayReturn";
        $data = $this->yfbwappay->pay($params);
        return $data;
    }

    //易付宝WAP支付回调验签
    public function yfbwappayReturn(Request $request)
    {
        $params['responseCode'] = Input::get('responseCode');
        $params['signAlgorithm'] = Input::get('signAlgorithm');//签名方式
        $params['keyIndex'] = Input::get('keyIndex');
        $params['merchantOrderNos'] = Input::get('merchantOrderNos');
        $params['signature'] = Input::get('signature');
        $data = $this->yfbwappay->payReturn($params);
        return $data;
    }

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages