PurchaseRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 2
dl 0
loc 25
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendData() 0 4 1
A getData() 0 17 1
1
<?php
2
/**
3
 * ePayService driver for the Omnipay PHP payment processing library.
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-epayservice
6
 * @package   omnipay-epayservice
7
 * @license   MIT
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\ePayService\Message;
12
13
class PurchaseRequest extends AbstractRequest
14
{
15 3
    public function getData()
16
    {
17 3
        $this->validate(
18 3
            'purse',
19 3
            'amount', 'currency', 'description',
20 3
            'returnUrl', 'cancelUrl', 'notifyUrl'
21 3
        );
22
23
        return [
24 3
            'EPS_DESCRIPTION' => $this->getDescription(),
25 3
            'EPS_GUID'        => $this->getPurse(),
26 3
            'EPS_AMOUNT'      => $this->getAmount(),
27 3
            'EPS_RESULT_URL'  => $this->getNotifyUrl(),
28 3
            'EPS_SUCCESS_URL' => $this->getReturnUrl(),
29 3
            'EPS_FAIL_URL'    => $this->getCancelUrl(),
30 3
        ];
31
    }
32
33 2
    public function sendData($data)
34
    {
35 2
        return $this->response = new PurchaseResponse($this, $data);
36
    }
37
}
38