PurchaseResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 4 1
A isRedirect() 0 4 1
A getRedirectUrl() 0 4 1
A getSignatureParameters() 0 6 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-momo
4
 * @copyright (c) PHP Viet
5
 * @license [MIT](http://www.opensource.org/licenses/MIT)
6
 */
7
8
namespace Omnipay\MoMo\Message\AllInOne;
9
10
use Omnipay\Common\Message\RedirectResponseInterface;
11
12
/**
13
 * @author Vuong Minh <[email protected]>
14
 * @since 1.0.0
15
 */
16
class PurchaseResponse extends AbstractSignatureResponse implements RedirectResponseInterface
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function isSuccessful(): bool
22
    {
23
        return false;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function isRedirect(): bool
30
    {
31
        return isset($this->data['payUrl']);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getRedirectUrl(): string
38
    {
39
        return $this->data['payUrl'];
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    protected function getSignatureParameters(): array
46
    {
47
        return [
48
            'requestId', 'orderId', 'message', 'localMessage', 'payUrl', 'errorCode', 'requestType',
49
        ];
50
    }
51
}
52