mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
1e8c314c81
Summary: Ref T2787. This has some rough edges but basically works. - Users can cancel orders that are in incomplete states (or in complete states, if the application allows them to -- for example, some future application might allow cancellation of billed-but-not-shipped orders). - Merchant controllers can partially or fully refund orders from any state after payment. Test Plan: This is still rough around the edges, but issued Stripe and WePay refunds. Reviewers: btrahan Reviewed By: btrahan Subscribers: chad, epriestley Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D10664
45 lines
981 B
PHP
45 lines
981 B
PHP
<?php
|
|
|
|
abstract class PhortuneCartController
|
|
extends PhortuneController {
|
|
|
|
protected function buildCartContentTable(PhortuneCart $cart) {
|
|
|
|
$rows = array();
|
|
foreach ($cart->getPurchases() as $purchase) {
|
|
$rows[] = array(
|
|
$purchase->getFullDisplayName(),
|
|
$purchase->getBasePriceAsCurrency()->formatForDisplay(),
|
|
$purchase->getQuantity(),
|
|
$purchase->getTotalPriceAsCurrency()->formatForDisplay(),
|
|
);
|
|
}
|
|
|
|
$rows[] = array(
|
|
phutil_tag('strong', array(), pht('Total')),
|
|
'',
|
|
'',
|
|
phutil_tag('strong', array(),
|
|
$cart->getTotalPriceAsCurrency()->formatForDisplay()),
|
|
);
|
|
|
|
$table = new AphrontTableView($rows);
|
|
$table->setHeaders(
|
|
array(
|
|
pht('Item'),
|
|
pht('Price'),
|
|
pht('Qty.'),
|
|
pht('Total'),
|
|
));
|
|
$table->setColumnClasses(
|
|
array(
|
|
'wide',
|
|
'right',
|
|
'right',
|
|
'right',
|
|
));
|
|
|
|
return $table;
|
|
}
|
|
|
|
}
|