GatewayApplicationInterface
last analyzed

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 80
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
pay() 0 1 ?
find() 0 1 ?
refund() 0 1 ?
cancel() 0 1 ?
close() 0 1 ?
verify() 0 1 ?
success() 0 1 ?
1
<?php
2
3
namespace Yansongda\Pay\Contracts;
4
5
use Symfony\Component\HttpFoundation\Response;
6
use Yansongda\Supports\Collection;
7
8
interface GatewayApplicationInterface
9
{
10
    /**
11
     * To pay.
12
     *
13
     * @author yansongda <[email protected]>
14
     *
15
     * @param string $gateway
16
     * @param array  $params
17
     *
18
     * @return Collection|Response
19
     */
20
    public function pay($gateway, $params);
21
22
    /**
23
     * Query an order.
24
     *
25
     * @author yansongda <[email protected]>
26
     *
27
     * @param string|array $order
28
     * @param string       $type
29
     *
30
     * @return Collection
31
     */
32
    public function find($order, string $type);
33
34
    /**
35
     * Refund an order.
36
     *
37
     * @author yansongda <[email protected]>
38
     *
39
     * @param array $order
40
     *
41
     * @return Collection
42
     */
43
    public function refund(array $order);
44
45
    /**
46
     * Cancel an order.
47
     *
48
     * @author yansongda <[email protected]>
49
     *
50
     * @param string|array $order
51
     *
52
     * @return Collection
53
     */
54
    public function cancel($order);
55
56
    /**
57
     * Close an order.
58
     *
59
     * @author yansongda <[email protected]>
60
     *
61
     * @param string|array $order
62
     *
63
     * @return Collection
64
     */
65
    public function close($order);
66
67
    /**
68
     * Verify a request.
69
     *
70
     * @author yansongda <[email protected]>
71
     *
72
     * @param string|array|null $content
73
     * @param bool              $refund
74
     *
75
     * @return Collection
76
     */
77
    public function verify($content, bool $refund);
78
79
    /**
80
     * Echo success to server.
81
     *
82
     * @author yansongda <[email protected]>
83
     *
84
     * @return Response
85
     */
86
    public function success();
87
}
88