国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

有償求教:微信支付 容器異常: Target

running8gubin

問題描述

求教:我在用微信支付時(shí),經(jīng)常出現(xiàn)報(bào)錯:容器異常: Target [Psr\Container\ContainerInterface] is not instantiable while building [Yansongda\Supports\Pipeline]

程序代碼

$config = config('pay');
            try {
                Pay::config($config);
                $pay_order = [
                    'out_trade_no' => $out_trade_no . '',
                    'description' => $order->body,
                    'amount' => [
                        'total' => intval($order->total_fee*100),
                        'currency' => 'CNY',
                    ],
                    'payer' => [
                        'openid' => $order->openid,
                    ]
                ];
                $result = Pay::wechat()->mini($pay_order);
                info(json_encode($pay_order));
            } catch (ContainerException $e) {
                info('wechat_pay_create_order:'.$e->getMessage().$out_trade_no);
                info(json_encode($pay_order));
                return json(['code'=>'err','msg'=>'支付異常,請重試','message'=>$e->getMessage()]);
            }

報(bào)錯信息

容器異常: Target [Psr\Container\ContainerInterface] is not instantiable while building [Yansongda\Supports\Pipeline]

操作系統(tǒng)及workerman/webman等框架組件具體版本

workerman/webman 1.6.1

525 1 1
1個(gè)回答

running8gubin

基本解決,在業(yè)務(wù)代碼中加上這個(gè):

        Pay::config(config('pay'));
        $container = \Illuminate\Container\Container::getInstance();
        $container->instance(\Psr\Container\ContainerInterface::class, $container);
  • 暫無評論
??