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.
43 lines
1.4 KiB
43 lines
1.4 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Controllers\Test;
|
|
|
|
use App\Dictionary\WeChat\MiniProgram\OpenApi;
|
|
use App\Models\Order;
|
|
use App\Utils\Traits\HttpRequest;
|
|
use App\Utils\Traits\SendSubscribeMessage;
|
|
use Illuminate\Support\Facades\Redis;
|
|
use UnifyPayment\Cores\Struct\RefundOrder;
|
|
use UnifyPayment\Unify;
|
|
|
|
class TestController
|
|
{
|
|
use SendSubscribeMessage;
|
|
|
|
public function test(): void
|
|
{
|
|
$mini = getWeChatMiniProgramApp();
|
|
$response = $mini->getClient()->postJson(OpenApi::CREATE_QR_CODE->value, [
|
|
'path' => 'pagesA/register/notice?ed=show',
|
|
]);
|
|
dd($response->toArray());
|
|
//dd(json_decode('', true));
|
|
// $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);
|
|
}
|
|
}
|
|
|