paytest.php 1.2 KB

12345678910111213141516171819202122232425
  1. <?php
  2. namespace WY\app\controller;
  3. use WY\app\libs\Controller;
  4. if (!defined('WY_ROOT')) {
  5. exit;
  6. }
  7. class paytest extends Controller
  8. {
  9. public function index()
  10. {
  11. $apikey = '5ead7cac31c5010b3749636e508c3a47987bcbfc';
  12. $params['version'] = '1.0';
  13. $params['customerid'] = '10870';
  14. $params['sdorderno'] = date('Y') . date('m') . date('d') . date('H') . date('i') . date('s') . mt_rand(100000, 999999);
  15. $params['notifyurl'] = 'http://' . $this->req->server('HTTP_HOST') . '/test/notify.php';
  16. $params['returnurl'] = 'http://' . $this->req->server('HTTP_HOST') . '/test/return.php';
  17. $params['remark'] = '测试支付';
  18. $params['total_fee'] = $this->req->post('total_fee') ? $this->req->post('total_fee') : '1.00';
  19. $params['total_fee'] = number_format($params['total_fee'], 2, '.', '');
  20. $params['sign'] = md5('version=' . $params['version'] . '&customerid=' . $params['customerid'] . '&total_fee=' . $params['total_fee'] . '&sdorderno=' . $params['sdorderno'] . '&notifyurl=' . $params['notifyurl'] . '&returnurl=' . $params['returnurl'] . '&' . $apikey);
  21. $data = array('title' => '正在跳转到收银台', 'data' => $params);
  22. $this->put('paytest.php', $data);
  23. }
  24. }