<?php
!defined('IN_ONEZ') && exit('Access Denied');
$price=(float)onez()->gp('price');
$subject=onez()->gp('subject');
$plugintoken=onez()->gp('plugintoken');
$price<=0 && onez('m')->error('价格设置有误');

$openid=$G['user']['openid'];
if(!$openid){
  $A['supergoto']=onez()->cururl(false,array('_method'));
  return $A;
}
$_POST['paykey']='wxpay';
$_POST['payname']='微信支付';
$orderno=onez('order')->orderno($price,$subject,array(
  'openid'=>$openid,
  'userid'=>$G['userid'],
  'plugintoken'=>$plugintoken,
  'postdata'=>$_POST,
));
$A['orderno']=$orderno;
$A['jsApiParameters']=json_decode(onez('wxpay')->jsApiParameters($orderno),1);