public function testCorrect() { // auth $input = $this->doPrepareAuthInput(); $input['pan'] = BankCard::getValidCustomPan(); $data = $this->callGateway(Type::AUTH, $input); $this->assertEquals('00', $data->rc, print_r($data, true)); // double $dataError = $this->callGateway(Type::AUTH, $input); $this->assertEquals('-3', $dataError->rc, print_r($dataError, true)); // complete $input = array('term' => $data->term, 'order' => $data->order, 'amount' => $data->amount, 'cur' => $data->cur, 'rrn' => $data->rrn, 'irn' => $data->irn, 'time' => Time::ts()); $data = $this->callGateway(Type::COMPLETE, $input); $this->assertEquals('00', $data->rc, print_r($data, true)); $count = Payment::count(); // double complete $dataError = $this->callGateway(Type::COMPLETE, $input); $this->assertEquals('00', $dataError->rc, print_r($dataError, true)); $this->assertEquals($count, Payment::count()); // refund $data = $this->callGateway(Type::REFUND, $input); $this->assertEquals('00', $data->rc, print_r($data, true)); $count = Payment::count(); // double refund $data = $this->callGateway(Type::REFUND, $input); $this->assertEquals('00', $data->rc, print_r($data, true)); $this->assertEquals($count, Payment::count()); }