您好,登錄后才能下訂單哦!
參考https://github.com/gaoxuxu123/laravel-alipay
composer require laravel-alipay/alipay dev-master
或者在composer.json中加入
"require": {
"laravel-alipay/alipay": "dev-master"
}
更新依賴(lài) composer update
##使用說(shuō)明
找到 config/app.php 文件
'providers' => [
Lxu\Alipay\AlipayServiceProvider::class,
]
運(yùn)行 php artisan vendor:publish 命令
配置文件 config/lxu-alipay.php 已經(jīng)生成,按照要求配置即可
<?php
/**
Time: 14:22
*/
return [
//pc配置
'pcconfig'=>
[
'partner' =>'2088302186611', //這里是你在成功申請(qǐng)支付寶接口后獲取到的PID;
'key' =>'sxevk9h2vekjlx4y12arl6pryrz111', //這里是你在成功申請(qǐng)支付寶接口后獲取到的Key
'seller_id' =>'208830211', //就是partner
'sign_type' =>strtoupper('MD5'), //不需修改
'input_charset' =>strtolower('utf-8'), //不需修改
'transport' =>'http',
'notify_url' =>getenv('APP_URL').'/alipay/getnotifyurl',//異步通知
'return_url' =>getenv('APP_URL').'/alipay/getreturnurl',//同步通知
'refund_notify_url' => 'http://自己的域名/自己的路由/方法',//不做退款無(wú)需配置
'service' =>'create_direct_pay_by_user', //不需修改,支付service
'refundservice' =>'refund_fastpay_by_platform_pwd',//退款service
'payment_type' =>'1', //不需修改
//賣(mài)家賬戶信息
'seller_email' =>'5352222222@qq.com', //賣(mài)家郵箱
],
//手機(jī)配置
'mobileconfig'=>
[
'partner' =>'xxxxxxxxxxxxxxxxxxxxxx',
'seller_id' =>'xxxxxxxxxxxxxxxxxxxxxx',
'key' =>'xxxxxxxxxxxxxxxxxxxxxx',
'sign_type' =>strtoupper('RSA'), //不需修改
'input_charset' =>strtolower('utf-8'), //不需修改
'notify_url' =>'http://自己的域名/自己的路由/方法', //異步通知
'return_url' =>'http://自己的域名/自己的路由/方法', //同步通知
'refund_notify_url' => 'http://自己的域名/自己的路由/方法',//不做退款無(wú)需配置
'transport' =>'http',
'service' =>'alipay.wap.create.direct.pay.by.user',//不需修改
'refundservice' =>'refund_fastpay_by_platform_pwd',//退款service
'payment_type' =>'1',
'seller_email' =>'xxxxxxxxxxxx@xxx.com',
]
];
再配置路由訪問(wèn)控制器進(jìn)行回調(diào)即可
<?php
namespace App\Http\Controllers\Alipay;
use App\Http\Controllers\Controller;
use Omnipay\Omnipay;
use Illuminate\Http\Request;
use App\Http\Models\Painting;
use Auth;
use DB;
use App\Tools\OssUpload;
use App\Http\Models\SystemArea;
use App\Http\Models\Order;
use App\Http\Models\Cart;
use App\Http\Models\MemberAddress;
use App\Http\Models\MemberDistribution;
use App\Http\Models\MemberUpload;
use App\Http\Models\MemberCoupon;
use App\Http\Models\Warehouse;
use App\Http\Models\Collection;
use App\Http\Models\Member;
use App\Http\Models\Message;
use Symfony\Component\Console\Input\Input;
/**
pc 支付寶支付
*/
class IndexController extends Controller
{
/**
}
/**
}
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。