Commit f267b57c authored by xiabin's avatar xiabin

添加微信支付的功能

parent 60e7be5e
...@@ -21,6 +21,7 @@ use yii\base\InvalidParamException; ...@@ -21,6 +21,7 @@ use yii\base\InvalidParamException;
use yii\filters\AccessControl; use yii\filters\AccessControl;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
use yii\helpers\Html; use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\ForbiddenHttpException; use yii\web\ForbiddenHttpException;
class HomeController extends \yii\web\Controller class HomeController extends \yii\web\Controller
...@@ -407,8 +408,8 @@ class HomeController extends \yii\web\Controller ...@@ -407,8 +408,8 @@ class HomeController extends \yii\web\Controller
if (Yii::$app->deviceDetect->isMobile()) { if (Yii::$app->deviceDetect->isMobile()) {
$parameter['service'] = \Yii::$app->params['alipay']['wap_service']; $parameter['service'] = \Yii::$app->params['alipay']['wap_service'];
$parameter['app_pay'] = 'Y'; $parameter['app_pay'] = 'Y';
$parameter['return_rul'] = Url::base() . 'home/video?courseId=' . $courseId;
} }
$html_text = $alipay->buildRequestForm($parameter, "get", "确认"); $html_text = $alipay->buildRequestForm($parameter, "get", "确认");
echo $html_text; echo $html_text;
} else { } else {
......
...@@ -180,6 +180,10 @@ ...@@ -180,6 +180,10 @@
}); });
}, },
mobileAliPay(courseId){
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
window.location.href(url);
},
weixinJsPay(courseId){ weixinJsPay(courseId){
var url = __BASE_URL__ + '/weixin-js-pay/index?courseId=' + courseId; var url = __BASE_URL__ + '/weixin-js-pay/index?courseId=' + courseId;
window.location.href = url; window.location.href = url;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment