/** * Set any property which has setter method from array. * * @param array $data * * @return Payment */ public function set(array $data) { foreach ($data as $key => $value) { if (method_exists($this, 'set' . $key)) { $this->{'set' . $key}($value); } else { if ($this->customParamsPrefix . $this->shopCommissionCustomParamKey === $key) { $this->setShopCommission($value); } else { if (0 === strpos($key, $this->customParamsPrefix)) { $this->setCustomParam(substr($key, 4), $value); } } } } $this->auth->set($data); $this->client->set($data); return $this; }