<?php 

function paystack_attachments_filter($html, $item) {
	if($item[0]['mode'] === 'Paystack Credit/Debit Card Payment') {
		$trx = unserialize($item[0]['trx']);
		$html = "<dl>";
		$html .= "<dt>PayStack Reference:</dt>";
		$html .= "<dd>".$trx->data->reference."</dd>";
		$html .= "<dt>Authorization Code:</dt>";
		$html .= "<dd>".$trx->data->authorization->authorization_code."</dd>";
		$html .= "<dt>Bank - Card Type:</dt>";
		$html .= "<dd>".$trx->data->authorization->bank." - ".$trx->data->authorization->card_type."</dd>";
		$html .= "<dt>Account Name:</dt>";
		$html .= "<dd>".$trx->data->authorization->account_name."</dd>";
		$html .= "</dl>";
		return $html;
	} else return $html;
}