/** * @param array|object $data The parsed data returned by Sage Pay. * @return $this */ protected function setData($data) { if ($date = Helper::dataGet($data, 'date')) { $this->date = Helper::parseDateTime($date); } $this->instructionType = Helper::dataGet($data, 'instructionType'); return $this; }
/** * @param $data * @return $this */ protected function setData($data) { $this->merchantSessionKey = Helper::dataGet($data, 'merchantSessionKey'); $expiry = Helper::dataGet($data, 'expiry'); if (isset($expiry)) { $this->expiry = Helper::parseDateTime($expiry); } return $this; }
/** * This can be set from either a direct response from Sage Pay, or fields * from the drop-in form (a server request). * TODO: other fields can be provided by the drop-in form, such as card-type. * CHECKME: is it worth merging this with Response\Model\Card, since both are * essentially card details returned from Sage Pay? * * @param array|object $data The parsed data returned by Sage Pay. * @return $this */ protected function setData($data) { $this->cardIdentifier = Helper::dataGet($data, 'cardIdentifier', Helper::dataGet($data, 'card-identifier', null)); if ($expiry = Helper::dataGet($data, 'expiry', null)) { $this->expiry = Helper::parseDateTime($expiry); } $this->cardType = Helper::dataGet($data, 'cardType', null); return $this; }