<?php

namespace App\Console\Test;

use App\Cache\UserCache;
use App\Libs\Utils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Ycpay\Alitrans;
use Ycpay\Byte;
use Ycpay\Ali;
/**
 * 测试支付宝转账
 */
class TestZfbTransFundCommand extends Command
{
    /**
     * @var string
     */
    protected $signature = 'test_zfb_trans_fund';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '测试支付宝转账';


    /**
     * handle
     */
    public function handle()
    {
        $uid = 18;

        $config = [
            'appid'=>'2021003192638805',
            'secret'=>'2021003192638805',
            'notify_url'=>'https://zfb.ycsd.cn/pay/receive_zfb_third_notify',
            'privateKey'=>file_get_contents(storage_path('cert/huomaoxiaoshuohui/应用私钥RSA2048.txt')),
            'publicKey'=>file_get_contents(storage_path('cert/huomaoxiaoshuohui/应用公钥RSA2048.txt')),
        ];
        $object = new Alitrans();
        
        \Log::info('$config');
        \Log::info($config);
//         Byte::init($config);
        $object->init($config);
        $res = $object->queryAccountFund();
        \Log::info('$res');
        \Log::info($res);

    }
}
