public function build() { $request = new PaymentRequest($this->card, $this->order, $this->billing, $this->delivery, $this->basket); $validator = new PaymentRequestValidator($request); $validator->validate(); $serializer = new PaymentRequestSerializer($request, $this->configuration); $rawData = $serializer->serialize(); $request->setRawData($rawData); return $request; }