<commit_before><?php

namespace ByTIC\Payments\Gateways\Providers\Mobilpay\Message;

use ByTIC\Omnipay\Mobilpay\Message\CompletePurchaseResponse as AbstractCompletePurchaseResponse;
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\CompletePurchaseResponseTrait;

/**
 * Class CompletePurchaseResponse
 * @package ByTIC\Payments\Gateways\Providers\Mobilpay\Message
 */
class CompletePurchaseResponse extends AbstractCompletePurchaseResponse
{
    use CompletePurchaseResponseTrait;

    /**
     * @inheritDoc
     */
    public function isPending()
    {
        $model = $this->getModel();
        if ($model) {
            if (empty($model->status) or $model->status === 'pending') {
                return true;
            }
        }
        return parent::isPending();
    }

    /**
     * @inheritDoc
     */
    public function isCancelled()
    {
        $model = $this->getModel();
        if ($model) {
            if (empty($model->status) or $model->status === 'canceled') {
                return true;
            }
        }
        return parent::isCancelled();
    }

    /**
     * @inheritDoc
     */
    public function isSuccessful()
    {
        $model = $this->getModel();
        if ($model) {
            if (empty($model->status) or $model->status === 'active') {
                return true;
            }
        }
        return parent::isSuccessful();
    }

    /** @noinspection PhpMissingParentCallCommonInspection
     * @return bool
     */
    protected function canProcessModel()
    {
        return false;
    }
}
<commit_msg>fix get status on mobilpay<commit_after><?php

namespace ByTIC\Payments\Gateways\Providers\Mobilpay\Message;

use ByTIC\Omnipay\Mobilpay\Message\CompletePurchaseResponse as AbstractCompletePurchaseResponse;
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\CompletePurchaseResponseTrait;

/**
 * Class CompletePurchaseResponse
 * @package ByTIC\Payments\Gateways\Providers\Mobilpay\Message
 */
class CompletePurchaseResponse extends AbstractCompletePurchaseResponse
{
    use CompletePurchaseResponseTrait;

    /**
     * @inheritDoc
     */
    public function isPending()
    {
        $model = $this->getModel();
        if ($model) {
            if (empty($model->status) or $model->status === 'pending') {
                return true;
            }
        }
        return parent::isPending();
    }

    /**
     * @inheritDoc
     */
    public function isCancelled()
    {
        $model = $this->getModel();
        if ($model) {
            if ($model->status === 'canceled') {
                return true;
            }
        }
        return parent::isCancelled();
    }

    /**
     * @inheritDoc
     */
    public function isSuccessful()
    {
        $model = $this->getModel();
        if ($model) {
            if ($model->status === 'active') {
                return true;
            }
        }
        return parent::isSuccessful();
    }

    /** @noinspection PhpMissingParentCallCommonInspection
     * @return bool
     */
    protected function canProcessModel()
    {
        return false;
    }
}

{'fraction_non_alphanumeric': 0.12042051608792609, 'fraction_numerical': 0.0, 'mean_word_length': 2.11199207135778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5034683', 'n_tokens_mistral': 900, 'n_tokens_neox': 901, 'n_words': 158}