function uc_cybersource_tax_test in Ubercart 6.2
Same name and namespace in other branches
- 5 payment/uc_cybersource/uc_cybersource.module \uc_cybersource_tax_test()
- 7.3 payment/uc_cybersource/uc_cybersource.module \uc_cybersource_tax_test()
1 string reference to 'uc_cybersource_tax_test'
- uc_cybersource_menu in payment/
uc_cybersource/ uc_cybersource.module - Implements hook_menu().
File
- payment/
uc_cybersource/ uc_cybersource.module, line 992 - A module used for CyberSource's Silent Order POST and Hosted Order Page methods of payment.
Code
function uc_cybersource_tax_test($order) {
// Fetch the taxes for the order.
$data = uc_cybersource_calculate_tax($order);
$context = array(
'revision' => 'formatted-original',
'type' => 'line_item',
);
// Build an item list for the taxes.
$items = array();
foreach ($data as $tax) {
$context['subject'] = array(
'tax' => $tax,
);
$items[] = t('@tax: @amount', array(
'@tax' => $tax['name'],
'@amount' => uc_price($tax['amount'], $context),
));
}
// Display a message if there are no taxes.
if (empty($items)) {
$items[] = t('No taxes returned for this order.');
}
return theme('item_list', $items);
}