wxapp.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. class CoreModuleWxapp extends WeModuleWxapp {
  3. public function doPagePay() {
  4. global $_W, $_GPC;
  5. $order_info = pdo_get('core_paylog', array('uniacid' => $_W['uniacid'], 'module' => safe_gpc_string($_GPC['module_name']), 'tid' => safe_gpc_string($_GPC['orderid'])));
  6. $order = array(
  7. 'tid' => $order_info['tid'],
  8. 'user' => $_SESSION['openid'],
  9. 'fee' => $order_info['fee'],
  10. 'title' => trim($_GPC['title'])
  11. );
  12. $this->module = array('name' => $order_info['module']);
  13. $paydata = $this->pay($order);
  14. $this->result(0, '', $paydata);
  15. }
  16. public function doPagePayResult() {
  17. global $_GPC, $_W;
  18. $log = pdo_get('core_paylog', array('uniacid' => $_W['uniacid'], 'module' => safe_gpc_string($_GPC['module_name']), 'tid' => safe_gpc_string($_GPC['orderid'])));
  19. if (!empty($log) && !empty($log['status'])) {
  20. if (!empty($log['tag'])) {
  21. $tag = iunserializer($log['tag']);
  22. $log['uid'] = $tag['uid'];
  23. }
  24. $site = WeUtility::createModuleSite($log['module']);
  25. if (!is_error($site)) {
  26. $method = 'payResult';
  27. if (method_exists($site, $method)) {
  28. $ret = array();
  29. $ret['weid'] = $log['uniacid'];
  30. $ret['uniacid'] = $log['uniacid'];
  31. $ret['result'] = 'success';
  32. $ret['type'] = $log['type'];
  33. $ret['from'] = 'return';
  34. $ret['tid'] = $log['tid'];
  35. $ret['uniontid'] = $log['uniontid'];
  36. $ret['user'] = $log['openid'];
  37. $ret['fee'] = $log['fee'];
  38. $ret['tag'] = $tag;
  39. $ret['is_usecard'] = $log['is_usecard'];
  40. $ret['card_type'] = $log['card_type'];
  41. $ret['card_fee'] = $log['card_fee'];
  42. $ret['card_id'] = $log['card_id'];
  43. exit($site->$method($ret));
  44. }
  45. }
  46. }
  47. }
  48. }