| Total Complexity | 2 |
| Total Lines | 54 |
| 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($capture_id) |
||
| 19 | { |
||
| 20 | $this->apiEndPoint = "v2/payments/captures/{$capture_id}"; |
||
|
1 ignored issue
–
show
|
|||
| 21 | $this->apiUrl = collect([$this->apiUrl, $this->apiEndPoint])->implode('/'); |
||
|
1 ignored issue
–
show
|
|||
| 22 | |||
| 23 | $this->verb = 'get'; |
||
|
1 ignored issue
–
show
|
|||
| 24 | |||
| 25 | return $this->doPayPalRequest(); |
||
|
1 ignored issue
–
show
|
|||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Refund a captured payment. |
||
| 30 | * |
||
| 31 | * @param string $capture_id |
||
| 32 | * @param string $invoice_id |
||
| 33 | * @param float $amount |
||
| 34 | * @param string $note |
||
| 35 | * |
||
| 36 | * @throws \Throwable |
||
| 37 | * |
||
| 38 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
| 39 | * |
||
| 40 | * @see https://developer.paypal.com/docs/api/payments/v2/#captures_refund |
||
| 41 | */ |
||
| 42 | public function refundCapturedPayment($capture_id, $invoice_id, $amount, $note) |
||
| 59 | } |
||
| 60 | } |
||
| 61 |