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

mlocati / PayWay / 5272023000

pending completion
5272023000

push

github

web-flow
Multiple fixes (#4)

* Add missing fields to build correct request signatures

* Add checks for the level3info products

* Assume that a "null" error is actually an error

* Send apiVersion with requests

* Fix iterating through response nodes

* Check response signatures

* Fix coding style

* Fix tests

51 of 51 new or added lines in 8 files covered. (100.0%)

1603 of 2134 relevant lines covered (75.12%)

1.54 hits per line

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

55.56
/src/Init/Response.php
1
<?php
2

3
namespace MLocati\PayWay\Init;
4

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

8
class Response implements JsonSerializable
9
{
10
    use BasePaymentInitResponseTrait {
11
        jsonSerialize as jsonSerializeBasePaymentInitResponse;
12
    }
13

14
    /**
15
     * @var string
16
     */
17
    protected $paymentID = '';
18

19
    /**
20
     * @var string
21
     */
22
    protected $redirectURL = '';
23

24
    /**
25
     * @return string
26
     */
27
    public function getPaymentID()
28
    {
29
        return $this->paymentID;
1✔
30
    }
31

32
    /**
33
     * @param string $value
34
     *
35
     * @return $this
36
     */
37
    public function setPaymentID($value)
38
    {
39
        $this->paymentID = (string) $value;
1✔
40

41
        return $this;
1✔
42
    }
43

44
    /**
45
     * @return string
46
     */
47
    public function getRedirectURL()
48
    {
49
        return $this->redirectURL;
1✔
50
    }
51

52
    /**
53
     * @param string $value
54
     *
55
     * @return $this
56
     */
57
    public function setRedirectURL($value)
58
    {
59
        $this->redirectURL = (string) $value;
1✔
60

61
        return $this;
1✔
62
    }
63

64
    /**
65
     * {@inheritdoc}
66
     *
67
     * @see \JsonSerializable::jsonSerialize()
68
     */
69
    #[\ReturnTypeWillChange]
70
    public function jsonSerialize()
71
    {
72
        return $this->jsonSerializeBasePaymentInitResponse() + $this->cleanupJson([
2✔
73
            'paymentID' => $this->paymentID,
2✔
74
            'redirectURL' => $this->redirectURL,
2✔
75
        ]);
2✔
76
    }
77

78
    /**
79
     * {@inheritdoc}
80
     *
81
     * see \MLocati\PayWay\Service\BaseResponseTrait::getSignatureFields()
82
     */
83
    protected function getSignatureFields()
84
    {
85
        return [
×
86
            $this->tid,
×
87
            $this->shopID,
×
88
            $this->rc,
×
89
            $this->errorDesc,
×
90
            $this->paymentID,
×
91
            $this->redirectURL,
×
92
        ];
×
93
    }
94
}
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