/**
  * {@inheritDoc}
  */
 protected function composeDetails(PaymentInterface $payment, TokenInterface $token)
 {
     if ($payment->getDetails()) {
         return;
     }
     $order = $payment->getOrder();
     $this->payment->execute($obtainCreditCardRequest = new ObtainCreditCardRequest($order));
     $creditCard = $obtainCreditCardRequest->getCreditCard();
     $total = $this->currencyConverter->convert($order->getTotal(), $order->getCurrency());
     $payment->setDetails(array('card' => new SensitiveValue(array('number' => $creditCard->getNumber(), 'expiryMonth' => $creditCard->getExpiryMonth(), 'expiryYear' => $creditCard->getExpiryYear(), 'cvv' => $creditCard->getSecurityCode())), 'amount' => round($total / 100, 2), 'currency' => $order->getCurrency()));
 }
 /**
  * {@inheritDoc}
  */
 protected function composeDetails(PaymentInterface $payment, TokenInterface $token)
 {
     if ($payment->getDetails()) {
         return;
     }
     if (!$this->httpRequest) {
         throw new LogicException('The action can be run only when http request is set.');
     }
     $order = $payment->getOrder();
     $this->payment->execute($obtainCreditCardRequest = new ObtainCreditCardRequest($order));
     $details = array();
     $details['AMOUNT'] = $order->getTotal();
     $details['CLIENTEMAIL'] = $order->getUser()->getEmail();
     $details['CLIENTUSERAGENT'] = $this->httpRequest->headers->get('User-Agent', 'Unknown');
     $details['CLIENTIP'] = $this->httpRequest->getClientIp();
     $details['CLIENTIDENT'] = $order->getUser()->getId();
     $details['DESCRIPTION'] = sprintf('Order containing %d items for a total of %01.2f', $order->getItems()->count(), $order->getTotal() / 100);
     $details['ORDERID'] = $payment->getId();
     $details['CARDCODE'] = new SensitiveValue($obtainCreditCardRequest->getCreditCard()->getNumber());
     $details['CARDCVV'] = new SensitiveValue($obtainCreditCardRequest->getCreditCard()->getSecurityCode());
     $details['CARDFULLNAME'] = new SensitiveValue($obtainCreditCardRequest->getCreditCard()->getCardholderName());
     $details['CARDVALIDITYDATE'] = new SensitiveValue(sprintf('%02d-%02d', $obtainCreditCardRequest->getCreditCard()->getExpiryMonth(), substr($obtainCreditCardRequest->getCreditCard()->getExpiryYear(), -2)));
     $payment->setDetails($details);
 }