public function testCreateCardSuccess() { $this->setMockHttpResponse('CreateCardSuccess.txt'); $response = $this->gateway->createCard($this->options)->send(); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertEquals('123456', $response->getCardReference()); }
public function testVoidSuccess() { $result = new \stdClass(); $result->State = 3; $result->Status = 1; $result->Message = 'Approved BankAuth: 826914443 CvvResult: M CVVCodeReason: CVV2 Match'; $result->Technical = ''; $result->TransactionID = 'f0e5b9f4-ec28-4ff2-aaed-195ec71aefcc'; $wrapper = new \stdClass(); $wrapper->VoidResult = $result; $this->mockSoapClient->expects($this->any())->method('Void')->will($this->returnValue($wrapper)); $this->options = array('transactionReference' => 'f0e5b9f4-ec28-4ff2-aaed-195ec71aefcc'); $response = $this->gateway->void($this->options)->send(); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertEquals('f0e5b9f4-ec28-4ff2-aaed-195ec71aefcc', $response->getTransactionReference()); $this->assertSame('Approved BankAuth: 826914443 CvvResult: M CVVCodeReason: CVV2 Match', $response->getMessage()); }