app/code/community/Adyen/Payment/Helper/Data.php
public function formatTerminalAPIReceipt($paymentReceipt)
    {
        $formattedHtml = "<table class='terminal-api-receipt'>";
        foreach ($paymentReceipt as $receipt) {
            if ($receipt['DocumentQualifier'] == "CustomerReceipt") {
                foreach ($receipt['OutputContent']['OutputText'] as $item) {
                    parse_str($item['Text'], $textParts);
                    $formattedHtml .= "<tr class='terminal-api-receipt'>";
                    if (!empty($textParts['name'])) {
                        $formattedHtml .= "<td class='terminal-api-receipt-name'>" . $textParts['name'] . "</td>";
                    } else {
                        $formattedHtml .= "<td class='terminal-api-receipt-name'>&nbsp;</td>";
                    }

                    if (!empty($textParts['value'])) {
                        $formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>" . $textParts['value'] . "</td>";
                    } else {
                        $formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>&nbsp;</td>";
                    }

                    $formattedHtml .= "</tr>";
                }
            }
        }

        $formattedHtml .= "</table>";
        return $formattedHtml;
    }
public function formatTerminalAPIReceipt($paymentReceipt)
    {
        $formattedHtml = "<table class='terminal-api-receipt'>";
        foreach ($paymentReceipt as $receipt) {
            if ($receipt['DocumentQualifier'] == "CustomerReceipt") {
                foreach ($receipt['OutputContent']['OutputText'] as $item) {
                    parse_str($item['Text'], $textParts);
                    $formattedHtml .= "<tr class='terminal-api-receipt'>";
                    if (!empty($textParts['name'])) {
                        $formattedHtml .= "<td class='terminal-api-receipt-name'>" . $textParts['name'] . "</td>";
                    } else {
                        $formattedHtml .= "<td class='terminal-api-receipt-name'>&nbsp;</td>";
                    }

                    if (!empty($textParts['value'])) {
                        $formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>" . $textParts['value'] . "</td>";
                    } else {
                        $formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>&nbsp;</td>";
                    }

                    $formattedHtml .= "</tr>";
                }
            }
        }

        $formattedHtml .= "</table>";
        return $formattedHtml;
    }
public function formatTerminalAPIReceipt ( $ paymentReceipt ) { $ formattedHtml = "<table class='terminal-api-receipt'>" ; foreach ( $ paymentReceipt as $ receipt ) { if ( $ receipt [ 'DocumentQualifier' ] == "CustomerReceipt" ) { foreach ( $ receipt [ 'OutputContent' ] [ 'OutputText' ] as $ item ) { parse_str ( $ item [ 'Text' ] , $ textParts ) ; $ formattedHtml .= "<tr class='terminal-api-receipt'>" ; if ( ! empty ( $ textParts [ 'name' ] ) ) { $ formattedHtml .= "<td class='terminal-api-receipt-name'>" . $ textParts [ 'name' ] . "</td>" ; } else { $ formattedHtml .= "<td class='terminal-api-receipt-name'>&nbsp;</td>" ; } if ( ! empty ( $ textParts [ 'value' ] ) ) { $ formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>" . $ textParts [ 'value' ] . "</td>" ; } else { $ formattedHtml .= "<td class='terminal-api-receipt-value' align='right'>&nbsp;</td>" ; } $ formattedHtml .= "</tr>" ; } } } $ formattedHtml .= "</table>" ; return $ formattedHtml ; }
Format the Receipt sent in the Terminal API response in HTML
so that it can be easily shown to the shopper

@param $paymentReceipt
@return string
Format the Receipt sent in the Terminal API response in HTML so that it can be easily shown to the shopper