public function confirm3D(ConfirmRequest $confirmRequest) { $request = $confirmRequest->getRequest(); $payload = $confirmRequest->getPayload(); $rawRequest = $this->buildRawRequest($payload, 'buildSale3DResolveRequest'); $rawResponse = $this->sendRequest($this->configuration->getApiUrl(), $rawRequest); $response = $this->parse3DResolveResponse($rawResponse); if (!$response->isSuccess()) { return $response; } $mdStatus = $response->getMdStatus(); $rawRequest = $this->buildRawRequest($payload, 'buildSale3DTranRequest'); $rawResponse = $this->sendRequest($this->configuration->getApiUrl(), $rawRequest); $response = $this->parseResponse($rawResponse, self::TRANSACTION_TYPE_SALE); $response->setMdStatus($mdStatus); return $response; }
public function confirm3D(ConfirmRequest $confirmRequest) { $verify = $this->check3DHashIntegrity($confirmRequest->getPayload()); if (!$verify) { throw new ResponseVerificationError('Response cannot be verified'); } $rawRequest = $this->buildConfirmRequest($confirmRequest, 'buildSale3DConfirmRequest'); $rawResponse = $this->sendRequest($this->configuration->getApiUrl(), $rawRequest); $response = $this->parseResponse($rawResponse, self::TRANSACTION_TYPE_SALE); return $response; }
protected function buildSale3DConfirmRequest(ConfirmRequest $confirmRequest) { $request = $confirmRequest->getRequest(); $payload = $confirmRequest->getPayload(); $amount = $this->formatAmount($request->getAmount()); $installment = $this->formatInstallment($request->getInstallment()); $currency = $this->formatCurrency($request->getCurrency()); $orderId = $this->formatOrderId($request->getOrderId()); $type = $this->getProviderTransactionType(self::TRANSACTION_TYPE_SALE_3D); $verify = $this->check3DHashIntegrity($payload, $this->configuration->getStoreKey()); if (!$verify) { throw new ResponseVerificationError('Response cannot be verified'); } $requestData = array('Type' => $type, 'IPAddress' => $request->getIPAddress(), 'OrderId' => $orderId, 'GroupId' => $orderId, 'Total' => $amount, 'Currency' => $currency, 'Number' => $payload['md'], 'Taksit' => $installment, 'PayerSecurityLevel' => $payload['eci'], 'PayerTxnId' => $payload['xid'], 'PayerAuthenticationCode' => $payload['cavv'], 'CardholderPresentCode' => 13); return $requestData; }