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

mlocati / PayWay / 5213927880

pending completion
5213927880

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

87.5
/src/Verify/Request/Serializer.php
1
<?php
2

3
namespace MLocati\PayWay\Verify\Request;
4

5
use MLocati\PayWay\Service\SerializerTrait;
6
use MLocati\PayWay\Verify\Request;
7

8
class Serializer
9
{
10
    use SerializerTrait;
11

12
    const NS_SOAPENVELOPE = 'http://schemas.xmlsoap.org/soap/envelope/';
13

14
    const NS_IGFS = 'http://services.api.web.cg.igfs.apps.netsw.it/';
15

16
    /**
17
     * @param string $signatureKey
18
     *
19
     * @throws \MLocati\PayWay\Exception\MissingRequiredField
20
     * @throws \MLocati\PayWay\Exception\FieldValueTooLong
21
     * @throws \MLocati\PayWay\Exception\FieldValueOutOfRange
22
     * @throws \MLocati\PayWay\Exception\InvalidFieldUrl
23
     * @throws \MLocati\PayWay\Exception\UnableToCreateSignature
24
     *
25
     * @return string
26
     */
27
    public function serialize(Request $request, $signatureKey)
28
    {
29
        $doc = $this->createDocument($request, $signatureKey);
×
30

31
        return $doc->saveXML();
×
32
    }
33

34
    /**
35
     * @param string $signatureKey
36
     *
37
     * @throws \MLocati\PayWay\Exception\UnableToCreateSignature
38
     *
39
     * @return \DOMDocument
40
     */
41
    public function createDocument(Request $request, $signatureKey)
42
    {
43
        $request->check();
1✔
44
        $init = $this->createSoapEnvelope('Verify');
1✔
45
        $doc = $init->ownerDocument;
1✔
46
        $init->appendChild($xRequest = $doc->createElement('request'));
1✔
47
        $this->appendNode($xRequest, 'apiVersion', $request->getApiVersion());
1✔
48
        $this->appendNode($xRequest, 'tid', $request->getTID());
1✔
49
        $this->appendNode($xRequest, 'merIC', $request->getMerID());
1✔
50
        $this->appendNode($xRequest, 'payInstr', $request->getPayInstr());
1✔
51
        $this->appendNode($xRequest, 'reqTime', $this->serializeDateTime($request->getReqTime()));
1✔
52
        $this->appendNode($xRequest, 'signature', $request->getSignature($signatureKey));
1✔
53
        $this->appendNode($xRequest, 'shopID', $request->getShopID());
1✔
54
        $this->appendNode($xRequest, 'paymentID', $request->getPaymentID());
1✔
55
        $this->appendNode($xRequest, 'refTranID', $this->serializeInteger($request->getRefTranID()));
1✔
56

57
        return $doc;
1✔
58
    }
59
}
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