|
|
@@ -51,6 +51,7 @@ class Service |
|
|
|
$config[$type]['return_url'] = $returnurl; |
|
|
|
|
|
|
|
if ($type == 'alipay') { |
|
|
|
echo 1; |
|
|
|
//创建支付对象 |
|
|
|
$pay = new Pay($config); |
|
|
|
//支付宝支付,请根据你的需求,仅选择你所需要的即可 |
|
|
@@ -64,18 +65,21 @@ class Service |
|
|
|
|
|
|
|
switch ($method) { |
|
|
|
case 'web': |
|
|
|
echo 4;die; |
|
|
|
//电脑支付,跳转 |
|
|
|
$html = $pay->driver($type)->gateway('web')->pay($params); |
|
|
|
print_r($html);die; |
|
|
|
Response::create($html)->send(); |
|
|
|
break; |
|
|
|
case 'wap': |
|
|
|
echo 2;die; |
|
|
|
//手机网页支付,跳转 |
|
|
|
$html = $pay->driver($type)->gateway('wap')->pay($params); |
|
|
|
print_r($html);die; |
|
|
|
Response::create($html)->send(); |
|
|
|
break; |
|
|
|
case 'app': |
|
|
|
echo 3;die; |
|
|
|
//APP支付,直接返回字符串 |
|
|
|
$html = $pay->driver($type)->gateway('app')->pay($params); |
|
|
|
break; |
|
|
|