@@ -23,6 +23,13 @@ public function __construct($httpClient, $options)
23
23
$ this ->options = $ options ;
24
24
}
25
25
26
+ /**
27
+ * Get all payments
28
+ *
29
+ * @link https://swahilies.readme.io/reference/get-reconciliation-list-1
30
+ * @return array
31
+ * @throws \GuzzleHttp\Exception\GuzzleException
32
+ */
26
33
public function all ()
27
34
{
28
35
$ response = $ this ->httpClient ->post ('' , [
@@ -36,7 +43,14 @@ public function all()
36
43
return json_decode ((string ) $ response ->getBody (), true );
37
44
}
38
45
39
- public function create (array $ data , int $ code = 101 )
46
+ /**
47
+ * @param array $data
48
+ * @param int $code
49
+ * @return array
50
+ * @internal
51
+ * @throws \GuzzleHttp\Exception\GuzzleException
52
+ */
53
+ private function create (array $ data , int $ code = 101 )
40
54
{
41
55
$ payload = [
42
56
'api ' => 170 ,
@@ -61,16 +75,45 @@ public function create(array $data, int $code = 101)
61
75
return json_decode ((string ) $ response ->getBody (), true );
62
76
}
63
77
78
+ /**
79
+ * Make a payment request
80
+ *
81
+ * @link https://swahilies.readme.io/reference/create-check-out-order-1
82
+ * @param array $data
83
+ * @return array
84
+ */
64
85
public function request (array $ data )
65
86
{
66
87
return $ this ->create ($ data );
67
88
}
68
89
90
+ /**
91
+ * @deprecated 0.1.0 Use directRequest() instead
92
+ */
69
93
public function directPush (array $ data )
70
94
{
71
95
return $ this ->create ($ data , 104 );
72
96
}
73
97
98
+ /**
99
+ * Make a direct payment request, no checkout page is shown
100
+ * @link https://swahilies.readme.io/reference/create-check-out-order-complete-1
101
+ * @param array $data
102
+ * @return array
103
+ */
104
+ public function directRequest (array $ data )
105
+ {
106
+ return $ this ->create ($ data , 104 );
107
+ }
108
+
109
+
110
+ /**
111
+ * Get a payment by ID (Using Client Order ID)
112
+ * @link https://swahilies.readme.io/reference/get-order-status-1
113
+ * @param string $id
114
+ * @return array
115
+ * @throws \GuzzleHttp\Exception\GuzzleException
116
+ */
74
117
public function find (string $ id )
75
118
{
76
119
$ data = [
0 commit comments