Differential D17694 Diff 42554 src/applications/phortune/controller/account/PhortuneAccountBillingController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/controller/account/PhortuneAccountBillingController.php
| <?php | <?php | ||||
| final class PhortuneAccountBillingController | final class PhortuneAccountBillingController | ||||
| extends PhortuneAccountProfileController { | extends PhortuneAccountProfileController { | ||||
| public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
| $viewer = $this->getViewer(); | $response = $this->loadAccount(); | ||||
| if ($response) { | |||||
| // TODO: Currently, you must be able to edit an account to view the detail | return $response; | ||||
| // page, because the account must be broadly visible so merchants can | |||||
| // process orders but merchants should not be able to see all the details | |||||
| // of an account. Ideally this page should be visible to merchants, too, | |||||
| // just with less information. | |||||
| $can_edit = true; | |||||
| $account = id(new PhortuneAccountQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withIDs(array($request->getURIData('id'))) | |||||
| ->requireCapabilities( | |||||
| array( | |||||
| PhabricatorPolicyCapability::CAN_VIEW, | |||||
| PhabricatorPolicyCapability::CAN_EDIT, | |||||
| )) | |||||
| ->executeOne(); | |||||
| if (!$account) { | |||||
| return new Aphront404Response(); | |||||
| } | } | ||||
| $this->setAccount($account); | $account = $this->getAccount(); | ||||
| $title = $account->getName(); | $title = $account->getName(); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Billing')); | $crumbs->addTextCrumb(pht('Billing')); | ||||
| $header = $this->buildHeaderView(); | $header = $this->buildHeaderView(); | ||||
| $methods = $this->buildPaymentMethodsSection($account); | $methods = $this->buildPaymentMethodsSection($account); | ||||
| $charge_history = $this->buildChargeHistorySection($account); | $charge_history = $this->buildChargeHistorySection($account); | ||||
| ▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines | |||||