Issues (33)

src/Message/CompletePurchaseResponse.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace ByTIC\Payments\Mobilpay\Message;
4
5
use ByTIC\Omnipay\Mobilpay\Message\CompletePurchaseResponse as AbstractCompletePurchaseResponse;
6
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\CompletePurchaseResponseTrait;
7
8
/**
9
 * Class CompletePurchaseResponse
10
 * @package ByTIC\Payments\Mobilpay\Message
11
 */
12
class CompletePurchaseResponse extends AbstractCompletePurchaseResponse
13
{
14
    use CompletePurchaseResponseTrait;
15
16
    /**
17
     * @inheritDoc
18
     */
19
    public function isPending()
20
    {
21
        $model = $this->getModel();
22
        if ($model) {
23
            $status = $model->status;
0 ignored issues
show
The property status does not exist on ByTIC\Common\Payments\Mo...IsPurchasableModelTrait. Did you mean status_notes?
Loading history...
24
            if (empty($status) or $status == 'pending') {
25
                return true;
26
            }
27
        }
28
        return parent::isPending();
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function isCancelled()
35
    {
36
        $model = $this->getModel();
37
        if ($model) {
38
            if ($model->status == 'canceled') {
0 ignored issues
show
The property status does not exist on ByTIC\Common\Payments\Mo...IsPurchasableModelTrait. Did you mean status_notes?
Loading history...
39
                return true;
40
            }
41
        }
42
        return parent::isCancelled();
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function isSuccessful()
49
    {
50
        $model = $this->getModel();
51
        if ($model) {
52
            if ($model->status == 'active') {
0 ignored issues
show
The property status does not exist on ByTIC\Common\Payments\Mo...IsPurchasableModelTrait. Did you mean status_notes?
Loading history...
53
                return true;
54
            }
55
        }
56
        return parent::isSuccessful();
57
    }
58
59
    /** @noinspection PhpMissingParentCallCommonInspection
60
     * @return bool
61
     */
62
    protected function canProcessModel()
63
    {
64
        return false;
65
    }
66
}
67