CompleteAuthorizeRequest::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

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