3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php/** * 公共方法类 * * $LastChangedDate: 2012-3-14 $Author: logan $ */class common_RefundController extends Controller_Abstract{ /** * 构造函数,不可删除 */ public function __construct() { # 装载基类,不可删除 parent::__construct(); #防止SQL注入 INI::Plugin('Sqlsafe'); $sqlsafe = new Sqlsafe(); $sqlsafe->execsql($this->_UArgv); } /** * 析构函数 */ function __destruct() { # 注销基类,不可删除 parent::__destruct(); } //支付即时到账批量退款 public function alipay_refundAction() { $shopuserOPT = INI::OTHER('pay','shopuser_class'); #'订单号|金额|订单时间|随机码' $randnum = $this->_UArgv['randnum'];//随机数 $signpay = $this->_UArgv['signpay'];//验证参数是否被窜改 # 安全验证 $ordid = $this->_UArgv['ordid'];//订单号 $amount = $this->_UArgv['amount'];//支付金额 $return = $this->_UArgv['return'];//返回页面 $notify_url = $this->_UArgv['notify_url']; //商城同步页面 $shop_passowrd = $this->_UArgv['shop_passowrd'];//商城密码 $shop_url = $this->_UArgv['shop_url'];//商城网页地址 $timeStamp = $this->_UArgv['timeStamp'];//时间 $shop_ip = $this->_UArgv['getip'];//ip $goodsname = urldecode($this->_UArgv['goodsname']);//商品名称 //支付参数问题 if( $signpay != md5( $ordid.'|'.$amount.'|'.$timeStamp.'|'.$randnum)) { $arr = array( "statusCode" => "300", "message" => "添加失败!", "navTabId" => "actionfunOPT", "callbackType" => "closeCurrent", "forwardUrl" => ""); echo json_encode($arr); exit; } INI::Plugin('alipay'); $alipay = new alipay(); $alipay_config = $alipay->alipay_config();//构造要请求的参数数组,无需改动 $parameter = array( "service" => "refund_fastpay_by_platform_pwd", //卖家支付宝帐户 "partner" => trim(ALIPAY_PARTNER), //服务器异步通知页面路径 "notify_url" => NOTIFY_refundURL, //卖家支付宝帐户 "seller_email" => ALIPAY_ACCOUNT, //退款当天日期 "refund_date" => date('Y-m-d'), //批次号 "batch_no" => date('YmdHis').rand(1000,9999), //退款笔数 "batch_num" => 1, //退款详细数据 //支付宝交易号^价格^退款方式 "detail_data" =>$ordid.'^'.$amount.'^协商退款', "_input_charset" => trim(INPUT_CHARSET) ); //建立请求 $alipaySubmit = new AlipaySubmit($alipay_config); $html_text = $alipaySubmit->buildRequestForm($parameter,"get", "确认"); echo $html_text; }}?>
based on kuLmD
Output for 5.4.34
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/6G0SG on line 1
Process exited with code 255.
Output for 5.4.0 - 5.4.32
<?php/** * 公共方法类 * * $LastChangedDate: 2012-3-14 $Author: logan $ */class common_RefundController extends Controller_Abstract{ /** * 构造函数,不可删除 */ public function __construct() { # 装载基类,不可删除 parent::__construct(); #防止SQL注入 INI::Plugin('Sqlsafe'); $sqlsafe = new Sqlsafe(); $sqlsafe->execsql($this->_UArgv); } /** * 析构函数 */ function __destruct() { # 注销基类,不可删除 parent::__destruct(); } //支付即时到账批量退款 public function alipay_refundAction() { $shopuserOPT = INI::OTHER('pay','shopuser_class'); #'订单号|金额|订单时间|随机码' $randnum = $this->_UArgv['randnum'];//随机数 $signpay = $this->_UArgv['signpay'];//验证参数是否被窜改 # 安全验证 $ordid = $this->_UArgv['ordid'];//订单号 $amount = $this->_UArgv['amount'];//支付金额 $return = $this->_UArgv['return'];//返回页面 $notify_url = $this->_UArgv['notify_url']; //商城同步页面 $shop_passowrd = $this->_UArgv['shop_passowrd'];//商城密码 $shop_url = $this->_UArgv['shop_url'];//商城网页地址 $timeStamp = $this->_UArgv['timeStamp'];//时间 $shop_ip = $this->_UArgv['getip'];//ip $goodsname = urldecode($this->_UArgv['goodsname']);//商品名称 //支付参数问题 if( $signpay != md5( $ordid.'|'.$amount.'|'.$timeStamp.'|'.$randnum)) { $arr = array( "statusCode" => "300", "message" => "添加失败!", "navTabId" => "actionfunOPT", "callbackType" => "closeCurrent", "forwardUrl" => ""); echo json_encode($arr); exit; } INI::Plugin('alipay'); $alipay = new alipay(); $alipay_config = $alipay->alipay_config();//构造要请求的参数数组,无需改动 $parameter = array( "service" => "refund_fastpay_by_platform_pwd", //卖家支付宝帐户 "partner" => trim(ALIPAY_PARTNER), //服务器异步通知页面路径 "notify_url" => NOTIFY_refundURL, //卖家支付宝帐户 "seller_email" => ALIPAY_ACCOUNT, //退款当天日期 "refund_date" => date('Y-m-d'), //批次号 "batch_no" => date('YmdHis').rand(1000,9999), //退款笔数 "batch_num" => 1, //退款详细数据 //支付宝交易号^价格^退款方式 "detail_data" =>$ordid.'^'.$amount.'^协商退款', "_input_charset" => trim(INPUT_CHARSET) ); //建立请求 $alipaySubmit = new AlipaySubmit($alipay_config); $html_text = $alipaySubmit->buildRequestForm($parameter,"get", "确认"); echo $html_text; }}?>