mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +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:
parent
4176bdeb5b
commit
29dc9e9ae1
1 changed files with 17 additions and 2 deletions
|
@ -68,8 +68,23 @@ final class PhortuneSubscriptionViewController extends PhortuneController {
|
||||||
|
|
||||||
$default_method = $subscription->getDefaultPaymentMethodPHID();
|
$default_method = $subscription->getDefaultPaymentMethodPHID();
|
||||||
if ($default_method) {
|
if ($default_method) {
|
||||||
$handles = $this->loadViewerHandles(array($default_method));
|
$method = id(new PhortunePaymentMethodQuery())
|
||||||
$autopay_method = $handles[$default_method]->renderLink();
|
->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 {
|
} else {
|
||||||
$autopay_method = phutil_tag(
|
$autopay_method = phutil_tag(
|
||||||
'em',
|
'em',
|
||||||
|
|
Loading…
Reference in a new issue