HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/alq-cali.bikenow.co/vendor/transbank/transbank-sdk/src/Onepay/Options.php
<?php

namespace Transbank\Onepay;

 /**
  * class Options
  *  Options object used when sending a request to Onepay.
  */
 class Options implements \JsonSerializable
 {
     private $apiKey;
     private $appKey;
     private $sharedSecret;
     /**
      * @var int A number used as width and height for the
      *     QR displayed by the front end JS SDK.
      */
     private $qrWidthHeight;
     /**
      * @var string URL for the merchant's logo,
      *     used by the front end JS SDK.
      */
     private $commerceLogoUrl;

     // Supported PHP versions do not allow setting the result of functions
     // as default values as of this writing (Dec 4th, 2018), so we use these
     // constants, since we cannot use null (the user might want to send null as
     // param and not have it take OnepayBase values) nor can we let them have no
     // value (since there are optional params before mandatory params, in which
     // case having that would be confusing or API breaking)
     const __DEFAULT_QR_WIDTH_HEIGHT__ = '__DEFAULT_QR_WIDTH_HEIGHT__';
     const __DEFAULT_COMMERCE_LOGO_URL__ = '__DEFAULT_COMMERCE_LOGO_URL__';

     public function __construct(
         $apiKey = null,
         $sharedSecret = null,
         $qrWidthHeight = self::__DEFAULT_QR_WIDTH_HEIGHT__,
         $commerceLogoUrl = self::__DEFAULT_COMMERCE_LOGO_URL__
     ) {
         $this->setApiKey($apiKey);
         $this->setSharedSecret($sharedSecret);
         $this->setQrWidthHeight($qrWidthHeight);
         $this->setCommerceLogoUrl($commerceLogoUrl);

         $this->setAppKey(OnepayBase::getCurrentIntegrationTypeAppKey());
     }

     public static function getDefaults()
     {
         return new Options(
             OnepayBase::getApiKey(),
             OnepayBase::getSharedSecret(),
             OnepayBase::getQrWidthHeight(),
             OnepayBase::getCommerceLogoUrl()
         );
     }

     public function jsonSerialize()
     {
         return get_object_vars($this);
     }

     public function getApiKey()
     {
         return $this->apiKey;
     }

     public function setApiKey($apiKey)
     {
         $this->apiKey = $apiKey;

         return $this;
     }

     public function getAppKey()
     {
         return $this->appKey;
     }

     public function setAppKey($appKey)
     {
         $this->appKey = $appKey;

         return $this;
     }

     public function getSharedSecret()
     {
         return $this->sharedSecret;
     }

     public function setSharedSecret($sharedSecret)
     {
         $this->sharedSecret = $sharedSecret;

         return $this;
     }

     /**
      * @return int|null
      */
     public function getQrWidthHeight()
     {
         return $this->qrWidthHeight;
     }

     /**
      * @param int|null $qrWidthHeight
      *
      * @return $this
      */
     public function setQrWidthHeight($qrWidthHeight)
     {
         if ($qrWidthHeight == self::__DEFAULT_QR_WIDTH_HEIGHT__) {
             $qrWidthHeight = OnepayBase::getQrWidthHeight();
         }
         $this->qrWidthHeight = $qrWidthHeight;

         return $this;
     }

     /**
      * @return string|null
      */
     public function getCommerceLogoUrl()
     {
         return $this->commerceLogoUrl;
     }

     /**
      * @param string|null $commerceLogoUrl
      *
      * @return $this
      */
     public function setCommerceLogoUrl($commerceLogoUrl)
     {
         if ($commerceLogoUrl == self::__DEFAULT_COMMERCE_LOGO_URL__) {
             $commerceLogoUrl = OnepayBase::getCommerceLogoUrl();
         }
         $this->commerceLogoUrl = $commerceLogoUrl;

         return $this;
     }
 }