PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in /home/foruwedy/public_html/57dae0/index.php on line 8
$#$#$#

Dir : /home/foruwedy/public_html/vendor/srmklive/paypal/src/Traits/
Server: Linux premium227.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
IP: 66.29.146.38
Choose File :

Url:
Dir : /home/foruwedy/public_html/vendor/srmklive/paypal/src/Traits/PayPalVerifyIPN.php

<?php

namespace Srmklive\PayPal\Traits;

trait PayPalVerifyIPN
{
    protected $webhook_id;

    public function setWebHookID(string $webhook_id): \Srmklive\PayPal\Services\PayPal
    {
        $this->webhook_id = $webhook_id;

        return $this;
    }

    /**
     * Verify incoming IPN through a web hook id.
     *
     * @throws \Throwable
     *
     * @return array|\Psr\Http\Message\StreamInterface|string
     */
    public function verifyIPN(\Illuminate\Http\Request $request)
    {
        $headers = array_change_key_case($request->headers->all(), CASE_UPPER);

        if (!isset($headers['PAYPAL-AUTH-ALGO'][0]) ||
            !isset($headers['PAYPAL-TRANSMISSION-ID'][0]) ||
            !isset($headers['PAYPAL-CERT-URL'][0]) ||
            !isset($headers['PAYPAL-TRANSMISSION-SIG'][0]) ||
            !isset($headers['PAYPAL-TRANSMISSION-TIME'][0]) ||
            !isset($this->webhook_id)
        ) {
            \Log::error('Invalid headers or webhook id supplied for paypal webhook');

            return ['error' => 'Invalid headers or webhook id provided'];
        }

        $params = $request->all();

        $payload = [
            'auth_algo'         => $headers['PAYPAL-AUTH-ALGO'][0],
            'cert_url'          => $headers['PAYPAL-CERT-URL'][0],
            'transmission_id'   => $headers['PAYPAL-TRANSMISSION-ID'][0],
            'transmission_sig'  => $headers['PAYPAL-TRANSMISSION-SIG'][0],
            'transmission_time' => $headers['PAYPAL-TRANSMISSION-TIME'][0],
            'webhook_id'        => $this->webhook_id,
            'webhook_event'     => $params,
        ];

        return $this->verifyWebHook($payload);
    }
}