人人商城

payment.ctrl.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. defined('IN_IA') or exit('Access Denied');
  7. $dos = array('get_setting', 'display', 'save_setting');
  8. $do = in_array($do, $dos) ? $do : 'display';
  9. permission_check_account_user('wxapp_payment_pay', true, 'wxapp');
  10. $_W['page']['title'] = '支付参数';
  11. $pay_setting = miniapp_payment_param();
  12. $wxapp_info = miniapp_fetch($_W['uniacid']);
  13. if ($do == 'get_setting') {
  14. iajax(0, $pay_setting, '');
  15. }
  16. if ($do == 'display') {
  17. $pay_setting['wechat'] = empty($pay_setting['wechat']) ? array('mchid'=>'', 'signkey' => '') : $pay_setting['wechat'];
  18. }
  19. if ($do == 'save_setting') {
  20. if (!$_W['isajax'] || !$_W['ispost']) {
  21. iajax(-1, '非法访问');
  22. }
  23. $type = $_GPC['type'];
  24. if ($type != 'wechat') {
  25. iajax(-1, '参数错误');
  26. }
  27. $param = $_GPC['param'];
  28. $param['account'] = $_W['acid'];
  29. $pay_setting[$type] = $param;
  30. $payment = iserializer($pay_setting);
  31. uni_setting_save('payment', $payment);
  32. iajax(0, '设置成功', url('account/display', array('do' => 'switch', 'uniacid' => $_W['uniacid'])));
  33. }
  34. template('wxapp/payment');