/** * Sets period * * @param integer $period * @return self * * @deprecated use setTime() */ public function setPeriod($period) { Paysera_WalletApi_Util_Assert::isInt($period); $this->time = intval($period) * 3600; return $this; }
/** * Cancels allowance by ID using API * * @param integer $allowanceId * * @return Paysera_WalletApi_Entity_Allowance * * @throws Paysera_WalletApi_Exception_ApiException */ public function cancelAllowance($allowanceId) { Paysera_WalletApi_Util_Assert::isInt($allowanceId); $responseData = $this->delete('allowance/' . $allowanceId); return $this->mapper->decodeAllowance($responseData); }
/** * Sets allowance by it's ID * * @param integer $allowanceId * * @return self * * @throws Paysera_WalletApi_Exception_LogicException */ public function setAllowanceId($allowanceId) { if ($this->getKey() !== null) { throw new Paysera_WalletApi_Exception_LogicException('Cannot set allowance to already saved transaction'); } Paysera_WalletApi_Util_Assert::isInt($allowanceId); $this->allowanceId = $allowanceId; $this->allowance = null; return $this; }