PayConfirmResponse::getSignatureParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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