/** * instantiates request * * a request method instance has to be passed (see examples section) * * @param InterfaceApi/String $apiCallMethod */ function __construct($apiCallMethod) { if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->init('request'); } if (is_object($apiCallMethod)) { $this->requestMethod = $apiCallMethod; if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->logTransaction(get_class($apiCallMethod)); } } elseif (is_string($apiCallMethod)) { $this->requestMethod = GiroCheckout_SDK_TransactionType_helper::getTransactionTypeByName($apiCallMethod); if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->logTransaction($apiCallMethod); } if (is_null($this->requestMethod)) { throw new GiroCheckout_SDK_Exception_helper('Failure: API call method unknown'); } } }
/** * instantiates notification * * a request method instance has to be passed (see examples section) * * @param InterfaceApi/String $apiCallMethod * @throws Exception if notification is not possible */ function __construct($apiCallMethod) { if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->init('notify'); } if (is_object($apiCallMethod)) { $this->requestMethod = $apiCallMethod; if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->logTransaction(get_class($apiCallMethod), $apiCallMethod); } } elseif (is_string($apiCallMethod)) { $this->requestMethod = GiroCheckout_SDK_TransactionType_helper::getTransactionTypeByName($apiCallMethod); if (__GIROCHECKOUT_SDK_DEBUG__) { GiroCheckout_SDK_Debug_helper::getInstance()->logTransaction($apiCallMethod, $this->requestMethod); } if (is_null($this->requestMethod)) { throw new GiroCheckout_SDK_Exception_helper('Failure: API call method unknown'); } } if (!$this->requestMethod->hasNotifyURL() && !$this->requestMethod->hasRedirectURL()) { throw new GiroCheckout_SDK_Exception_helper('Failure: notify or redirect not possible with this api call'); } }