InternationalGateway::purchase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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