Ejemplo n.º 1
0
 /**
  * @param mixed $value
  * @return FieldInterface
  */
 public function setValue($value)
 {
     $this->isValid = null;
     $this->validationErrors = null;
     $this->value = Helper::stringify($value);
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param  string $endpoint The resource path of the Endpoint
  * @return string           Endpoint's full URI
  */
 public final function getEndpoint($endpoint)
 {
     $baseEndpoint = $this->getBaseEndpoint();
     $endpoint = Helper::stringify($endpoint);
     if (empty($endpoint)) {
         throw new \InvalidArgumentException("`{$endpoint}` is not a valid endpoint.");
     }
     return $baseEndpoint . $endpoint;
 }
Ejemplo n.º 3
0
 /**
  * @return string The encrypted signature
  */
 protected function generateSignature($secret, $order, $merchantParameters)
 {
     $key = Helper::base64url_decode($secret);
     $key = Helper::mcrypt_encrypt_3DES($order, $key);
     $sig = Helper::hash_hmac_sha256($merchantParameters, $key);
     $sig = Helper::base64url_encode($sig);
     return $sig;
 }
Ejemplo n.º 4
0
 /**
  * @param mixed $value The value of the field
  * @return FieldInterface
  */
 public function setValue($value)
 {
     $this->value = Helper::stringify($value);
     return $this;
 }
Ejemplo n.º 5
0
 /**
  * Get the fully qualified name of a field's class.
  *
  * @param  string $fieldName The field name
  * @return string            The field class name
  */
 protected function resolveFieldClassName($fieldName)
 {
     // The field name should match its class name
     $fieldPrefix = Helper::stringify($this->fieldPrefix);
     $className = str_replace($fieldPrefix, '', $fieldName);
     // If is not a fully qualified class name
     // append our own base namespace
     if ($className[0] !== '\\') {
         return self::FIELD_BASE_NAMESPACE . $className;
     }
     return $className;
 }