public function sendAll(\Iterator $transactions, $parallel)
 {
     foreach ($transactions as $transaction) {
         try {
             $this->adapter->send($transaction);
         } catch (RequestException $e) {
             // no op for batch transaction
         }
     }
 }
 public function sendAll(\Iterator $transactions, $parallel)
 {
     foreach ($transactions as $transaction) {
         try {
             $this->adapter->send($transaction);
         } catch (RequestException $e) {
             if ($e->getThrowImmediately()) {
                 throw $e;
             }
         }
     }
 }
Exemplo n.º 3
0
 public function send(RequestInterface $request)
 {
     $transaction = new Transaction($this, $request);
     try {
         if ($response = $this->adapter->send($transaction)) {
             return $response;
         }
         throw new \LogicException('No response was associated with the transaction');
     } catch (RequestException $e) {
         throw $e;
     } catch (\Exception $e) {
         // Wrap exceptions in a RequestException to adhere to the interface
         throw new RequestException($e->getMessage(), $request, null, $e);
     }
 }