后端退款 对接 ,通联

main
岩仔88 4 weeks ago
parent c3993eb366
commit 3402e1b2b7

@ -1154,38 +1154,33 @@ class UserOrderController extends Controller
$cancel = false; $cancel = false;
switch ($type) { switch ($type) {
case 1: case 1:
// 仅退款
break; break;
case 2: case 2:
// 退款&取消预约
$cancel = true; $cancel = true;
break; break;
} }
$hospital_extra_content = self::pay_config($order_info->hospital); $TongLianPay = new TongLianPayController();
$wcp = new WeChatPayController(); $refund_data = [
$wcp->builder([ 'show' => $order_info->show,
'appid' => env('WX_APP_ID'), 'true_price' => $order_info->true_price * 100,
'pem_path' => base_path() . $hospital_extra_content['wxp']['key'], 'transaction' => $order_info->transaction,
'cer_path' => base_path() . $hospital_extra_content['wxp']['crt'], ];
'cer_num' => $hospital_extra_content['wxp']['number'], $tl_res = $TongLianPay->Refund($refund_data);
'mchid' => $hospital_extra_content['wxp']['id'],
'v3' => $hospital_extra_content['wxp']['v3'],
]);
$out_trade_no = $order_info->show; $out_trade_no = $order_info->show;
$wcr = new WeChatRefund(); $wcr = new WeChatRefund();
$post_data = [ $post_data = [
'transaction_id' => $order_info->transaction, 'transaction_id' => $order_info->transaction,
'out_refund_no' => $out_trade_no, '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->admin = Login::$info->id;
$wcr->out_trade_no = $out_trade_no; $wcr->out_trade_no = $out_trade_no;
$wcr->post_data = json_encode($post_data, JSON_UNESCAPED_UNICODE); $wcr->post_data = json_encode($post_data, JSON_UNESCAPED_UNICODE);
$pay = $wcp->refund($post_data); $wcr->params = json_encode($tl_res, JSON_UNESCAPED_UNICODE);
$wcr->params = json_encode($pay, JSON_UNESCAPED_UNICODE);
$wcr->save(); $wcr->save();
if (isset($pay['code'])) Yo::error_echo(200076); $err_msg = empty($tl_res['retmsg']) ? ' ' : $tl_res['retmsg'];
if ($pay['status'] != 'PROCESSING' && $pay['status'] != 'SUCCESS') Yo::error_echo(200053); 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 = $wcr->id;
$order_info->refund_time = date('Y-m-d H:i:s'); $order_info->refund_time = date('Y-m-d H:i:s');
if ($cancel) { if ($cancel) {

@ -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
}
}
}
}
}
}
Loading…
Cancel
Save