InternationalGateway   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 46
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A purchase() 0 4 1
A completePurchase() 0 4 1
A notification() 0 4 1
A queryTransaction() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-onepay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\OnePay;
10
11
use Omnipay\OnePay\Message\IncomingRequest;
12
use Omnipay\OnePay\Message\International\PurchaseRequest;
13
use Omnipay\OnePay\Message\International\QueryTransactionRequest;
14
15
/**
16
 * @author Vuong Minh <[email protected]>
17
 * @since 1.0.0
18
 */
19
class InternationalGateway extends AbstractGateway
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getName(): string
25
    {
26
        return 'OnePay International';
27
    }
28
29
    /**
30
     *{@inheritdoc}
31
     * @return \Omnipay\Common\Message\AbstractRequest|PurchaseRequest
32
     */
33
    public function purchase(array $options = []): PurchaseRequest
34
    {
35
        return $this->createRequest(PurchaseRequest::class, $options);
36
    }
37
38
    /**
39
     *{@inheritdoc}
40
     * @return \Omnipay\Common\Message\AbstractRequest|IncomingRequest
41
     */
42
    public function completePurchase(array $options = []): IncomingRequest
43
    {
44
        return $this->createRequest(IncomingRequest::class, $options);
45
    }
46
47
    /**
48
     *{@inheritdoc}
49
     * @return \Omnipay\Common\Message\AbstractRequest|IncomingRequest
50
     */
51
    public function notification(array $options = []): IncomingRequest
52
    {
53
        return $this->createRequest(IncomingRequest::class, $options);
54
    }
55
56
    /**
57
     *{@inheritdoc}
58
     * @return \Omnipay\Common\Message\AbstractRequest|QueryTransactionRequest
59
     */
60
    public function queryTransaction(array $options = []): QueryTransactionRequest
61
    {
62
        return $this->createRequest(QueryTransactionRequest::class, $options);
63
    }
64
}
65