echo "payment/init result:\n" . $result . "\n\n"; $result_array = json_decode($result, true); if (is_null($result_array['resultCode'])) { echo 'payment/init failed, missing resultCode'; return; } if (verifyResponse($result_array, $publicKey, "payment/init verify") == false) { echo 'payment/init failed, unable to verify signature'; return; } if ($result_array['resultCode'] != '0') { echo 'payment/init failed, reason: ' . $result_array['resultMessage']; return; } $payId = $result_array['payId']; $params = createGetParams($merchantId, $payId, $dttm, $privateKey, $privateKeyPassword); ?> </pre> <a href="<?php echo $url . NativeApiMethod::$process . $params; ?> ">payment/process</a><br/> <a href="payment.php?action=status&merchant_id=<?php echo $merchantId; ?> &pay_id=<?php echo $payId; ?> ">payment/status</a><br/> <a href="payment.php?action=close&merchant_id=<?php echo $merchantId;
<?php /** * 主入口文件 * @author lixin <*****@*****.**> * @version */ include 'Common/common.php'; //增加include文件夹 //set_include_path(get_include_path().';./Lib'); //创建get参数 $GLOBALS['safeGetParam'] = createGetParams(); //将安全get参数装载到全局数组 $GLOBALS['safePostParam'] = createPostParams(); //将安全get参数装载到全局数组 //注册自动加载类函数,__autoload与 smarty3 有冲突 spl_autoload_register('classLoader'); //加载控制器 $module = safeStr($GLOBALS['safeGetParam']['module']); $action = safeStr($GLOBALS['safeGetParam']['action']); $module = empty($module) ? 'IndexAction' : ucfirst(strtolower($module)) . 'Action'; $action = empty($action) ? 'index' : strtolower($action); $__m = new $module(); $__m->{$action}();