1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 16:00:59 +01:00

Make the Phortune Subscription view show "Deleted Payment Method" for deleted payment methods

Summary: Fixes T12224. This brings "Autopay" on the View controller into line with how it works on the Edit controller.

Test Plan:
  - Viewed subscriptions with no autopay, valid autopay, and deleted autopay.

{F2750725}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12224

Differential Revision: https://secure.phabricator.com/D17334
This commit is contained in:
epriestley 2017-02-10 08:48:29 -08:00
parent 4176bdeb5b
commit 29dc9e9ae1

View file

@ -68,8 +68,23 @@ final class PhortuneSubscriptionViewController extends PhortuneController {
$default_method = $subscription->getDefaultPaymentMethodPHID();
if ($default_method) {
$handles = $this->loadViewerHandles(array($default_method));
$autopay_method = $handles[$default_method]->renderLink();
$method = id(new PhortunePaymentMethodQuery())
->setViewer($viewer)
->withPHIDs(array($default_method))
->withStatuses(
array(
PhortunePaymentMethod::STATUS_ACTIVE,
))
->executeOne();
if ($method) {
$handles = $this->loadViewerHandles(array($default_method));
$autopay_method = $handles[$default_method]->renderLink();
} else {
$autopay_method = phutil_tag(
'em',
array(),
pht('<Deleted Payment Method>'));
}
} else {
$autopay_method = phutil_tag(
'em',