yunpay.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>支付跳转中...</title>
  6. </head>
  7. <?php
  8. include("../../config/conn.php");
  9. include("../../config/function.php");
  10. $sj=date("Y-m-d H:i:s");
  11. sesCheck();
  12. require_once("yun.config.php");
  13. require_once("lib/yun_md5.function.php");
  14. $userid=returnuserid($_SESSION["SHOPUSER"]);
  15. $sj=date("Y-m-d H:i:s");
  16. $bh=time();
  17. $uip=$_SERVER["REMOTE_ADDR"];
  18. $money1=sqlzhuru($_POST[t1]);
  19. $ddbh=time().$userid.rnd_num(1000);
  20. intotable("yjcode_dingdang","bh,ddbh,userid,sj,uip,money1,ddzt,alipayzt,bz,ifok","'".$bh."','".$ddbh."',".$userid.",'".$sj."','".$uip."',".$money1.",'wait','','yunpay',0");
  21. /**************************请求参数**************************/
  22. //商户订单号
  23. $out_trade_no =$ddbh;//商户网站订单系统中唯一订单号,必填
  24. //订单名称
  25. $subject = weburl;//必填
  26. //付款金额
  27. $total_fee = $money1;//必填 需为整数
  28. //订单描述
  29. $body = $subject;
  30. //服务器异步通知页面路径
  31. $nourl = weburl."user/yunpay/no_url.php";
  32. //需http://格式的完整路径,不能加?id=123这类自定义参数
  33. //页面跳转同步通知页面路径
  34. $reurl = weburl."user/paylog.php";
  35. //需http://格式的完整路径,不能加?id=123这类自定义参数,不能写成http://localhost/
  36. //商品展示地址
  37. $orurl = "";
  38. //需http://格式的完整路径,不能加?id=123这类自定义参数,如原网站带有 参数请彩用伪静态或短网址解决
  39. //商品形象图片地址
  40. $orimg = "";
  41. //需http://格式的完整路径,必须为图片完整地址
  42. /************************************************************/
  43. //构造要请求的参数数组,无需改动
  44. $parameter = array(
  45. "partner" => trim($yun_config['partner']),
  46. "seller_email" => $seller_email,
  47. "out_trade_no" => $out_trade_no,
  48. "subject" => $subject,
  49. "total_fee" => $total_fee,
  50. "body" => $body,
  51. "nourl" => $nourl,
  52. "reurl" => $reurl,
  53. "orurl" => $orurl,
  54. "orimg" => $orimg
  55. );
  56. //建立请求
  57. $html_text = i2e($parameter, "支付进行中...");
  58. echo $html_text;
  59. ?>
  60. </body>
  61. </html>