CompleteAuthorizeRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 11 1
A getHttpMethod() 0 2 1
A getEndpoint() 0 3 2
1
<?php
2
3
namespace Omnipay\Myfatoorah\Message;
4
5
class CompleteAuthorizeRequest extends AbstractRequest {
6
7
    public function getData() {
8
        $data                       = array();
9
        $data['InvoiceValue']       = $this->getAmount();
10
        $data['CustomerReference']  = $this->getOrderRef();
11
        $data['DisplayCurrencyIso'] = $this->getCurrency();
12
        $data['CallBackUrl']        = $this->getCallBackUrl();
13
        $data['ErrorUrl']           = $this->getCallBackUrl();
14
        $data['CustomerName']       = $this->getFirstName() . ' ' . $this->getLastName();
15
        $data['CustomerEmail']      = $this->getEmail();
16
        $data['NotificationOption'] = "LNK";
17
        return $data;
18
    }
19
20
    public function getHttpMethod() {
21
        return 'POST';
22
    }
23
24
    public function getEndpoint() {
25
        $endpoint = $this->getTestMode() ? $this->sandboxEndpoint : $this->productionEndpoint;
26
        return $endpoint . '/v2/sendPayment';
27
    }
28
29
}
30