lib/HttpClient.php
protected function encodePayload(array $params)
  {
    $encoded = [];
    foreach ($params as $key => $value)
    {
      if (is_array($value))                 $encoded[$key] = $this->encodePayload($value);
      else if ($value instanceof \DateTime) $encoded[$key] = $value->format(\DateTime::ISO8601);
      else                                  $encoded[$key] = $value;
    }

    return $encoded;
  }
protected function encodePayload(array $params)
  {
    $encoded = [];
    foreach ($params as $key => $value)
    {
      if (is_array($value))                 $encoded[$key] = $this->encodePayload($value);
      else if ($value instanceof \DateTime) $encoded[$key] = $value->format(\DateTime::ISO8601);
      else                                  $encoded[$key] = $value;
    }

    return $encoded;
  }
protected function encodePayload ( array $ params ) { $ encoded = [ ] ; foreach ( $ params as $ key => $ value ) { if ( is_array ( $ value ) ) $ encoded [ $ key ] = $ this -> encodePayload ( $ value ) ; else if ( $ value instanceof \ DateTime ) $ encoded [ $ key ] = $ value -> format ( \ DateTime :: ISO8601 ) ; else $ encoded [ $ key ] = $ value ; } return $ encoded ; }
Ensure consistency in encoding between native PHP types and Base API expected types.

@param array $params Associative array of either wrapped or unwrapped payload to be send.
@return array Associative array with properly handled data types

@ignore
Ensure consistency in encoding between native PHP types and Base API expected types .