PurchaseRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 4 1
A getAuthorizeResponse() 0 3 1
A setAuthorizeResponse() 0 3 1
1
<?php
2
3
namespace ByTIC\Omnipay\PlatiOnline\Message;
4
5
use Omnipay\Common\Message\AbstractRequest as CommonAbstractRequest;
6
7
/**
8
 * Class PurchaseRequest
9
 * @package ByTIC\Omnipay\PlatiOnline\Message
10
 *
11
 * @method PurchaseResponse send()
12
 */
13
class PurchaseRequest extends CommonAbstractRequest
14
{
15
    use \ByTIC\Omnipay\Common\Message\Traits\ParametersTrait;
16
    use \ByTIC\Omnipay\Common\Message\Traits\HasLanguageRequestTrait;
17
    use \ByTIC\Omnipay\Common\Message\Traits\SendDataRequestTrait;
18
19
    /**
20
     * @inheritDoc
21
     */
22
    public function getData()
23
    {
24
        return [
25
            'redirectUrl' => $this->getAuthorizeResponse()->getRedirectUrl()
26
        ];
27
    }
28
29
    /**
30
     * @param AuthorizeResponse $response
31
     */
32
    public function setAuthorizeResponse($response)
33
    {
34
        $this->setParameter('authorizeResponse', $response);
35
    }
36
37
    /**
38
     * @return AuthorizeResponse
39
     */
40
    public function getAuthorizeResponse()
41
    {
42
        return $this->getParameter('authorizeResponse');
43
    }
44
}
45