/** * Returns the data required for the request * to be created * * @throws InvalidRequestException * @return array */ public function getData() { $this->setResponseClass(AuthorizeResponse::class); if ($this->validateSocialSecurityNumber()) { $payment_params = ["paymentRequest.shopperEmail" => $this->getShopperEmail(), "paymentRequest.shopperReference" => $this->getShopperReference(), "paymentRequest.shopperIP" => $this->getRemoteAddr(), "paymentRequest.shopperName.firstName" => $this->getFirstName(), "paymentRequest.shopperName.lastName" => $this->getLastName(), "paymentRequest.socialSecurityNumber" => $this->getSocialSecurityNumber(), "paymentRequest.selectedBrand" => $this->getSelectedBrand(), "paymentRequest.deliveryDate" => $this->formatDeliveryDate() !== null ? $this->formatDeliveryDate() : '']; $payment_params += parent::applyBaseRequestParams($payment_params); return $payment_params; } else { throw new InvalidRequestException('Cpf / Cnpj Error: Number Not Valid'); } }
/** * Applies the parameters common to all payment types * * @param \Omnipay\Adyen\Message\CreditCard $card * @param array $payment_params * @return array * @throws InvalidRequestException */ protected function applyCommonPaymentParams($card, array $payment_params) { $payment_params += parent::applyBaseRequestParams($payment_params); $payment_params += ['paymentRequest.shopperEmail' => $card->getEmail(), 'paymentRequest.shopperReference' => $card->getShopperReference()]; if ($this->get3dSecure()) { $payment_params += ['paymentRequest.browserInfo.userAgent' => $this->getHttpUserAgent(), 'paymentRequest.browserInfo.acceptHeader' => $this->getHttpAccept()]; } $this->addSocialSecurityParams($payment_params); if ($this->getFraudOffset()) { $payment_params += ['paymentRequest.fraudOffset' => $this->getFraudOffset()]; } return $payment_params; }