Beispiel #1
0
 public static function init()
 {
     self::$_permanentAttributes = new Set(array('_apiKey'));
 }
Beispiel #2
0
        }
        return $params;
    }
    public function jsonSerialize()
    {
        return $this->__toArray(true);
    }
    public function __toJSON()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode($this->__toArray(true), JSON_PRETTY_PRINT);
        } else {
            return json_encode($this->__toArray(true));
        }
    }
    public function __toString()
    {
        $class = get_class($this);
        return $class . ' JSON: ' . $this->__toJSON();
    }
    public function __toArray($recursive = false)
    {
        if ($recursive) {
            return Util\Util::convertStripeObjectToArray($this->_values);
        } else {
            return $this->_values;
        }
    }
}
StripeObject::init();
Beispiel #3
0
 public static function init()
 {
     self::$permanentAttributes = new Util\Set(array('_opts', 'id'));
     self::$nestedUpdatableAttributes = new Util\Set(array('metadata', 'legal_entity', 'address', 'dob', 'transfer_schedule', 'verification', 'tos_acceptance', 'personal_address', 'additional_owners', 0, 1, 2, 3, 4));
 }
Beispiel #4
0
 public static function init()
 {
     self::$permanentAttributes = new Util\Set(array('_opts', 'id'));
     self::$nestedUpdatableAttributes = new Util\Set(array('metadata'));
 }
Beispiel #5
0
 /**
  * On all requests, Stripe's lib convert json in StripeObject instance.
  * You can now have response formatted like in documentation.
  *
  * @param StripeObject $object
  *
  * @return array
  */
 public function responseToArray(StripeObject $object)
 {
     $json = $object->__toJSON();
     return (array) json_decode($json, true);
 }