コード例 #1
0
 public function testPurchaseFailure()
 {
     $httpResponse = $this->getMockHttpResponse('AIMPurchaseFailure.txt');
     $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody());
     $this->assertFalse($response->isSuccessful());
     $this->assertSame('0', $response->getTransactionReference());
     $this->assertSame('A valid amount is required.', $response->getMessage());
 }
コード例 #2
0
 public function testRefundFailure()
 {
     $httpResponse = $this->getMockHttpResponse('AIMRefundFailure.txt');
     $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody());
     $this->assertFalse($response->isSuccessful());
     $this->assertSame('{"approvalCode":"","transId":"0"}', $response->getTransactionReference());
     $this->assertSame('The referenced transaction does not meet the criteria for issuing a credit.', $response->getMessage());
     $this->assertSame(3, $response->getResultCode());
     $this->assertSame(54, $response->getReasonCode());
     $this->assertSame('', $response->getAuthorizationCode());
     $this->assertSame('P', $response->getAVSCode());
 }
コード例 #3
0
 public function testRefundFailure()
 {
     $httpResponse = $this->getMockHttpResponse('AIMRefundFailure.txt');
     $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody());
     $this->assertFalse($response->isSuccessful());
     $this->assertSame('0', $response->getTransactionReference());
     $this->assertSame('The credit card number is invalid.', $response->getMessage());
     $this->assertSame('3', $response->getCode());
     $this->assertSame('6', $response->getReasonCode());
     $this->assertSame('', $response->getAuthorizationCode());
     $this->assertSame('P', $response->getAVSCode());
 }