/**
  * Will run all the actions that are loaded (from the 'actions' configuration
  * node) and that are applicable to this message type. Will return true
  * if all actions returned true. Otherwise will return false. This implicitly
  * means that the message will be re-queued if any action fails. Therefore
  * all actions need to be idempotent.
  *
  * @returns bool True if all actions were successful. False otherwise.
  */
 public function runActionChain()
 {
     $action = new PaymentCaptureAction();
     $result = $action->execute($this);
     if ($result === true) {
         return parent::runActionChain();
     } else {
         return false;
     }
 }
 public function testFailedAuth()
 {
     $auth = new Authorisation();
     $auth->success = false;
     $auth->correlationId = 'adyen-' . mt_rand();
     $auth->merchantAccountCode = 'WikimediaTest';
     $auth->merchantReference = mt_rand();
     $action = new PaymentCaptureAction();
     $action->execute($auth);
     $job = $this->jobQueue->pop();
     $this->assertEquals('SmashPig\\Core\\Jobs\\DeletePendingJob', $job['php-message-class']);
     $this->assertEquals($auth->merchantReference, $job['order_id']);
     $this->assertEquals('adyen', $job['gateway']);
 }