$data = array(
'appid' => '62YOS4NV2X6W3LJ2XYMCWL2XS3JL44ZP', // 您的appid
'order_no' => '20180604114305540049002017738304', // 32位订单号
'amount' => '19900', // 订单金额为分模式
'channel' => 'wx' // 支付类型 wx=微信 alipay=支付宝 bank=网银
);
// 对请求参数进行签名
//签名步骤一:按字典序排序参数
ksort($data);
// 签名步骤二: 请求参数格式化成url参数
$string = http_build_query($data);
// 签名步骤三:在string后加入KEY
$string . "&key=O505POTYSLDB7F4QRLBP63FQG76PXS21"; // key在开发配置中查看
// 签名步骤四:MD5加密
$string = md5($string);
//签名步骤五:所有字符转为大写
$sign = strtoupper($string);
// 添加公共参数
$data['subject'] = '商品名称'; // 商品名称
$data['attach'] = '备注信息'; // 附加参数,同步返回
$data['client_ip'] = '127.0.0.1'; // 客户端请求IP
$data['redirect_url'] = 'http://www.baidu.com'; // 同步返回地址
$data['notify_url'] = 'http://www.baidu.com/notify.php'; // 异步通知地址
$data['sign'] = $sign; // 签名
$url = 'http://open.tengxinyunshang.com/api.php/Index/pay'; // 请求地址
$res = $this->postCurl($url, $data); // 提交请求