subjectReader = $subjectReader; } /** * Handles response * * @param array $handlingSubject * @param array $response * @return void */ public function handle(array $handlingSubject, array $response) { $paymentDO = $this->subjectReader->readPayment($handlingSubject); /** @var \Braintree\Transaction $transaction */ $transaction = $this->subjectReader->readTransaction($response); if (!isset($transaction->riskData)) { return; } $payment = $paymentDO->getPayment(); ContextHelper::assertOrderPayment($payment); $payment->setAdditionalInformation(self::RISK_DATA_ID, $transaction->riskData->id); $payment->setAdditionalInformation(self::RISK_DATA_DECISION, $transaction->riskData->decision); } }