* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @copyright PayPal */ namespace PaypalAddons\classes\Webhook; use Configuration; use PaypalAddons\classes\AbstractMethodPaypal; class WebhookId { /** @var AbstractMethodPaypal */ protected $method; public function __construct(AbstractMethodPaypal $method) { $this->method = $method; } /** * @return string */ public function get() { return Configuration::get( $this->getConfName(), null, null, null, '' ); } /** * @param string $id * * @return self */ public function update($id) { Configuration::updateValue($this->getConfName(), (string) $id); return $this; } /** * @return string */ public function getConfName() { return $this->method->isSandbox() ? 'PAYPAL_WEBHOOK_ID_SANDBOX' : 'PAYPAL_WEBHOOK_ID'; } }