@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.

Use real icons for payment providers

Summary: Ref T2787. Uses the real icons. Straightens out the add payment flow a tiny bit.

Test Plan: {F214922}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2787

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

+23 -24
-5
resources/celerity/map.php
··· 306 306 'rsrc/image/people/mckinley.png' => 'fb8f16ce', 307 307 'rsrc/image/people/taft.png' => 'd7bc402c', 308 308 'rsrc/image/people/washington.png' => '40dd301c', 309 - 'rsrc/image/phortune/balanced.png' => 'f6ba2691', 310 - 'rsrc/image/phortune/paypal.png' => '9747cb33', 311 - 'rsrc/image/phortune/stripe.png' => 'bfedc2ce', 312 - 'rsrc/image/phortune/test.png' => '0235d8a7', 313 - 'rsrc/image/phortune/wepay.png' => 'b37163ce', 314 309 'rsrc/image/phrequent_active.png' => 'a466a8ed', 315 310 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 316 311 'rsrc/image/search-white.png' => '64cc0d45',
-1
src/applications/phortune/controller/PhortuneAccountViewController.php
··· 130 130 131 131 $provider = $method->buildPaymentProvider(); 132 132 $item->addAttribute($provider->getPaymentMethodProviderDescription()); 133 - $item->setImageURI($provider->getPaymentMethodIcon()); 134 133 135 134 $edit_uri = $this->getApplicationURI('card/'.$id.'/edit/'); 136 135
+1 -1
src/applications/phortune/controller/PhortuneCartCheckoutController.php
··· 161 161 $add_providers = $this->loadCreatePaymentMethodProvidersForMerchant( 162 162 $merchant); 163 163 if ($add_providers) { 164 - $new_method = phutil_tag( 164 + $new_method = javelin_tag( 165 165 'a', 166 166 array( 167 167 'class' => 'button grey',
+1 -1
src/applications/phortune/controller/PhortuneController.php
··· 27 27 $rows[] = array( 28 28 $charge->getID(), 29 29 $cart_href, 30 - $charge->getPaymentProviderKey(), 30 + $charge->getProviderPHID(), 31 31 $charge->getPaymentMethodPHID(), 32 32 $charge->getAmountAsCurrency()->formatForDisplay(), 33 33 $charge->getStatus(),
+14 -8
src/applications/phortune/controller/PhortunePaymentMethodCreateController.php
··· 29 29 return new Aphront404Response(); 30 30 } 31 31 32 - $cancel_uri = $this->getApplicationURI($account->getID().'/'); 33 - $account_uri = $this->getApplicationURI($account->getID().'/'); 32 + $cart_id = $request->getInt('cartID'); 33 + if ($cart_id) { 34 + $cancel_uri = $this->getApplicationURI("cart/{$cart_id}/checkout/"); 35 + } else { 36 + $cancel_uri = $this->getApplicationURI($account->getID().'/'); 37 + } 34 38 35 39 $providers = $this->loadCreatePaymentMethodProvidersForMerchant($merchant); 36 40 if (!$providers) { ··· 58 62 ->setTitle(pht('Add Payment Method')) 59 63 ->appendParagraph(pht('Choose a payment method to add:')) 60 64 ->appendChild($content) 61 - ->addCancelButton($account_uri); 65 + ->addCancelButton($cancel_uri); 62 66 } 63 67 64 68 $provider = $providers[$provider_id]; ··· 107 111 108 112 // If we added this method on a cart flow, return to the cart to 109 113 // check out. 110 - $cart_id = $request->getInt('cartID'); 111 114 if ($cart_id) { 112 115 $next_uri = $this->getApplicationURI( 113 116 "cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID()); 114 117 } else { 118 + $account_uri = $this->getApplicationURI($account->getID().'/'); 115 119 $next_uri = new PhutilURI($account_uri); 116 120 $next_uri->setFragment('payment'); 117 121 } ··· 140 144 ->appendChild( 141 145 id(new AphrontFormSubmitControl()) 142 146 ->setValue(pht('Add Payment Method')) 143 - ->addCancelButton($account_uri)); 147 + ->addCancelButton($cancel_uri)); 144 148 145 149 $box = id(new PHUIObjectBoxView()) 146 150 ->setHeaderText($provider->getPaymentMethodDescription()) ··· 172 176 $this->requireResource('phortune-css'); 173 177 174 178 $icon = id(new PHUIIconView()) 175 - ->setImage($icon_uri) 176 - ->addClass('phortune-payment-icon'); 179 + ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN) 180 + ->setSpriteIcon($provider->getPaymentMethodIcon()); 177 181 178 182 $button = id(new PHUIButtonView()) 179 183 ->setSize(PHUIButtonView::BIG) 180 184 ->setColor(PHUIButtonView::GREY) 181 185 ->setIcon($icon) 182 186 ->setText($description) 183 - ->setSubtext($details); 187 + ->setSubtext($details) 188 + ->setMetadata(array('disableWorkflow' => true)); 184 189 185 190 $form = id(new AphrontFormView()) 186 191 ->setUser($viewer) 192 + ->setAction($request->getRequestURI()) 187 193 ->addHiddenInput('providerID', $provider->getProviderConfig()->getID()) 188 194 ->appendChild($button); 189 195
+1 -1
src/applications/phortune/provider/PhortuneBalancedPaymentProvider.php
··· 121 121 } 122 122 123 123 public function getPaymentMethodIcon() { 124 - return celerity_get_resource_uri('/rsrc/image/phortune/balanced.png'); 124 + return 'Balanced'; 125 125 } 126 126 127 127 public function getPaymentMethodProviderDescription() {
+1 -1
src/applications/phortune/provider/PhortunePayPalPaymentProvider.php
··· 148 148 } 149 149 150 150 public function getPaymentMethodIcon() { 151 - return celerity_get_resource_uri('rsrc/image/phortune/paypal.png'); 151 + return 'PayPal'; 152 152 } 153 153 154 154 public function getPaymentMethodProviderDescription() {
+2 -3
src/applications/phortune/provider/PhortunePaymentProvider.php
··· 212 212 213 213 require_celerity_resource('phortune-css'); 214 214 215 - $icon_uri = $this->getPaymentMethodIcon(); 216 215 $description = $this->getPaymentMethodProviderDescription(); 217 216 $details = $this->getPaymentMethodDescription(); 218 217 219 218 $icon = id(new PHUIIconView()) 220 - ->setImage($icon_uri) 221 - ->addClass('phortune-payment-icon'); 219 + ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN) 220 + ->setSpriteIcon($this->getPaymentMethodIcon()); 222 221 223 222 $button = id(new PHUIButtonView()) 224 223 ->setSize(PHUIButtonView::BIG)
+1 -1
src/applications/phortune/provider/PhortuneStripePaymentProvider.php
··· 29 29 } 30 30 31 31 public function getPaymentMethodIcon() { 32 - return celerity_get_resource_uri('/rsrc/image/phortune/stripe.png'); 32 + return 'Stripe'; 33 33 } 34 34 35 35 public function getPaymentMethodProviderDescription() {
+1 -1
src/applications/phortune/provider/PhortuneTestPaymentProvider.php
··· 34 34 } 35 35 36 36 public function getPaymentMethodIcon() { 37 - return celerity_get_resource_uri('/rsrc/image/phortune/test.png'); 37 + return 'TestPayment'; 38 38 } 39 39 40 40 public function getPaymentMethodProviderDescription() {
+1 -1
src/applications/phortune/provider/PhortuneWePayPaymentProvider.php
··· 148 148 } 149 149 150 150 public function getPaymentMethodIcon() { 151 - return celerity_get_resource_uri('/rsrc/image/phortune/wepay.png'); 151 + return 'WePay'; 152 152 } 153 153 154 154 public function getPaymentMethodProviderDescription() {
webroot/rsrc/image/phortune/balanced.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/paypal.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/stripe.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/test.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/wepay.png

This is a binary file and will not be displayed.