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

Gateway::__construct()   A

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 0
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
}