$this->getOrderId()]; if ($this instanceof ShouldRedirect) { $data['redirectUrl'] = $this->getRedirectUrl(); } return $data; } public function jsonSerialize() { return $this->toArray(); } public function __toString() { return json_encode($this->jsonSerialize()); } }