/**
  * @param Payment $payment
  *
  * @return array
  */
 public function convert(Payment $payment)
 {
     $links = [];
     foreach ($payment->getLinks() as $name => $link) {
         $links[$name] = ['href' => $link];
     }
     return ['id' => $payment->getPublicId(), 'gatewayName' => $payment->getGatewayName(), 'afterUrl' => $payment->getAfterUrl(), 'number' => $payment->getNumber(), 'totalAmount' => $payment->getTotalAmount(), 'currencyCode' => $payment->getCurrencyCode(), 'clientEmail' => $payment->getClientEmail(), 'clientId' => $payment->getClientId(), 'description' => $payment->getDescription(), 'details' => $payment->getDetails(), '_links' => $links];
 }
 /**
  * @param Payment $payment
  *
  * @return array
  */
 public function convert(Payment $payment)
 {
     $normalizedPayment = ['id' => $payment->getId(), 'status' => $payment->getStatus(), 'gatewayName' => $payment->getGatewayName(), 'number' => $payment->getNumber(), 'totalAmount' => $payment->getTotalAmount(), 'currencyCode' => $payment->getCurrencyCode(), 'clientEmail' => $payment->getClientEmail(), 'clientId' => $payment->getClientId(), 'description' => $payment->getDescription(), 'details' => $payment->getDetails(), '_links' => []];
     foreach (['self', 'done', 'capture', 'authorize', 'notify'] as $name) {
         if ($link = $payment->getValue('links', $name)) {
             $normalizedPayment['_links'][$name] = ['href' => $link];
         }
     }
     return $normalizedPayment;
 }