Authored by yangyang

支付做了一半

... ... @@ -18,17 +18,17 @@ class Yohobuy
{
// /* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL = 'http://api2.open.yohobuy.com/';
const API_URL2 = 'http://api.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
/**
* 私钥列表
... ...
... ... @@ -24,7 +24,7 @@ class OrderData
* and open the template in the editor.
*/
public function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
//构建必传参数
$param = Yohobuy::param();
$param['gender'] = $gender;
... ... @@ -36,7 +36,7 @@ class OrderData
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL2, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
... ... @@ -45,7 +45,7 @@ class OrderData
* and open the template in the editor.
*/
public function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
static function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -62,7 +62,7 @@ class OrderData
* and open the template in the editor.
*/
public function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
static function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -74,4 +74,20 @@ class OrderData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
* 支付订单
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
static function getPaymentData($contentCode, $gender, $yh_channel) {
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['gender'] = $gender;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//print_r($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
}
}
... ...
... ... @@ -187,10 +187,10 @@ class HomeController extends AbstractAction
* YOHO币
*/
public function currencyAction() {
$this->setTitle('YOHO币');
$this->setTitle('YOHO币');
$this->setNavHeader('YOHO币', true, false);
// $uid = $this->getUid();
// $uid = $this->getUid();
$uid = 967016;
$currency = \Index\UserModel::getYohoCoinData($uid);
... ... @@ -212,7 +212,7 @@ class HomeController extends AbstractAction
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsPage' => true
);
print_r($coupons);
print_r($coupons);
$this->_view->display('coupons', $coupons);
}
... ... @@ -468,7 +468,7 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$uid = $this->getUid();
$uid = '7566245'; //测试用
$uid = '10267443'; //测试用
//调用模型层getOrder方法获得并处理数据
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
//如果没有订单数据,就给一个随便逛逛链接
... ... @@ -508,8 +508,7 @@ class HomeController extends AbstractAction
echo $data['message'];
}
}
/*
* 我的订单-删除订单
*/
... ... @@ -533,6 +532,21 @@ class HomeController extends AbstractAction
}
/**
* 付款
*/
public function getPaymentAction() {
$contentCode = $this->get('content_code');
$contentCode = '04cf5abaa7c20178325a07c4a833782c';
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$data = OrderData::getPaymentData($contentCode, $gender, $yh_channel);
//print_r($data);
if ($data['code'] == 200) {
}
}
/**
* 订单详情页
*/
public function orderDetailAction() {
... ...