| Total Complexity | 4 |
| Total Lines | 84 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait WebHooksEvents |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * List all events types for web hooks. |
||
| 9 | * |
||
| 10 | * @throws \Throwable |
||
| 11 | * |
||
| 12 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
| 13 | * |
||
| 14 | * @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-event-types_list |
||
| 15 | */ |
||
| 16 | public function listEventTypes() |
||
| 17 | { |
||
| 18 | $this->apiEndPoint = 'v1/notifications/webhooks-event-types'; |
||
|
1 ignored issue
–
show
|
|||
| 19 | $this->apiUrl = collect([$this->apiUrl, $this->apiEndPoint])->implode('/'); |
||
|
1 ignored issue
–
show
|
|||
| 20 | |||
| 21 | $this->verb = 'get'; |
||
|
1 ignored issue
–
show
|
|||
| 22 | |||
| 23 | return $this->doPayPalRequest(); |
||
|
1 ignored issue
–
show
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * List all events notifications for web hooks. |
||
| 28 | * |
||
| 29 | * @throws \Throwable |
||
| 30 | * |
||
| 31 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
| 32 | * |
||
| 33 | * @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_list |
||
| 34 | */ |
||
| 35 | public function listEvents() |
||
| 36 | { |
||
| 37 | $this->apiEndPoint = 'v1/notifications/webhooks-events'; |
||
|
1 ignored issue
–
show
|
|||
| 38 | $this->apiUrl = collect([$this->apiUrl, $this->apiEndPoint])->implode('/'); |
||
|
1 ignored issue
–
show
|
|||
| 39 | |||
| 40 | $this->verb = 'get'; |
||
|
1 ignored issue
–
show
|
|||
| 41 | |||
| 42 | return $this->doPayPalRequest(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * List all events notifications for web hooks. |
||
| 47 | * |
||
| 48 | * @param string $event_id |
||
| 49 | * |
||
| 50 | * @throws \Throwable |
||
| 51 | * |
||
| 52 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
| 53 | * |
||
| 54 | * @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_get |
||
| 55 | */ |
||
| 56 | public function showEventDetails($event_id) |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Resend notification for the event. |
||
| 68 | * |
||
| 69 | * @param string $event_id |
||
| 70 | * @param array $items |
||
| 71 | * |
||
| 72 | * @throws \Throwable |
||
| 73 | * |
||
| 74 | * @return array|\Psr\Http\Message\StreamInterface|string |
||
| 75 | * |
||
| 76 | * @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_resend |
||
| 77 | */ |
||
| 78 | public function resendEventNotification($event_id, array $items) |
||
| 91 |