Code Duplication    Length = 8-8 lines in 2 locations

src/Intraface/modules/onlinepayment/OnlinePayment.php 2 locations

@@ 199-206 (lines=8) @@
196
197
        $validator->isString($input['text'], 'text er ikke en gyldig streng', '', 'allow_empty');
198
199
        if ($validator->isDouble($input['amount'], 'amount er ikke et gyldigt beløb')) {
200
            $amount = new Intraface_Amount($input['amount']);
201
            if ($amount->convert2db()) {
202
                $input['amount'] = $amount->get();
203
            } else {
204
                $this->error->set("Kunne ikke konvertere amount til databasen!");
205
            }
206
        }
207
208
        if ($this->error->isError()) {
209
            return 0;
@@ 279-286 (lines=8) @@
276
277
        $validator = new Intraface_Validator($this->error);
278
279
        if ($validator->isDouble($input['dk_amount'], 'Beløb er ikke et gyldigt beløb', 'greater_than_zero')) {
280
            $amount = new Intraface_Amount($input['dk_amount']);
281
            if ($amount->convert2db()) {
282
                $input['amount'] = $amount->get();
283
            } else {
284
                $this->error->set("Kunne ikke konvertere amount til databasen!");
285
            }
286
        }
287
288
        if ($input['amount'] > $this->get('original_amount')) {
289
            $this->error->set("Du kan ikke sætte beløbet højere end hvad kunden har godkendt: ".$this->get('dk_original_amount'));