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

Gateway   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 31
ccs 0
cts 8
cp 0
rs 10
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setSandbox() 0 3 1
A isActive() 0 7 3
A getSandbox() 0 3 2
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