@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor UX tweaks to Phortune autopay

Summary: Fixes T12958. Adds a success message when card is added, also switches to use radio buttons for clarity. Updated redirect uri for deleting methods as well.

Test Plan:
Add cards, remove cards.

{F5091084}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12958

Differential Revision: https://secure.phabricator.com/D18381

+25 -10
+2 -1
src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php
··· 123 123 $next_uri = $this->getApplicationURI( 124 124 "cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID()); 125 125 } else if ($subscription_id) { 126 - $next_uri = $cancel_uri; 126 + $next_uri = new PhutilURI($cancel_uri); 127 + $next_uri->setQueryParam('added', true); 127 128 } else { 128 129 $account_uri = $this->getApplicationURI($account->getID().'/'); 129 130 $next_uri = new PhutilURI($account_uri);
+3 -2
src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php
··· 25 25 } 26 26 27 27 $account = $method->getAccount(); 28 - $account_uri = $this->getApplicationURI($account->getID().'/'); 28 + $account_id = $account->getID(); 29 + $account_uri = $this->getApplicationURI("/account/billing/{$account_id}/"); 29 30 30 31 if ($request->isFormPost()) { 31 32 32 - // TODO: ApplicationTransactions! 33 + // TODO: ApplicationTransactions!!!! 33 34 $method 34 35 ->setStatus(PhortunePaymentMethod::STATUS_DISABLED) 35 36 ->save();
+20 -7
src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php
··· 4 4 5 5 public function handleRequest(AphrontRequest $request) { 6 6 $viewer = $this->getViewer(); 7 + $added = $request->getBool('added'); 7 8 8 9 $subscription = id(new PhortuneSubscriptionQuery()) 9 10 ->setViewer($viewer) ··· 112 113 pht('Subscription %d', $subscription->getID()), 113 114 $view_uri); 114 115 $crumbs->addTextCrumb(pht('Edit')); 116 + $crumbs->setBorder(true); 115 117 116 118 117 119 $uri = $this->getApplicationURI($account->getID().'/card/new/'); ··· 127 129 ), 128 130 pht('Add Payment Method...')); 129 131 132 + $radio = id(new AphrontFormRadioButtonControl()) 133 + ->setName('defaultPaymentMethodPHID') 134 + ->setLabel(pht('Autopay With')) 135 + ->setValue($current_phid) 136 + ->setError($e_method); 137 + 138 + foreach ($options as $key => $value) { 139 + $radio->addButton($key, $value, null); 140 + } 141 + 130 142 $form = id(new AphrontFormView()) 131 143 ->setUser($viewer) 132 - ->appendChild( 133 - id(new AphrontFormSelectControl()) 134 - ->setName('defaultPaymentMethodPHID') 135 - ->setLabel(pht('Autopay With')) 136 - ->setValue($current_phid) 137 - ->setError($e_method) 138 - ->setOptions($options)) 144 + ->appendChild($radio) 139 145 ->appendChild( 140 146 id(new AphrontFormMarkupControl()) 141 147 ->setValue($add_method_button)) ··· 150 156 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 151 157 ->setFormErrors($errors) 152 158 ->appendChild($form); 159 + 160 + if ($added) { 161 + $info_view = id(new PHUIInfoView()) 162 + ->setSeverity(PHUIInfoView::SEVERITY_SUCCESS) 163 + ->appendChild(pht('Payment method has been successfully added.')); 164 + $box->setInfoView($info_view); 165 + } 153 166 154 167 $header = id(new PHUIHeaderView()) 155 168 ->setHeader(pht('Edit %s', $subscription->getSubscriptionName()))