RefundRequest   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getAmount() 0 2 1
A setPaymentId() 0 2 1
A getPaymentId() 0 2 1
A getEndpoint() 0 3 2
A setAmount() 0 2 1
A getHttpMethod() 0 2 1
A getData() 0 9 1
1
<?php
2
3
namespace Omnipay\Myfatoorah\Message;
4
5
class RefundRequest extends AbstractRequest {
6
7
    public function getPaymentId() {
8
        return $this->getParameter('PaymentId');
9
    }
10
11
    public function setPaymentId($value) {
12
        return $this->setParameter('PaymentId', $value);
13
    }
14
15
    public function getAmount() {
16
        return $this->getParameter('Amount');
17
    }
18
19
    public function setAmount($value) {
20
        return $this->setParameter('Amount', $value);
21
    }
22
    public function getData() {
23
        $data = array(
24
            'KeyType'                 => 'PaymentId',
25
            'Key'                     => $this->getPaymentId(),
26
            'RefundChargeOnCustomer'  => false,
27
            'ServiceChargeOnCustomer' => false,
28
            'Amount'                  => $this->getAmount(),
29
        );
30
        return $data;
31
    }
32
33
    public function getHttpMethod() {
34
        return 'POST';
35
    }
36
37
    public function getEndpoint() {
38
        $endpoint = $this->getTestMode() ? $this->sandboxEndpoint : $this->productionEndpoint;
39
        return $endpoint . '/v2/MakeRefund';
40
    }
41
42
}
43