/** * @test * /// MasterCard Reverse multi Token tests */ public function testMasterCardMultiTokenReverseShouldBeOk() { $testConfig = new TestServicesConfig(); $token = $this->getToken(TestCreditCard::validMasterCreditCard()); $chargeSvc = new HpsCreditService($testConfig->ValidMultiUseConfig()); $chargeResponse = $chargeSvc->charge(17.01, 'usd', $token, null, true); $this->assertEquals($chargeResponse->responseCode, "0"); $muToken = $chargeResponse->tokenData; $response = $chargeSvc->reverse($muToken, 17.01, "usd"); $this->assertEquals($response->responseCode, "0"); }
/** * @test * /// MasterCard Token refund test with token */ public function testMasterCardTokenReverseShouldBeOk() { $testConfig = new TestServicesConfig(); $token = $this->getToken(TestCreditCard::validMasterCreditCard()); $chargeSvc = new HpsCreditService($testConfig->ValidMultiUseConfig()); $reverse = $chargeSvc->reverse($token, 50, 'usd'); $this->assertEquals('00', $reverse->responseCode); }
/** * @test * /// MasterCard authorize and capture should return response code '00'. */ public function testMasterCardAuthorizeAndCaptureShouldReturnOk() { $chargeService = new HpsCreditService(TestServicesConfig::validMultiUseConfig()); $auth = $chargeService->authorize(17.07, "usd", TestCreditCard::validMasterCreditCard(), TestCardHolder::ValidCardHolder()); $this->assertEquals("00", $auth->responseCode); $capture = $chargeService->capture($auth->transactionId, 17.07); $this->assertEquals("0", $capture->responseCode); }
public function testAuthAndReversalMasterCard() { $amount = '61.00'; $card = TestCreditCard::validMasterCreditCard(); $card->cvv = null; $chargeSvc = new HpsCreditService(TestServicesConfig::validMultiUseConfig()); $response = $chargeSvc->authorize($amount, "usd", $card); $chargeSvc->capture($response->transactionId); $chargeSvc->reverse($response->transactionId, $amount, 'usd'); if ($response == null) { $this->fail("Response is null."); } $this->assertEquals($response->responseCode, "00"); }
private function chargeValidMasterCard($amt) { $testConfig = new TestServicesConfig(); $chargeSvc = new HpsCreditService($testConfig->validMultiUseConfig()); $response = $chargeSvc->charge($amt, "usd", TestCreditCard::validMasterCreditCard(), TestCardHolder::ValidCardHolder()); if ($response == null) { $this->fail("Response is null."); } return $response; }