Authored by hf

fixes some bugs to gzip css and js

... ... @@ -143,6 +143,7 @@ class Yohobuy
if (!empty($data)) {
$url = self::httpBuildQuery($url, $data);
}
echo $url;
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
... ...
... ... @@ -135,5 +135,20 @@ class OrderData
//调用接口获得数据
return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
}
/*
* 微信支付签名
*/
public static function weixinPaySign($orderCode)
{
//构建必传参数
$param['private_key'] = 'adbf5a778175ee757c34d0eba4e932bc';
$param['order_code'] = $orderCode;
$param['payment_code'] = 19;
$param['app_key'] = 'adbf5a778175ee75';
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get('http://pay.yohobuy.com/payment/data.html', $param);
}
}
... ...
... ... @@ -775,7 +775,6 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public function payAction()
{
// 审判跳转登录页
... ... @@ -813,6 +812,36 @@ class HomeController extends AbstractAction
'hasWxShare' => strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false
));
}
/**
* 微信支付 API
*/
public function weixinapiAction()
{
do {
if (!$this->isAjax()) {
break;
}
$uid = $this->getUid(true);
if (!$uid) {
break;
}
$orderCode = $this->get('order_code');
if (empty($orderCode)) {
break;
}
$result = OrderData::weixinPaySign($orderCode);
if (empty($result['data'])) {
break;
}
$this->echoJson($result['data']);
}
while (false);
}
// /*
// * 我的订单-确认收货
... ...
... ... @@ -159,4 +159,11 @@ routes.cart.type = "rewrite"
routes.cart.match = "/home/order/detail$"
routes.cart.route.module = Index
routes.cart.route.controller = Home
routes.cart.route.action = Homedetail
\ No newline at end of file
routes.cart.route.action = homedetail
; 微信支付接口
routes.weixinapi.type = "rewrite"
routes.weixinapi.match = "/shopping/pay/wechatwapapi$"
routes.weixinapi.route.module = Index
routes.weixinapi.route.controller = Home
routes.weixinapi.route.action = Weixinapi
\ No newline at end of file
... ...