Completed
Push — master ( 558fc2...aa58a2 )
by Vuong
01:31
created

RefundRequest::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
/**
11
 * @link https://developers.momo.vn/#/docs/aio/?id=ho%c3%a0n-ti%e1%bb%81n-giao-d%e1%bb%8bch
12
 *
13
 * @author Vuong Minh <[email protected]>
14
 * @since 1.0.0
15
 */
16
class RefundRequest extends AbstractSignatureRequest
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $responseClass = RefundResponse::class;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function initialize(array $parameters = [])
27
    {
28
        parent::initialize($parameters);
29
        $this->setParameter('requestType', 'refundMoMoWallet');
30
31
        return $this;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getTransactionId(): ?string
38
    {
39
        return $this->getTransId();
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function setTransactionId($value)
46
    {
47
        return $this->setTransId($value);
48
    }
49
50
    /**
51
     * Trả về mã giao dịch của MoMo.
52
     *
53
     * @return null|string
54
     */
55
    public function getTransId(): ?string
56
    {
57
        return $this->getParameter('transId');
58
    }
59
60
    /**
61
     * Thiết lập mã giao dịch của MoMo.
62
     *
63
     * @param  string  $id
64
     * @return $this
65
     */
66
    public function setTransId(string $id)
67
    {
68
        return $this->setParameter('transId', $id);
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74
    protected function getSignatureParameters(): array
75
    {
76
        return [
77
            'partnerCode', 'accessKey', 'requestId', 'amount', 'orderId', 'transId', 'requestType',
78
        ];
79
    }
80
}
81