1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Vindi; |
4
|
|
|
|
5
|
|
|
class Charge extends Resource |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* The endpoint that will hit the API. |
9
|
|
|
* |
10
|
|
|
* @return string |
11
|
|
|
*/ |
12
|
24 |
|
public function endpoint() |
13
|
|
|
{ |
14
|
24 |
|
return 'charges'; |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Make a POST request to charges/{id}/reissue. |
19
|
|
|
* |
20
|
|
|
* @param int $id The resource's id. |
21
|
|
|
* @param array $form_params |
22
|
|
|
* |
23
|
|
|
* @return mixed |
24
|
|
|
* @throws Exceptions\RateLimitException |
25
|
|
|
* @throws Exceptions\RequestException |
26
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
27
|
|
|
*/ |
28
|
2 |
|
public function reissue($id, array $form_params = []) |
29
|
|
|
{ |
30
|
2 |
|
return $this->post($id, 'reissue', $form_params); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Make a POST request to charges/{id}/charge. |
35
|
|
|
* |
36
|
|
|
* @param int $id The resource's id. |
37
|
|
|
* @param array $form_params |
38
|
|
|
* |
39
|
|
|
* @return mixed |
40
|
|
|
* @throws Exceptions\RateLimitException |
41
|
|
|
* @throws Exceptions\RequestException |
42
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
43
|
|
|
*/ |
44
|
2 |
|
public function charge($id, array $form_params = []) |
|
|
|
|
45
|
|
|
{ |
46
|
2 |
|
return $this->post($id, 'charge', $form_params); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Make a POST request to charges/{id}/refund. |
51
|
|
|
* |
52
|
|
|
* @param int $id The resource's id. |
53
|
|
|
* |
54
|
|
|
* @return mixed |
55
|
|
|
* @throws Exceptions\RateLimitException |
56
|
|
|
* @throws Exceptions\RequestException |
57
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
58
|
|
|
*/ |
59
|
2 |
|
public function refund($id) |
60
|
|
|
{ |
61
|
2 |
|
return $this->post($id, 'refund'); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Make a POST request to charges/{id}/fraud_review. |
66
|
|
|
* |
67
|
|
|
* @param int $id The resource's id. |
68
|
|
|
* |
69
|
|
|
* @return mixed |
70
|
|
|
* @throws Exceptions\RateLimitException |
71
|
|
|
* @throws Exceptions\RequestException |
72
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
73
|
|
|
*/ |
74
|
2 |
|
public function fraud_review($id) |
75
|
|
|
{ |
76
|
2 |
|
return $this->post($id, 'fraud_review'); |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|