/** * 支付回调 */ public function returnOp() { unset($_GET['act']); unset($_GET['op']); unset($_GET['payment_code']); $payment_api = $this->_get_payment_api(); $payment_config = $this->_get_payment_config(); $callback_info = $payment_api->getReturnInfo($payment_config); if ($callback_info) { //验证成功 $result = $this->_update_order($callback_info['out_trade_no'], $callback_info['trade_no']); if ($result['state']) { Tpl::output('result', 'success'); Tpl::output('message', '支付成功'); } else { Tpl::output('result', 'fail'); Tpl::output('message', '支付失败'); } } else { //验证失败 Tpl::output('result', 'fail'); Tpl::output('message', '支付失败'); } Tpl::showpage('payment_message'); }
/** * 输出专题 */ private function _output_special($data, $type = 'json', $special_id = 0) { $model_special = Model('mb_special'); if($_GET['type'] == 'html') { $html_path = $model_special->getMbSpecialHtmlPath($special_id); if(!is_file($html_path)) { ob_start(); Tpl::output('list', $data); Tpl::showpage('mb_special'); file_put_contents($html_path, ob_get_clean()); } header('Location: ' . $model_special->getMbSpecialHtmlUrl($special_id)); die; } else { output_data($data); } }
<br /> <?php echo html_entity_decode($output['setting_config']['statistics_code'], ENT_QUOTES); ?> </div> <?php if (C('debug') == 1) { ?> <div id="think_page_trace" class="trace"> <fieldset id="querybox"> <legend><?php echo $lang['nc_debug_trace_title']; ?> </legend> <div> <?php print_r(\Shopnc\Tpl::showTrace()); ?> </div> </fieldset> </div> <?php } ?> <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?> /js/jquery.cookie.js"></script> </body> </html>
/** * 第三方在线支付接口 * */ private function _api_pay($order_pay_info) { $inc_file = BASE_PATH . DS . 'api' . DS . 'payment' . DS . $this->payment_code . DS . $this->payment_code . '.php'; if (!is_file($inc_file)) { output_error('支付接口不存在'); } require $inc_file; $param = $this->payment_config; // wxpay_jsapi if ($this->payment_code == 'wxpay_jsapi') { $param['orderSn'] = $order_pay_info['pay_sn']; $param['orderFee'] = (int) (100 * $order_pay_info['api_pay_amount']); $param['orderInfo'] = C('site_name') . '商品订单' . $order_pay_info['pay_sn']; $param['orderAttach'] = $order_pay_info['order_type'] == 'real_order' ? 'r' : 'v'; $api = new wxpay_jsapi(); $api->setConfigs($param); try { echo $api->paymentHtml($this); } catch (Exception $ex) { if (C('debug')) { header('Content-type: text/plain; charset=utf-8'); echo $ex, PHP_EOL; } else { Tpl::output('msg', $ex->getMessage()); Tpl::showpage('payment_result'); } } exit; } $param['order_sn'] = $order_pay_info['pay_sn']; $param['order_amount'] = $order_pay_info['api_pay_amount']; $param['order_type'] = $order_pay_info['order_type'] == 'real_order' ? 'r' : 'v'; $payment_api = new $this->payment_code(); $return = $payment_api->submit($param); echo $return; exit; }
/** * node信息 * */ public function get_node_infoOp(){ $member_id = $this->member_info['member_id']; $model_chat = Model('web_chat'); $member_info = $model_chat->getMember($member_id); Tpl::output('member_info', $member_info); Tpl::showpage('node_info'); }
/** * 商品详细页 */ public function goods_bodyOp() { header("Access-Control-Allow-Origin:*"); $goods_id = intval($_GET['goods_id']); $model_goods = Model('goods'); $goods_info = $model_goods->getGoodsInfoByID($goods_id, 'goods_commonid'); $goods_common_info = $model_goods->getGoodsCommonInfoByID($goods_info['goods_commonid']); Tpl::output('goods_common_info', $goods_common_info); Tpl::showpage('goods_body'); }
/** * 第三方在线支付接口 * */ private function _api_pay($order_pay_info, $payment_info) { $param = $payment_info['payment_config']; // wxpay_jsapi if ($payment_info['payment_code'] == 'wxpay_jsapi') { $param['orderSn'] = $order_pay_info['pay_sn']; $param['orderFee'] = (int) (100 * $order_pay_info['api_pay_amount']); $param['orderInfo'] = C('site_name') . $order_pay_info['subject']; $param['orderAttach'] = 'p'; if ($_GET['from'] == 'mz') { $param['finishedUrl'] = 'http://mz.qinqin.net/trade/payment_pd_result.html?_=2&attach=_attach_'; $param['undoneUrl'] = 'http://mz.qinqin.net/trade/payment_pd_result_failed.html?_=2&attach=_attach_'; } $api = new wxpay_jsapi(); $api->setConfigs($param); try { echo $api->paymentHtml($this); } catch (Exception $ex) { if (C('debug')) { header('Content-type: text/plain; charset=utf-8'); echo $ex, PHP_EOL; } else { Tpl::output('msg', $ex->getMessage()); Tpl::showpage('payment_result'); } } exit; } $param['order_sn'] = $order_pay_info['pay_sn']; $param['order_amount'] = $order_pay_info['api_pay_amount']; $param['order_type'] = 'p'; $payment_api = new $payment_info['payment_code'](); $return = $payment_api->submit($param); echo $return; exit; }