Example #1
0
 public function testPerformTokenPaymentWrongCreditCardData()
 {
     $client = new Client('EXAMPLE_STORE', 'EXAMPLE_MERCHANT_ID', 'xyz', 'searchkey', '', null, new ClientStub());
     $response = $client->performPayment(new Transaction('sale', 'ecom', true, 'ORDER_NUMBER', 'DESCRIPTION', 'USD', 40), new Card('4000000000000002', '999', new \DateTime('2025-5')), new BillingInformation(new Customer('Forenames', 'Surname', 'Mr'), new Address('STREET_ADDRESS_LINE_1', 'STREET_ADDRESS_LINE_2', 'STREET_ADDRESS_LINE_3', 'CITY', 'REGION', 'COUNTRY', '12345'), '*****@*****.**', '192.168.0.1'), new Browser('BROWSER_USER_AGENT_HEADER', 'BROWSER_ACCEPT_HEADER'));
     $xml = new \SimpleXMLElement($response->getContent());
     $this->assertEquals(400, $response->getStatusCode());
     $this->assertEquals('Invalid Request', $xml->error);
 }