/** * Set a value in the payload to a given value. * * @param string $name * * @param mixed $value */ public function set($name, $value) { $this->payload[$name] = Trustly_Data::ensureUTF8($value); }
/** * Set a value in the params->Data->Attributes part of the payload. * * @param string $name The name of the Attributes parameter to set * * @param mixed $value The value of the Attributes parameter to set * * @return mixed $value */ public function setAttribute($name, $value) { if (!isset($this->payload['params']['Data'])) { $this->payload['params']['Data'] = array(); } if (!isset($this->payload['params']['Data']['Attributes'])) { $this->payload['params']['Data']['Attributes'] = array(); } $this->payload['params']['Data']['Attributes'][$name] = Trustly_Data::ensureUTF8($value); return $value; }