/** * @test * Visa charge and void should return response code '00'. */ public function testVisaChargeAndVoidShouldReturnOk() { $testConfig = new TestServicesConfig(); $chargeSvc = new HpsCreditService($testConfig->validMultiUseConfig()); $response = $chargeSvc->charge(50, "usd", TestCreditCard::validVisaCreditCard(), TestCardHolder::ValidCardHolder(), true); $this->assertEquals("0", $response->tokenData->responseCode); $this->assertEquals("00", $response->responseCode); $voidResponse = $chargeSvc->void($response->transactionId); $this->assertEquals("00", $voidResponse->responseCode); }
/** * Creates a void transaction through the HpsCreditService */ public function execute() { parent::execute(); $voidSvc = new HpsCreditService($this->service->servicesConfig()); return $voidSvc->void($this->transactionId); }