model('payment'); load()->model('account'); $dos = array('save_setting', 'display'); $do = in_array($do, $dos) ? $do : 'display'; permission_check_account_user('profile_payment_refund'); if ($do == 'display') { $setting = uni_setting_load('payment', $_W['uniacid']); $setting = (array)$setting['payment']; if (empty($setting['wechat_refund'])) { $setting['wechat_refund'] = array('switch' => 0, 'key' => '', 'cert' => ''); } if (empty($setting['ali_refund'])) { $setting['ali_refund'] = array('switch' => 0, 'private_key' => ''); } } if ($do == 'save_setting') { $type = $_GPC['type']; $param = $_GPC['param']; $setting = uni_setting_load('payment', $_W['uniacid']); $pay_setting = (array)$setting['payment']; if ($type == 'wechat_refund') { if (empty($_FILES['cert']['tmp_name'])) { if (empty($setting['payment']['wechat_refund']['cert']) && $param['switch'] == 1) { itoast('请上传apiclient_cert.pem证书', '', 'info'); } $param['cert'] = $setting['payment']['wechat_refund']['cert']; } else { $param['cert'] = file_get_contents($_FILES['cert']['tmp_name']); if (strexists($param['cert'], '