protected function cancelAuthorization() { $this->logger->debug("Cancelling authorization with reference '{$this->pspReference}'"); $api = $this->getApi(); $result = $api->cancel($this->pspReference); if ($result) { $this->logger->debug("Successfully cancelled authorization"); } else { // Not a big deal $this->logger->warning("Failed to cancel authorization, it will remain in the payment console"); } }
public function execute(ListenerMessage $msg) { $tl = new TaggedLogger('CaptureResponseAction'); if ($msg instanceof Capture) { if ($msg->success) { $tl->info("Adding record capture job for {$msg->currency} {$msg->amount} with id {$msg->correlationId} and psp reference {$msg->pspReference}."); $recordJob = RecordCaptureJob::factory($msg); $jobQueue = Configuration::getDefaultConfig()->object('data-store/jobs-adyen'); $jobQueue->push(json_decode($recordJob->toJson(), true)); } else { $tl->warning("Capture failed for payment with reference {$msg->pspReference} and correlation id {$msg->correlationId}.", $msg); } } return true; }