PayConfirmResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSignatureParameters() 0 9 1
A getCode() 0 4 1
A getTransactionReference() 0 4 1
A getTransactionId() 0 4 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;
9
10
/**
11
 * @author Vuong Minh <[email protected]>
12
 * @since 1.0.0
13
 */
14
class PayConfirmResponse extends AbstractSignatureResponse
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected function getSignatureParameters(): array
20
    {
21
        return [
22
            'amount' => 'data.amount',
23
            'momoTransId' => 'data.momoTransId',
24
            'partnerCode' => 'data.partnerCode',
25
            'partnerRefId' => 'data.partnerRefId',
26
        ];
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function getCode(): ?string
33
    {
34
        return $this->data['status'] ?? null;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getTransactionReference(): ?string
41
    {
42
        return $this->data['data']['momoTransId'] ?? null;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getTransactionId(): ?string
49
    {
50
        return $this->data['data']['partnerRefId'] ?? null;
51
    }
52
}
53