public function testCreateTransactionCreditCard() { $merchantAuthentication = new apiContract\MerchantAuthenticationType(); $merchantAuthentication->setName(self::$LoginName); $merchantAuthentication->setTransactionKey(self::$TransactionKey); //create a transaction $transactionRequestType = new apiContract\TransactionRequestType(); $transactionRequestType->setTransactionType("authCaptureTransaction"); // TODO Change to Enum $transactionRequestType->setAmount($this->setValidAmount($this->counter)); $transactionRequestType->setPayment($this->paymentOne); $transactionRequestType->setOrder($this->orderType); $transactionRequestType->setCustomer($this->customerDataOne); $transactionRequestType->setBillTo($this->customerAddressOne); $request = new apiContract\CreateTransactionRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId($this->refId); $request->setTransactionRequest($transactionRequestType); $controller = new apiController\CreateTransactionController($request); $controller->execute(self::$TestEnvironment); $response = $controller->getApiResponse(); // Handle and validate the response self::displayMessages($response); $this->assertNotNull($response, "null response"); $this->assertNotNull($response->getMessages()); file_put_contents(self::$log_file, sprintf("\n%s: Controller Response ResultCode: '%s'.", \net\authorize\util\Helpers::now(), $response->getMessages()->getResultCode()), FILE_APPEND); $this->assertEquals("Ok", $response->getMessages()->getResultCode()); $this->assertEquals($this->refId, $response->getRefId()); $this->assertTrue(0 < count($response->getMessages())); foreach ($response->getMessages() as $message) { $this->assertEquals("I00001", $message->getCode()); $this->assertEquals("Successful.", $response->getText()); } }