WebHooksVerification   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A verifyWebHook() 0 9 1
1
<?php
2
3
namespace Srmklive\PayPal\Traits\PayPalAPI;
4
5
trait WebHooksVerification
6
{
7
    /**
8
     * Verify a web hook from PayPal.
9
     *
10
     * @param array $data
11
     *
12
     * @throws \Throwable
13
     *
14
     * @return array|\Psr\Http\Message\StreamInterface|string
15
     *
16
     * @see https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post
17
     */
18
    public function verifyWebHook(array $data)
19
    {
20
        $this->apiEndPoint = 'v1/notifications/verify-webhook-signature';
21
22
        $this->options['json'] = $data;
23
24
        $this->verb = 'post';
25
26
        return $this->doPayPalRequest();
27
    }
28
}
29