authorize = $authorize; } public function getTransactionDetails($transactionId) { /* Create a merchantAuthenticationType object with authentication details retrieved from the constants file */ $this->authorize->init(); // Set the transaction's refId $refId = 'ref'.time(); $request = new GetTransactionDetailsRequest(); $request->setMerchantAuthentication($this->authorize->merchant_authentication); $request->setTransId($transactionId); $controller = new GetTransactionDetailsController($request); $response = $controller->executeWithApiResponse($this->authorize->mode()); // if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if ($response != null && $response->getMessages() != null) { nlog('SUCCESS: Transaction Status:'.$response->getTransaction()->getTransactionStatus()); nlog(' Auth Amount:'.$response->getTransaction()->getAuthAmount()); nlog(' Trans ID:'.$response->getTransaction()->getTransId()); } else { nlog("ERROR : Invalid response\n"); $errorMessages = $response->getMessages()->getMessage(); nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()); } return $response; } }