RefundRequest::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
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