Gateway::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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