/** * Set the model data for this component. * * This function should never rely on form. * * @param Order $order * @param array $data data to be saved into order object * * @throws Exception * @return Order the updated order */ public function setData(Order $order, array $data) { $this->getGateway($order); if (!$this->isBraintree) { return parent::setData($order, $data); } else { return []; } }