AbstractSignatureResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCode() 0 4 1
A getTransactionId() 0 4 1
A getTransactionReference() 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\AllInOne;
9
10
use Omnipay\MoMo\Message\AbstractSignatureResponse as BaseAbstractSignatureResponse;
11
12
/**
13
 * @author Vuong Minh <[email protected]>
14
 * @since 1.0.0
15
 */
16
abstract class AbstractSignatureResponse extends BaseAbstractSignatureResponse
17
{
18
    /**
19
     * Trả về mã báo lỗi từ MoMo. Nếu là 0 thì tương đương với thành công.
20
     *
21
     * @return null|string
22
     */
23
    public function getCode(): ?string
24
    {
25
        return $this->data['errorCode'] ?? null;
26
    }
27
28
    /**
29
     * Trả về mã đơn hàng, dùng để đối soát.
30
     *
31
     * @return null|string
32
     */
33
    public function getTransactionId(): ?string
34
    {
35
        return $this->data['orderId'] ?? null;
36
    }
37
38
    /**
39
     * Trả về transaction reference theo Response.
40
     *
41
     * @return null|string
42
     */
43
    public function getTransactionReference(): ?string
44
    {
45
        return $this->data['transId'] ?? null;
46
    }
47
}
48