Completed
Pull Request — master (#289)
by wang
01:19
created

Gateway   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 31
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
 * Created by pay-2.8.6.
4
 * Author: iwzh <[email protected]>
5
 * Date: 2019/10/11 14:16
6
 */
7
8
namespace Yansongda\Pay\Gateways\Alipay;
9
10
use Yansongda\Pay\Contracts\GatewayInterface;
11
use Yansongda\Pay\Exceptions\InvalidArgumentException;
12
use Yansongda\Supports\Collection;
13
14
abstract class Gateway implements GatewayInterface
15
{
16
    /**
17
     * Mode.
18
     *
19
     * @var string
20
     */
21
    protected $mode;
22
23
    /**
24
     * Gateway constructor.
25
     * @throws InvalidArgumentException
26
     */
27
    public function __construct()
28
    {
29
        $this->mode = Support::getInstance()->mode;
30
    }
31
32
    /**
33
     * Pay an order.
34
     *
35
     * @author yansongda <[email protected]>
36
     *
37
     * @param string $endpoint
38
     * @param array  $payload
39
     *
40
     * @return Collection
41
     */
42
    abstract public function pay($endpoint, array $payload);
43
44
}