香洲二院小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mini_xzey/app/Http/Controllers/Test/TestController.php

87 lines
2.7 KiB

<?php
declare(strict_types = 1);
namespace App\Http\Controllers\Test;
use App\Dictionary\WeChat\MiniProgram\OpenApi;
use App\Models\Order;
use App\Models\RegistrationRecord;
use App\Utils\Traits\HttpRequest;
use App\Utils\Traits\SendSubscribeMessage;
use App\Utils\Traits\UniversalEncryption;
use Illuminate\Support\Facades\Redis;
use UnifyPayment\Cores\Struct\RefundOrder;
use UnifyPayment\Unify;
use function Symfony\Component\Translation\t;
class TestController
{
use HttpRequest;
use UniversalEncryption;
use SendSubscribeMessage;
public function test(): void
{
// $json = [
// 'ApplicationId' => '',
// 'ApplicationSecret' => '',
// 'Parameter' => [
// 'BeginDate' => '2025-04-27',
// 'EndDate' => '2025-04-28',
// 'CardType' => '01',
// 'CardNo' => '65284656',
// ]
// ];
$json = [
"ApplicationId" => "",
"ApplicationSecret"=> "",
"Parameter"=> [
"HospitalId" => "",
"PatientId"=> "2226817",
"PatientName"=> "李欣茹",
"PayAuthNo"=> "",
"UldLatlnt"=> "",
"IsInsSelfPay"=> "0",
"YbPayType"=> "2",
"FeeRecords"=> [
[
"FeeNo" => "-210360897",
"FeeTypeCode" => "51"
]
]
]
];
$start_time = microtime(true);
// $result = $this->request('POST', 'http://192.168.61.44:8010/api/his/GetPatientInfo', [
// 'json' => $json
// ]);
$end_time = microtime(true);
$use_time = sprintf("%.6f", ($start_time - $end_time));
recordLog('MedicalHis', json_encode([
'json' => $json,
'result' => $result,
'use_time' => $use_time
], JSON_UNESCAPED_UNICODE));
// dd($result);
// $response = '1';
// $order = Order::where('order_id', 'WXM20250207151636790')->first();
// $record = $order->outpatientPaymentRecord;
//
// foreach ($record as $v) {
// $extra_info = json_decode($v->extra_info, true);
// $extra_info['confirm_response'] = $response;
// $v->update(['extra_info' => json_encode($extra_info, JSON_UNESCAPED_UNICODE)]);
// }
// $app = getWeChatMiniProgramApp();
// dd($app->getAccessToken()->getToken());
// $refund = new RefundOrder('WXM20250208110845293', 'WXM20250208110845293_R123', '0.01', '人工退费');
// $response = Unify::common(config('unify'))->order->refund($refund);
// dd($response);
}
}