Total Complexity | 2 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait PaymentCaptures |
||
6 | { |
||
7 | /** |
||
8 | * Show details for a captured payment. |
||
9 | * |
||
10 | * @param string $capture_id |
||
11 | * |
||
12 | * @throws \Throwable |
||
13 | * |
||
14 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
15 | * |
||
16 | * @see https://developer.paypal.com/docs/api/payments/v2/#captures_get |
||
17 | */ |
||
18 | public function showCapturedPaymentDetails(string $capture_id) |
||
19 | { |
||
20 | $this->apiEndPoint = "v2/payments/captures/{$capture_id}"; |
||
21 | |||
22 | $this->verb = 'get'; |
||
23 | |||
24 | return $this->doPayPalRequest(); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Refund a captured payment. |
||
29 | * |
||
30 | * @param string $capture_id |
||
31 | * @param string $invoice_id |
||
32 | * @param float $amount |
||
33 | * @param string $note |
||
34 | * |
||
35 | * @throws \Throwable |
||
36 | * |
||
37 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
38 | * |
||
39 | * @see https://developer.paypal.com/docs/api/payments/v2/#captures_refund |
||
40 | */ |
||
41 | public function refundCapturedPayment(string $capture_id, string $invoice_id, float $amount, string $note) |
||
57 | } |
||
58 | } |
||
59 |