3 final class PhortuneExternalOrderController
4 extends PhortuneExternalController
{
6 protected function handleExternalRequest(AphrontRequest
$request) {
7 $xviewer = $this->getExternalViewer();
8 $email = $this->getAccountEmail();
9 $account = $email->getAccount();
11 $order = id(new PhortuneCartQuery())
13 ->withAccountPHIDs(array($account->getPHID()))
14 ->withIDs(array($request->getURIData('orderID')))
17 return new Aphront404Response();
20 $is_printable = ($request->getURIData('action') === 'print');
22 $order_view = id(new PhortuneOrderSummaryView())
25 ->setPrintable($is_printable);
33 require_celerity_resource('phortune-invoice-css');
36 $body_class = 'phortune-invoice-view';
38 $tail[] = $order_view;
40 $body_class = 'phortune-cart-page';
42 $curtain = $this->newCurtain($order);
44 $crumbs = $this->newExternalCrumbs()
45 ->addTextCrumb($order->getObjectName())
48 $timeline = $this->buildTransactionTimeline($order)
49 ->setShouldTerminate(true);
51 $main[] = $order_view;
55 $column_view = id(new PHUITwoColumnView())
56 ->setMainColumn($main)
60 $column_view->setCurtain($curtain);
63 $page = $this->newPage()
64 ->addClass($body_class)
67 $order->getObjectName(),
70 ->appendChild($column_view);
73 $page->setCrumbs($crumbs);
80 private function newCurtain(PhortuneCart
$order) {
81 $xviewer = $this->getExternalViewer();
82 $email = $this->getAccountEmail();
84 $curtain = $this->newCurtainView($order);
86 $print_uri = $email->getExternalOrderPrintURI($order);
89 id(new PhabricatorActionView())
90 ->setName(pht('Printable Version'))
92 ->setOpenInNewWindow(true)
93 ->setIcon('fa-print'));