Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15452053
D16935.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16935.id.diff
View Options
diff --git a/src/applications/phortune/controller/PhortuneSubscriptionEditController.php b/src/applications/phortune/controller/PhortuneSubscriptionEditController.php
--- a/src/applications/phortune/controller/PhortuneSubscriptionEditController.php
+++ b/src/applications/phortune/controller/PhortuneSubscriptionEditController.php
@@ -50,6 +50,11 @@
$current_phid = $subscription->getDefaultPaymentMethodPHID();
+ $e_method = null;
+ if ($current_phid && empty($valid_methods[$current_phid])) {
+ $e_method = pht('Needs Update');
+ }
+
$errors = array();
if ($request->isFormPost()) {
@@ -57,12 +62,14 @@
if (!$default_method_phid) {
$default_method_phid = null;
$e_method = null;
- } else if ($default_method_phid == $current_phid) {
- // If you have an invalid setting already, it's OK to retain it.
- $e_method = null;
- } else {
- if (empty($valid_methods[$default_method_phid])) {
- $e_method = pht('Invalid');
+ } else if (empty($valid_methods[$default_method_phid])) {
+ $e_method = pht('Invalid');
+ if ($default_method_phid == $current_phid) {
+ $errors[] = pht(
+ 'This subscription is configured to autopay with a payment method '.
+ 'that has been deleted. Choose a valid payment method or disable '.
+ 'autopay.');
+ } else {
$errors[] = pht('You must select a valid default payment method.');
}
}
@@ -86,11 +93,9 @@
// Don't require the user to make a valid selection if the current method
// has become invalid.
- // TODO: This should probably have a note about why this is bogus.
if ($current_phid && empty($valid_methods[$current_phid])) {
- $handles = $this->loadViewerHandles(array($current_phid));
$current_options = array(
- $current_phid => $handles[$current_phid]->getName(),
+ $current_phid => pht('<Deleted Payment Method>'),
);
} else {
$current_options = array();
@@ -129,6 +134,7 @@
->setName('defaultPaymentMethodPHID')
->setLabel(pht('Autopay With'))
->setValue($current_phid)
+ ->setError($e_method)
->setOptions($options))
->appendChild(
id(new AphrontFormMarkupControl())
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 30, 1:25 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7724958
Default Alt Text
D16935.id.diff (2 KB)
Attached To
Mode
D16935: When a Phortune subscription has a removed payment method, be more explicit about it
Attached
Detach File
Event Timeline
Log In to Comment