• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / PayWay / 5212705470

pending completion
5212705470

push

github

mlocati
Initial version

1803 of 1803 new or added lines in 47 files covered. (100.0%)

1313 of 1803 relevant lines covered (72.82%)

1.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/src/Verify/Request.php
1
<?php
2

3
namespace MLocati\PayWay\Verify;
4

5
use JsonSerializable;
6
use MLocati\PayWay\Service\BasePaymentInitRequestTrait;
7

8
class Request implements JsonSerializable
9
{
10
    use BasePaymentInitRequestTrait {
11
        jsonSerialize as jsonSerializeBasePaymentInitRequest;
12
    }
13

14
    /**
15
     * The payment ID code associated with the request.
16
     *
17
     * @var string
18
     */
19
    private $paymentID = '';
20

21
    /**
22
     * Undocumented.
23
     *
24
     * @var int|null
25
     */
26
    private $refTranID;
27

28
    /**
29
     * Get the payment ID code associated with the request.
30
     *
31
     * @return string
32
     */
33
    public function getPaymentID()
34
    {
35
        return $this->paymentID;
1✔
36
    }
37

38
    /**
39
     * Set the payment ID code associated with the request.
40
     *
41
     * @param string $value
42
     *
43
     * @return $this
44
     */
45
    public function setPaymentID($value)
46
    {
47
        $this->paymentID = (string) $value;
1✔
48

49
        return $this;
1✔
50
    }
51

52
    /**
53
     * Undocumented.
54
     *
55
     * @return int|null
56
     */
57
    public function getRefTranID()
58
    {
59
        return $this->refTranID;
1✔
60
    }
61

62
    /**
63
     * Undocumented.
64
     *
65
     * @param int|null $value
66
     *
67
     * @return $this
68
     */
69
    public function setRefTranID($value)
70
    {
71
        $this->refTranID = $value === null || $value === '' ? null : (int) $value;
×
72

73
        return $this;
×
74
    }
75

76
    /**
77
     * @throws \MLocati\PayWay\Exception\MissingRequiredField
78
     * @throws \MLocati\PayWay\Exception\FieldValueTooLong
79
     * @throws \MLocati\PayWay\Exception\FieldValueOutOfRange
80
     * @throws \MLocati\PayWay\Exception\InvalidFieldUrl
81
     */
82
    public function check()
83
    {
84
        $this->checkBasePaymentInitRequest();
1✔
85
        $this->checkStringField('paymentID', true, 32);
1✔
86
    }
87

88
    /**
89
     * {@inheritdoc}
90
     *
91
     * @see \JsonSerializable::jsonSerialize()
92
     */
93
    #[\ReturnTypeWillChange]
94
    public function jsonSerialize()
95
    {
96
        return $this->jsonSerializeBasePaymentInitRequest() + $this->cleanupJson([
1✔
97
            'paymentID' => $this->paymentID,
1✔
98
            'refTranID' => $this->refTranID,
1✔
99
        ]);
1✔
100
    }
101

102
    protected function getSignatureFields()
103
    {
104
        return [
1✔
105
            $this->tid,
1✔
106
            $this->shopID,
1✔
107
            $this->paymentID,
1✔
108
        ];
1✔
109
    }
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc