notify.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. define('IN_MOBILE', true);
  7. require '../../framework/bootstrap.inc.php';
  8. load()->app('common');
  9. load()->app('template');
  10. error_reporting(0);
  11. if ($_GPC['orderno']) {
  12. $sql = 'SELECT * FROM ' . tablename('core_paylog') . ' WHERE `plid`=:plid and `fee`=:fee';
  13. $pars = array();
  14. $pars[':plid'] = $_GPC['tid'];
  15. $pars[':fee'] = $_GPC['fee'];
  16. $log = pdo_fetch($sql, $pars);
  17. if(!empty($log) && ($log['status'] == 0)) {
  18. $tag = array(
  19. 'transaction_id' => $_GPC['orderno']
  20. );
  21. $data = array(
  22. 'status' => 1,
  23. 'uniontid' => $_GPC['transId'],
  24. 'openid' => $_GPC['uuid'],
  25. 'tag' => iserializer($tag)
  26. );
  27. pdo_update('core_paylog', $data, array('tid' => $log['tid']));
  28. $site = WeUtility::createModuleSite($log['module']);
  29. if (!is_error($site)) {
  30. $method = 'payResult';
  31. if (method_exists($site, $method)) {
  32. $ret = array();
  33. $ret['weid'] = $log['uniacid'];
  34. $ret['uniacid'] = $log['uniacid'];
  35. $ret['result'] = 'success';
  36. $ret['type'] = 'jueqiymf';
  37. $ret['from'] = 'notify';
  38. $ret['tid'] = $log['tid'];
  39. $ret['uniontid'] = $log['uniontid'];
  40. $ret['transaction_id'] = $_GPC['orderno'];
  41. $ret['user'] = $log['openid'];
  42. $ret['fee'] = $log['fee'];
  43. $ret['tag'] = $tag;
  44. $ret['is_usecard'] = $log['is_usecard'];
  45. $ret['card_type'] = $log['card_type'];
  46. $ret['card_fee'] = $log['card_fee'];
  47. $ret['card_id'] = $log['card_id'];
  48. exit($site->$method($ret));
  49. exit('success');
  50. }
  51. }
  52. }
  53. }
  54. exit('fail');