Gateway   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
pay() 0 1 ?
1
<?php
2
3
namespace Yansongda\Pay\Gateways\Alipay;
4
5
use Yansongda\Pay\Contracts\GatewayInterface;
6
use Yansongda\Pay\Exceptions\InvalidArgumentException;
7
use Yansongda\Supports\Collection;
8
9
abstract class Gateway implements GatewayInterface
10
{
11
    /**
12
     * Mode.
13
     *
14
     * @var string
15
     */
16
    protected $mode;
17
18
    /**
19
     * Bootstrap.
20
     *
21
     * @author yansongda <[email protected]>
22
     *
23
     * @throws InvalidArgumentException
24
     */
25
    public function __construct()
26
    {
27
        $this->mode = Support::getInstance()->mode;
28
    }
29
30
    /**
31
     * Pay an order.
32
     *
33
     * @author yansongda <[email protected]>
34
     *
35
     * @param string $endpoint
36
     * @param array  $payload
37
     *
38
     * @return Collection
39
     */
40
    abstract public function pay($endpoint, array $payload);
41
}
42