コード例 #1
0
 /**
  * @test
  * /// <summary>Amex AVS cert test.</summary>
  */
 public function testAmexAvsShouldBeOk()
 {
     $chargeSvc = new HpsCreditService(TestServicesConfig::validMultiUseConfig());
     $response = $chargeSvc->verify(TestCreditCard::validAmexCreditCard(), TestCardHolder::certCardHolderShortZipNoStreet());
     if ($response == null) {
         $this->fail("Response is null.");
     }
     $this->assertEquals($response->responseCode, "00");
 }
コード例 #2
0
 private function chargeValidAmex($amt)
 {
     $testConfig = new TestServicesConfig();
     $chargeSvc = new HpsCreditService($testConfig->ValidMultiUseConfig());
     $response = $chargeSvc->charge($amt, "usd", TestCreditCard::validAmexCreditCard(), TestCardHolder::ValidCardHolder());
     if ($response == null) {
         $this->Fail("Response is null.");
     }
     return $response;
 }
コード例 #3
0
 /**
  * @test
  * /// Amex Reverse multi Token tests
  */
 public function testAmexMulitTokenReverseShouldBeOk()
 {
     $testConfig = new TestServicesConfig();
     $token = $this->getToken(TestCreditCard::validAmexCreditCard());
     $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");
 }
コード例 #4
0
 /**
  * @test
  * /// Amex Token refund test with token
  */
 public function testAmexTokenReverseShouldBeOk()
 {
     $testConfig = new TestServicesConfig();
     $token = $this->getToken(TestCreditCard::validAmexCreditCard());
     $chargeSvc = new HpsCreditService($testConfig->ValidMultiUseConfig());
     $reverse = $chargeSvc->reverse($token, 50, 'usd');
     $this->assertEquals('00', $reverse->responseCode);
 }
コード例 #5
0
 public function test032LevelIINoResponse()
 {
     $cardHolder = new HpsCardHolder();
     $cardHolder->address = new HpsAddress();
     $cardHolder->address->address = '6860';
     $cardHolder->address->zip = '75024';
     $response = $this->service->charge(111.13)->withCard(TestCreditCard::validAmexCreditCard())->withCardHolder($cardHolder)->withCpcReq(true)->execute();
     $this->assertEquals(true, $response != null);
     $this->assertEquals('00', $response->responseCode);
     $this->assertEquals('0', $response->cpcIndicator);
     $cpcData = new HpsCPCData('9876543210', HpsTaxType::TAX_EXEMPT);
     $cpcResponse = $this->service->cpcEdit($response->transactionId)->withCpcData($cpcData)->execute();
     $this->assertEquals(true, $cpcResponse != null);
     $this->assertEquals('00', $cpcResponse->responseCode);
 }
コード例 #6
0
 public function testAuthAndReversalAmex()
 {
     $amount = '63.00';
     $card = TestCreditCard::validAmexCreditCard();
     $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");
 }