native.php 856 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. ini_set('date.timezone','Asia/Shanghai');
  3. //error_reporting(E_ERROR);
  4. require_once "../lib/WxPay.Api.php";
  5. require_once "WxPay.NativePay.php";
  6. require_once 'log.php';
  7. //获取金额
  8. $money = (int)$_GET['money'];
  9. $coin = (int)$_GET['coin'];
  10. //订单名称
  11. $order_name = "充值秀场虚拟币".$coin;
  12. $notify = new NativePay();
  13. $orderid = WxPayConfig::MCHID.date("YmdHis");
  14. echo $orderid;
  15. $input = new WxPayUnifiedOrder();
  16. $input->SetBody($order_name);
  17. $input->SetAttach($order_name);
  18. $input->SetOut_trade_no($orderid);
  19. $input->SetTotal_fee($money);
  20. $input->SetTime_start(date("YmdHis"));
  21. $input->SetTime_expire(date("YmdHis", time() + 600));
  22. $input->SetGoods_tag("test");
  23. $input->SetTrade_type("NATIVE");
  24. $input->SetProduct_id("123456789");
  25. $result = $notify->GetPayUrl($input);
  26. $url2 = $result["code_url"];
  27. ?>
  28. <html>
  29. <body>
  30. </body>
  31. </html>