* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @copyright PayPal */ namespace PaypalAddons\services\Core; use Configuration; class SandboxMode { const NAME = 'PAYPAL_SANDBOX'; protected $mode; public function __construct($mode = null) { if (is_null($mode)) { $this->mode = Configuration::get(self::NAME); } else { $this->mode = $mode; } } public function isSandbox() { return (bool) $this->mode; } public function setMode($mode) { Configuration::updateValue(self::NAME, (int) $mode); return $this; } }