Gateway   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
lcom 3
cbo 1
dl 0
loc 62
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getDefaultParameters() 0 9 1
A setMerchantId() 0 4 1
A getMerchantId() 0 4 1
A setSignature() 0 4 1
A getSignature() 0 4 1
A setTransTime() 0 4 1
A getTransTime() 0 4 1
A purchase() 0 4 1
A completePurchase() 0 4 1
A refund() 0 4 1
1
<?php
2
3
namespace Omnipay\AllPay;
4
5
use Omnipay\AllPay\Message\AuthorizeRequest;
6
use Omnipay\AllPay\Message\CompletePurchaseRequest;
7
use Omnipay\AllPay\Message\PurchaseRequest;
8
use Omnipay\AllPay\Message\RefundRequest;
9
use Omnipay\Common\AbstractGateway;
10
11
/**
12
 * AllPay Gateway
13
 */
14
class Gateway extends AbstractGateway
15
{
16 3
    public function getName()
17
    {
18 3
        return 'AllPay (allpayx.com)';
19
    }
20
21 81
    public function getDefaultParameters()
22
    {
23
        return [
24 81
            'testMode' => false,
25 81
            'merchantId' => '',
26 81
            'signature' => '',
27 81
            'transTime' => date('YmdHis')
28
        ];
29
    }
30
31 12
    public function setMerchantId($value)
32
    {
33 12
        return $this->setParameter('merchantId', $value);
34
    }
35
36 3
    public function getMerchantId()
37
    {
38 3
        return $this->getParameter('merchantId');
39
    }
40
41 12
    public function setSignature($value)
42
    {
43 12
        return $this->setParameter('signature', $value);
44
    }
45
46 3
    public function getSignature()
47
    {
48 3
        return $this->getParameter('signature');
49
    }
50
51 12
    public function setTransTime($value)
52
    {
53 12
        return $this->setParameter('transTime', $value);
54
    }
55
56 3
    public function getTransTime()
57
    {
58 3
        return $this->getParameter('transTime');
59
    }
60
61 18
    public function purchase(array $options = array())
62
    {
63 18
        return $this->createRequest(PurchaseRequest::class, $options);
64
    }
65
66 12
    public function completePurchase(array $options = array())
67
    {
68 12
        return $this->createRequest(CompletePurchaseRequest::class, $options);
69
    }
70
71 12
    public function refund(array $options = array())
72
    {
73 12
        return $this->createRequest(RefundRequest::class, $options);
74
    }
75
}
76