|
|
|
|
@ -539,6 +539,52 @@ public function recovery_time_range($hospital,$user_id,$people_idnumber,$people_
|
|
|
|
|
$url_code ='预约时段修改';
|
|
|
|
|
$peis::Post($url_code,$hospital, $data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function dev_refund(Request $request)
|
|
|
|
|
{
|
|
|
|
|
$password = $request->post('password');
|
|
|
|
|
if ($password != 'A6A64BBD-DF4F-489A-B066-BD63E278981E') Yo::error_echo(200078);
|
|
|
|
|
|
|
|
|
|
$transaction_id = $request->post('transaction_id');
|
|
|
|
|
$out_refund_no = $request->post('out_refund_no');
|
|
|
|
|
$price = $request->post('price');
|
|
|
|
|
|
|
|
|
|
if (!$transaction_id || !$out_refund_no || !$price) Yo::error_echo(100000, ['参数不完整']);
|
|
|
|
|
|
|
|
|
|
// 尝试查订单获取医院支付配置,查不到则需传入 hospital
|
|
|
|
|
$order_info = UserOrder::where('transaction', $transaction_id)->first();
|
|
|
|
|
$hospital = $order_info ? $order_info->hospital : $request->post('hospital');
|
|
|
|
|
if (!$hospital) Yo::error_echo(100000, ['无法确定医院']);
|
|
|
|
|
|
|
|
|
|
$hospital_extra_content = self::pay_config($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'],
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$wcr = new WeChatRefund();
|
|
|
|
|
$post_data = [
|
|
|
|
|
'transaction_id' => $transaction_id,
|
|
|
|
|
'out_refund_no' => $out_refund_no,
|
|
|
|
|
'total' => $price,
|
|
|
|
|
];
|
|
|
|
|
$wcr->out_trade_no = $out_refund_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->save();
|
|
|
|
|
|
|
|
|
|
if (isset($pay['code'])) Yo::error_echo(200076);
|
|
|
|
|
if ($pay['status'] != 'PROCESSING' && $pay['status'] != 'SUCCESS') Yo::error_echo(200053);
|
|
|
|
|
|
|
|
|
|
return Yo::update_echo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function exam(Request $request)
|
|
|
|
|
{
|
|
|
|
|
$number = $request->post('number');
|
|
|
|
|
|