Page MenuHomePhabricator

D18381.diff
No OneTemporary

D18381.diff

diff --git a/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php b/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php
--- a/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php
+++ b/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php
@@ -123,7 +123,8 @@
$next_uri = $this->getApplicationURI(
"cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID());
} else if ($subscription_id) {
- $next_uri = $cancel_uri;
+ $next_uri = new PhutilURI($cancel_uri);
+ $next_uri->setQueryParam('added', true);
} else {
$account_uri = $this->getApplicationURI($account->getID().'/');
$next_uri = new PhutilURI($account_uri);
diff --git a/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php b/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php
--- a/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php
+++ b/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php
@@ -25,11 +25,12 @@
}
$account = $method->getAccount();
- $account_uri = $this->getApplicationURI($account->getID().'/');
+ $account_id = $account->getID();
+ $account_uri = $this->getApplicationURI("/account/billing/{$account_id}/");
if ($request->isFormPost()) {
- // TODO: ApplicationTransactions!
+ // TODO: ApplicationTransactions!!!!
$method
->setStatus(PhortunePaymentMethod::STATUS_DISABLED)
->save();
diff --git a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php
--- a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php
+++ b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php
@@ -4,6 +4,7 @@
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
+ $added = $request->getBool('added');
$subscription = id(new PhortuneSubscriptionQuery())
->setViewer($viewer)
@@ -112,6 +113,7 @@
pht('Subscription %d', $subscription->getID()),
$view_uri);
$crumbs->addTextCrumb(pht('Edit'));
+ $crumbs->setBorder(true);
$uri = $this->getApplicationURI($account->getID().'/card/new/');
@@ -127,15 +129,19 @@
),
pht('Add Payment Method...'));
+ $radio = id(new AphrontFormRadioButtonControl())
+ ->setName('defaultPaymentMethodPHID')
+ ->setLabel(pht('Autopay With'))
+ ->setValue($current_phid)
+ ->setError($e_method);
+
+ foreach ($options as $key => $value) {
+ $radio->addButton($key, $value, null);
+ }
+
$form = id(new AphrontFormView())
->setUser($viewer)
- ->appendChild(
- id(new AphrontFormSelectControl())
- ->setName('defaultPaymentMethodPHID')
- ->setLabel(pht('Autopay With'))
- ->setValue($current_phid)
- ->setError($e_method)
- ->setOptions($options))
+ ->appendChild($radio)
->appendChild(
id(new AphrontFormMarkupControl())
->setValue($add_method_button))
@@ -151,6 +157,13 @@
->setFormErrors($errors)
->appendChild($form);
+ if ($added) {
+ $info_view = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_SUCCESS)
+ ->appendChild(pht('Payment method has been successfully added.'));
+ $box->setInfoView($info_view);
+ }
+
$header = id(new PHUIHeaderView())
->setHeader(pht('Edit %s', $subscription->getSubscriptionName()))
->setHeaderIcon('fa-pencil');

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 6:40 PM (18 h, 21 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6779242
Default Alt Text
D18381.diff (3 KB)

Event Timeline