diff --git a/app/Http/Controllers/UserOrderController.php b/app/Http/Controllers/UserOrderController.php index b4abb58..94b87f4 100644 --- a/app/Http/Controllers/UserOrderController.php +++ b/app/Http/Controllers/UserOrderController.php @@ -1154,38 +1154,33 @@ class UserOrderController extends Controller $cancel = false; switch ($type) { case 1: - // 仅退款 break; case 2: - // 退款&取消预约 $cancel = true; break; } - $hospital_extra_content = self::pay_config($order_info->hospital); - $wcp = new WeChatPayController(); - $wcp->builder([ - 'appid' => env('WX_APP_ID'), - 'pem_path' => base_path() . $hospital_extra_content['wxp']['key'], - 'cer_path' => base_path() . $hospital_extra_content['wxp']['crt'], - 'cer_num' => $hospital_extra_content['wxp']['number'], - 'mchid' => $hospital_extra_content['wxp']['id'], - 'v3' => $hospital_extra_content['wxp']['v3'], - ]); + $TongLianPay = new TongLianPayController(); + $refund_data = [ + 'show' => $order_info->show, + 'true_price' => $order_info->true_price * 100, + 'transaction' => $order_info->transaction, + ]; + $tl_res = $TongLianPay->Refund($refund_data); $out_trade_no = $order_info->show; $wcr = new WeChatRefund(); $post_data = [ 'transaction_id' => $order_info->transaction, 'out_refund_no' => $out_trade_no, - 'total' => $order_info->true_price * 100, + 'total' => (int) bcmul($order_info->true_price, '100', 0) ]; $wcr->admin = Login::$info->id; $wcr->out_trade_no = $out_trade_no; $wcr->post_data = json_encode($post_data, JSON_UNESCAPED_UNICODE); - $pay = $wcp->refund($post_data); - $wcr->params = json_encode($pay, JSON_UNESCAPED_UNICODE); + $wcr->params = json_encode($tl_res, JSON_UNESCAPED_UNICODE); $wcr->save(); - if (isset($pay['code'])) Yo::error_echo(200076); - if ($pay['status'] != 'PROCESSING' && $pay['status'] != 'SUCCESS') Yo::error_echo(200053); + $err_msg = empty($tl_res['retmsg']) ? ' ' : $tl_res['retmsg']; + if ($tl_res['retcode'] !== 'SUCCESS') Yo::error_echo(999999, ['退款失败,' . $tl_res['retmsg']]); + if ($tl_res['trxstatus'] !== '0000') Yo::error_echo(999999, ['退款失败,' . $err_msg]); $order_info->refund = $wcr->id; $order_info->refund_time = date('Y-m-d H:i:s'); if ($cancel) { diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000..8829f7f --- /dev/null +++ b/opencode.json @@ -0,0 +1,175 @@ +{ + "$schema": "https://opencode.ai/config.json", + "provider":{ + "openai-xianyu": { + "name": "xianyu codex", + "options": { + "api": "openai-responses", + "baseURL": "https://api.asxs.top/v1", + "apiKey": "sk-7c013cc9d4d9ab9bba95a5df3fe3c97a" + }, + "models": { + "gpt-5.3-codex": { + "name": "GPT-5.3 Codex", + "limit": { + "context": 400000, + "output": 128000 + }, + "options": { + "store": false + }, + "variants": { + "low": {}, + "medium": {}, + "high": {}, + "xhigh": {} + } + }, + "gpt-5.4": { + "name": "GPT-5.4", + "limit": { + "context": 1050000, + "output": 128000 + }, + "options": { + "store": false + }, + "variants": { + "low": {}, + "medium": {}, + "high": {}, + "xhigh": {} + } + } + } + }, + "bailian-coding-plan": { + "npm": "@ai-sdk/anthropic", + "name": "Model Studio Coding Plan", + "options": { + "baseURL": "https://coding.dashscope.aliyuncs.com/apps/anthropic/v1", + "apiKey": "sk-sp-08990303176d4bfeb36f8eef6a46484f" + }, + "models": { + "qwen3.5-plus": { + "name": "Qwen3.5 Plus", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "options": { + "thinking": { + "type": "enabled", + "budgetTokens": 8192 + } + }, + "limit": { + "context": 1000000, + "output": 65536 + } + }, + "qwen3-max-2026-01-23": { + "name": "Qwen3 Max 2026-01-23", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "limit": { + "context": 262144, + "output": 32768 + } + }, + "qwen3-coder-next": { + "name": "Qwen3 Coder Next", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "limit": { + "context": 262144, + "output": 65536 + } + }, + "qwen3-coder-plus": { + "name": "Qwen3 Coder Plus", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "limit": { + "context": 1000000, + "output": 65536 + } + }, + "MiniMax-M2.5": { + "name": "MiniMax M2.5", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "options": { + "thinking": { + "type": "enabled", + "budgetTokens": 8192 + } + }, + "limit": { + "context": 204800, + "output": 131072 + } + }, + "glm-5": { + "name": "GLM-5", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "options": { + "thinking": { + "type": "enabled", + "budgetTokens": 8192 + } + }, + "limit": { + "context": 202752, + "output": 16384 + } + }, + "glm-4.7": { + "name": "GLM-4.7", + "modalities": { + "input": ["text"], + "output": ["text"] + }, + "options": { + "thinking": { + "type": "enabled", + "budgetTokens": 8192 + } + }, + "limit": { + "context": 202752, + "output": 16384 + } + }, + "kimi-k2.5": { + "name": "Kimi K2.5", + "modalities": { + "input": ["text", "image"], + "output": ["text"] + }, + "options": { + "thinking": { + "type": "enabled", + "budgetTokens": 8192 + } + }, + "limit": { + "context": 262144, + "output": 32768 + } + } + } + } + } +}