Passed
Push — main ( 3c3fe2...9e797e )
by Gabriel
02:44
created

ServerCompletePurchaseResponse::getStatus1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ByTIC\Omnipay\PlatiOnline\Message;
4
5
use ByTIC\Omnipay\Common\Message\Traits\GatewayNotificationResponseTrait;
6
use ByTIC\Omnipay\Mobilpay\Models\Request\Card;
0 ignored issues
show
Bug introduced by
The type ByTIC\Omnipay\Mobilpay\Models\Request\Card was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use ByTIC\Omnipay\Mobilpay\Models\Request\Notify;
0 ignored issues
show
Bug introduced by
The type ByTIC\Omnipay\Mobilpay\Models\Request\Notify was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use DateTime;
9
10
/**
11
 * Class ServerCompletePurchaseResponse
12
 * @package ByTIC\Omnipay\PlatiOnline\Message
13
 */
14
class ServerCompletePurchaseResponse extends AbstractResponse
15
{
16
    use Traits\RelayResponseTrait;
0 ignored issues
show
introduced by
The trait ByTIC\Omnipay\PlatiOnlin...aits\RelayResponseTrait requires some properties which are not provided by ByTIC\Omnipay\PlatiOnlin...ompletePurchaseResponse: $x_response_code, $x_response_reason_text, $f_order_number, $x_response_reason_code, $x_trans_id
Loading history...
17
18
    public function send()
19
    {
20
        header('Content-type: application/xml');
21
        echo $this->getContent();
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getContent()
28
    {
29
        $stare1 = '<f_response_code>0</f_response_code>';
0 ignored issues
show
Unused Code introduced by
The assignment to $stare1 is dead and can be removed.
Loading history...
30
        $stare1 = '<f_response_code>1</f_response_code>';
31
32
        $content = '<?xml version="1.0" encoding="UTF-8" ?>';
33
        $content .= '<itsn>';
34
        $content .= '<x_trans_id>' . $this->getTransactionReference() . '</x_trans_id>';
35
        $content .= '<merchServerStamp>' . date("Y-m-d H:m:s") . '</merchServerStamp>';
36
        $content .= $stare1;
37
        $content .= '</itsn>';
38
        return $content;
39
    }
40
41
    /**
42
     * @inheritDoc
43
     * @noinspection PhpMissingReturnTypeInspection
44
     */
45
    public function getStatus1()
46
    {
47
        return (string)$this->getNotification()->status_fin1;
48
    }
49
50
    /**
51
     * @inheritDoc
52
     * @noinspection PhpMissingReturnTypeInspection
53
     */
54
    public function getStatus2()
55
    {
56
        return (string)$this->getNotification()->status_fin2;
57
    }
58
59
//    public function isCancelled()
60
//    {
61
//        return $this->get;
62
//    }
63
}
64