Passed
Push — master ( 231fe1...5105bf )
by Gabriel
05:58
created

Gateway::setSandbox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ByTIC\Payments\Gateways\Providers\PlatiOnline;
4
5
use ByTIC\Omnipay\PlatiOnline\Gateway as AbstractGateway;
6
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Traits\GatewayTrait;
7
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Traits\OverwriteServerCompletePurchaseTrait;
8
9
/**
10
 * Class Gateway
11
 * @package ByTIC\Payments\Gateways\Providers\Mobilpay
12
 */
13
class Gateway extends AbstractGateway
14
{
15
    use GatewayTrait;
16
    use OverwriteServerCompletePurchaseTrait;
17
18
    /**
19
     * @inheritDoc
20
     */
21
    public function setSandbox($value)
22
    {
23
        return $this->setTestMode($value == 'yes');
24
    }
25
26
    /**
27
     * @inheritDoc
28
     */
29
    public function getSandbox()
30
    {
31
        return $this->getTestMode() === true ? 'yes' : 'no';
32
    }
33
34
    /**
35
     * @return bool
36
     */
37
    public function isActive()
38
    {
39
        if (strlen($this->getPublicKey()) >= 5 && strlen($this->getPrivateKey()) > 10) {
40
            return true;
41
        }
42
43
        return false;
44
    }
45
}
46