public function testTwoRequestsWhenRequestOneFailWithDirectLink() { $this->api->setUrls(array('http://test', 'http://test')); $this->senderMock->expects($this->exactly(2))->method('shouldRetry')->will($this->returnValue(true)); $this->senderMock->expects($this->exactly(2))->method('send')->with('http://test/front/service/rest/process', array('method' => 'capture', 'params' => array('IDENTIFIER' => 'i', 'TRANSACTIONID' => 'A1', 'OPERATIONTYPE' => 'capture', 'ORDERID' => 42, 'VERSION' => '2.0', 'HASH' => 'dummy', 'DESCRIPTION' => 'desc')))->will($this->returnValueMap(array(false, array('CODE' => '0000')))); $this->api->capture('A1', 42, 'desc'); }
/** * @param $params * @return array */ protected function prepareTransactionParameters($params) { $params['IDENTIFIER'] = $this->api->getIdentifier(); $params = array_filter($params); $params['HASH'] = $this->api->hash($params); return $params; }
public function testSetDefaultApiVersion() { $this->api->setVersion('3.0'); $this->senderMock->expects($this->once())->method('send')->with('http://test/front/service/rest/process', array('method' => 'payment', 'params' => array('AMOUNT' => 100, 'IDENTIFIER' => 'i', 'OPERATIONTYPE' => 'payment', 'ORDERID' => 42, 'CLIENTIDENT' => 'ident', 'CLIENTEMAIL' => '*****@*****.**', 'CLIENTIP' => '1.1.1.1', 'CLIENTUSERAGENT' => 'Firefox', 'VERSION' => '3.0', 'HASH' => 'dummy', 'DESCRIPTION' => 'desc', 'CARDCODE' => '1111222233334444', 'CARDCVV' => '123', 'CARDVALIDITYDATE' => '01-12', 'CARDFULLNAME' => 'john doe'))); $this->api->payment('1111222233334444', '01-12', '123', 'john doe', 100, 42, 'ident', '*****@*****.**', '1.1.1.1', 'desc', 'Firefox'); }