Ошибка GuzzleHttp: вызов неопределенного метода GuzzleHttp \ Client :: sendAsyn c () - PullRequest
0 голосов
/ 06 августа 2020

Я использую GuzzleHttp 6.5.5

Настройка авторизации платежного шлюза eNet.

Composer.json файл

"require": {
        "league/omnipay": "^3.0",
        "academe/omnipay-authorizenetapi": " ~3.0",
        "php-http/guzzle6-adapter": "1.1.1"
    }

Код оплаты:

 require_once('assets/import/authorizenet/vendor/autoload.php');
        $gateway = Omnipay\Omnipay::create('AuthorizeNetApi_Api');
  
        $gateway->setAuthName($pt->config->anet_login_id);
        $gateway->setTransactionKey($pt->config->anet_transaction_id);
        $gateway->setTestMode(true);
  
        $creditCard = new Omnipay\Common\CreditCard([
          // Swiped tracks can be provided instead, if the card is present.
          'number' => '4000123412341234',
          'expiryMonth' => '12',
          'expiryYear' => '2020',
          'cvv' => '123',
          // Billing and shipping details can be added here.
        ]);
        if (!empty($_POST['pay_type']) && $_POST['pay_type'] == 'rent' && !empty($video->rent_price)) {
          $final_amount = $amount = $video->rent_price;
        }
        else{
          $final_amount = $amount = $video->sell_video;
        }
      
        $transactionId = rand(100000000, 999999999);
        $billingData = [
          'amount' => $final_amount,
          'transactionId' => $transactionId,
          'card'=>$creditCard,
          'currency' => $pt->config->anet_currency,
        ];
 
    $request = $gateway->authorize($billingData);
    $response = $request->send();
    $data = $response->getData();
 

При попытке отправить запрос на оплату возникла такая ошибка:

Error: Call to undefined method GuzzleHttp\Client::sendAsync() in ...authorizenet/vendor/php-http/guzzle6-adapter/src/Client.php on line 6

Не нашел решения

Что делать, чтобы сделать это работает?

...