JFIF  x x C         C     "        } !1AQa "q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz        w !1AQ aq"2B #3Rbr{ gilour

File "HasToggleWebhook.php"

Full Path: /var/www/laravel_filter/vendor/luigel/laravel-paymongo/src/Traits/HasToggleWebhook.php
File size: 1.11 KB
MIME-type: text/x-php
Charset: utf-8

<?php

namespace Luigel\Paymongo\Traits;

use Luigel\Paymongo\Models\BaseModel;
use Luigel\Paymongo\Models\Webhook;

trait HasToggleWebhook
{
    /**
     * Enables the webhook.
     *
     * @param  Webhook  $webhook
     * @return BaseModel
     */
    public function enable(Webhook $webhook)
    {
        $this->method = 'POST';
        $this->apiUrl = $this->apiUrl.$webhook->getId().'/enable';

        $this->setGuzzleOptions([
            'headers' => [
                'Accept' => 'application/json',
            ],
            'auth' => [config('paymongo.secret_key'), ''],
        ]);

        return $this->request();
    }

    /**
     * Disables the webhook.
     *
     * @param  Webhook  $webhook
     * @return BaseModel
     */
    public function disable(Webhook $webhook)
    {
        $this->method = 'POST';
        $this->apiUrl = $this->apiUrl.$webhook->getId().'/disable';

        $this->setGuzzleOptions([
            'headers' => [
                'Accept' => 'application/json',
            ],
            'auth' => [config('paymongo.secret_key'), ''],
        ]);

        return $this->request();
    }
}