Authored by yangyang

支付做了一半

@@ -18,17 +18,17 @@ class Yohobuy @@ -18,17 +18,17 @@ class Yohobuy
18 { 18 {
19 19
20 // /* 正式环境 */ 20 // /* 正式环境 */
21 -// const API_URL = 'http://api2.open.yohobuy.com/';  
22 -// const API_URL2 = 'http://api.open.yohobuy.com/';  
23 -// const SERVICE_URL = 'http://service.api.yohobuy.com/';  
24 -// const YOHOBUY_URL = 'http://www.yohobuy.com/'; 21 + const API_URL = 'http://api2.open.yohobuy.com/';
  22 + const API_URL2 = 'http://api.open.yohobuy.com/';
  23 + const SERVICE_URL = 'http://service.api.yohobuy.com/';
  24 + const YOHOBUY_URL = 'http://www.yohobuy.com/';
25 25
26 /* 测试环境 */ 26 /* 测试环境 */
27 - const API_URL = 'http://test2.open.yohobuy.com/';  
28 - const SERVICE_URL = 'http://test.service.api.yohobuy.com/';  
29 - const YOHOBUY_URL = 'http://www.yohobuy.com/';  
30 - const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL  
31 - const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL 27 +// const API_URL = 'http://test2.open.yohobuy.com/';
  28 +// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
  29 +// const YOHOBUY_URL = 'http://www.yohobuy.com/';
  30 +// const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
  31 +// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
32 32
33 /** 33 /**
34 * 私钥列表 34 * 私钥列表
@@ -24,7 +24,7 @@ class OrderData @@ -24,7 +24,7 @@ class OrderData
24 * and open the template in the editor. 24 * and open the template in the editor.
25 */ 25 */
26 26
27 - public function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) { 27 + static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
28 //构建必传参数 28 //构建必传参数
29 $param = Yohobuy::param(); 29 $param = Yohobuy::param();
30 $param['gender'] = $gender; 30 $param['gender'] = $gender;
@@ -36,7 +36,7 @@ class OrderData @@ -36,7 +36,7 @@ class OrderData
36 $param['yh_channel'] = $yh_channel; 36 $param['yh_channel'] = $yh_channel;
37 $param['client_secret'] = Sign::getSign($param); 37 $param['client_secret'] = Sign::getSign($param);
38 //调用接口获得数据 38 //调用接口获得数据
39 - return Yohobuy::get(Yohobuy::API_URL2, $param); 39 + return Yohobuy::get(Yohobuy::API_URL, $param);
40 } 40 }
41 41
42 /* 42 /*
@@ -45,7 +45,7 @@ class OrderData @@ -45,7 +45,7 @@ class OrderData
45 * and open the template in the editor. 45 * and open the template in the editor.
46 */ 46 */
47 47
48 - public function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) { 48 + static function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
49 $param = Yohobuy::param(); 49 $param = Yohobuy::param();
50 $param['order_code'] = $order_code; 50 $param['order_code'] = $order_code;
51 $param['uid'] = $uid; 51 $param['uid'] = $uid;
@@ -62,7 +62,7 @@ class OrderData @@ -62,7 +62,7 @@ class OrderData
62 * and open the template in the editor. 62 * and open the template in the editor.
63 */ 63 */
64 64
65 - public function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) { 65 + static function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
66 $param = Yohobuy::param(); 66 $param = Yohobuy::param();
67 $param['order_code'] = $order_code; 67 $param['order_code'] = $order_code;
68 $param['uid'] = $uid; 68 $param['uid'] = $uid;
@@ -74,4 +74,20 @@ class OrderData @@ -74,4 +74,20 @@ class OrderData
74 return Yohobuy::get(Yohobuy::API_URL, $param); 74 return Yohobuy::get(Yohobuy::API_URL, $param);
75 } 75 }
76 76
  77 + /*
  78 + * 支付订单
  79 + * To change this template file, choose Tools | Templates
  80 + * and open the template in the editor.
  81 + */
  82 +
  83 + static function getPaymentData($contentCode, $gender, $yh_channel) {
  84 + $param = Yohobuy::param();
  85 + $param['content_code'] = $contentCode;
  86 + $param['gender'] = $gender;
  87 + $param['yh_channel'] = $yh_channel;
  88 + $param['client_secret'] = Sign::getSign($param);
  89 + //print_r($param);
  90 + return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
  91 + }
  92 +
77 } 93 }
@@ -187,10 +187,10 @@ class HomeController extends AbstractAction @@ -187,10 +187,10 @@ class HomeController extends AbstractAction
187 * YOHO币 187 * YOHO币
188 */ 188 */
189 public function currencyAction() { 189 public function currencyAction() {
190 - $this->setTitle('YOHO币'); 190 + $this->setTitle('YOHO币');
191 $this->setNavHeader('YOHO币', true, false); 191 $this->setNavHeader('YOHO币', true, false);
192 192
193 - // $uid = $this->getUid(); 193 + // $uid = $this->getUid();
194 $uid = 967016; 194 $uid = 967016;
195 $currency = \Index\UserModel::getYohoCoinData($uid); 195 $currency = \Index\UserModel::getYohoCoinData($uid);
196 196
@@ -212,7 +212,7 @@ class HomeController extends AbstractAction @@ -212,7 +212,7 @@ class HomeController extends AbstractAction
212 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), 212 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
213 'couponsPage' => true 213 'couponsPage' => true
214 ); 214 );
215 - print_r($coupons); 215 + print_r($coupons);
216 216
217 $this->_view->display('coupons', $coupons); 217 $this->_view->display('coupons', $coupons);
218 } 218 }
@@ -468,7 +468,7 @@ class HomeController extends AbstractAction @@ -468,7 +468,7 @@ class HomeController extends AbstractAction
468 $gender = Helpers::getGenderByCookie(); 468 $gender = Helpers::getGenderByCookie();
469 $yh_channel = $this->get('yh_channel', 1); 469 $yh_channel = $this->get('yh_channel', 1);
470 $uid = $this->getUid(); 470 $uid = $this->getUid();
471 - $uid = '7566245'; //测试用 471 + $uid = '10267443'; //测试用
472 //调用模型层getOrder方法获得并处理数据 472 //调用模型层getOrder方法获得并处理数据
473 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); 473 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
474 //如果没有订单数据,就给一个随便逛逛链接 474 //如果没有订单数据,就给一个随便逛逛链接
@@ -508,8 +508,7 @@ class HomeController extends AbstractAction @@ -508,8 +508,7 @@ class HomeController extends AbstractAction
508 echo $data['message']; 508 echo $data['message'];
509 } 509 }
510 } 510 }
511 -  
512 - 511 +
513 /* 512 /*
514 * 我的订单-删除订单 513 * 我的订单-删除订单
515 */ 514 */
@@ -533,6 +532,21 @@ class HomeController extends AbstractAction @@ -533,6 +532,21 @@ class HomeController extends AbstractAction
533 } 532 }
534 533
535 /** 534 /**
  535 + * 付款
  536 + */
  537 + public function getPaymentAction() {
  538 + $contentCode = $this->get('content_code');
  539 + $contentCode = '04cf5abaa7c20178325a07c4a833782c';
  540 + $gender = Helpers::getGenderByCookie();
  541 + $yh_channel = $this->get('yh_channel', 1);
  542 + $data = OrderData::getPaymentData($contentCode, $gender, $yh_channel);
  543 + //print_r($data);
  544 + if ($data['code'] == 200) {
  545 +
  546 + }
  547 + }
  548 +
  549 + /**
536 * 订单详情页 550 * 订单详情页
537 */ 551 */
538 public function orderDetailAction() { 552 public function orderDetailAction() {