/** * Build a customer entity based on a json-decoded customer stdClass * * @param stdClass $response The customer data * * @return Syspay_Merchant_Entity_Customer The customer object */ public static function buildFromResponse(stdClass $response) { $customer = new self(); $customer->setEmail(isset($response->email) ? $response->email : null); $customer->setLanguage(isset($response->language) ? $response->language : null); $customer->setIp(isset($response->ip) ? $response->ip : null); $customer->setMobile(isset($response->mobile) ? $response->mobile : null); $customer->raw = $response; return $customer; }