public function testVisaDebitWhenValidTrackDataShouldReturnOk() { $service = new HpsDebitService(TestServicesConfig::validMultiUseConfig()); $charge = $service->charge(50, "usd", "%B4012002000060016^VI TEST CREDIT^251210118039000000000396?;4012002000060016=25121011803939600000?", "32539F50C245A6A93D123412324000AA", null, true); $this->assertNotNull($charge); $this->assertEquals("00", $charge->responseCode); $debitReturn = $service->returnDebit($charge->transactionId, 50, "%B4012002000060016^VI TEST CREDIT^251210118039000000000396?;4012002000060016=25121011803939600000?", "32539F50C245A6A93D123412324000AA", true); $this->assertNotNull($debitReturn); $this->assertEquals("00", $debitReturn->responseCode); }
public function testMastercardDebitWhenValidTrackDataShouldReturnOk() { $service = new HpsDebitService(TestServicesConfig::validMultiUseConfig()); $charge = $service->charge(50, "usd", "%B5473500000000014^MC TEST CARD^251210199998888777766665555444433332?;5473500000000014=25121019999888877776?", "F505AD81659AA42A3D123412324000AB", null, true); $this->assertNotNull($charge); $this->assertEquals("00", $charge->responseCode); $debitReturn = $service->returnDebit($charge->transactionId, 50, "%B5473500000000014^MC TEST CARD^251210199998888777766665555444433332?;5473500000000014=25121019999888877776?", "F505AD81659AA42A3D123412324000AB", true); $this->assertNotNull($debitReturn); $this->assertEquals("00", $debitReturn->responseCode); }
/** * Creates a return transaction through the HpsDebitService */ public function execute() { parent::execute(); $returnSvc = new HpsDebitService($this->service->servicesConfig()); return $returnSvc->returnDebit($this->transactionId, $this->amount, $this->trackData, $this->pinBlock, $this->allowDuplicates, $this->cardHolder, $this->encryptionData, $this->details, $this->clientTransactionId); }