1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

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
This commit is contained in:
epriestley 2014-10-07 15:07:01 -07:00
parent 03ddb4a0fc
commit 89a6ed98e7
16 changed files with 23 additions and 24 deletions

View file

@ -306,11 +306,6 @@ return array(
'rsrc/image/people/mckinley.png' => 'fb8f16ce', 'rsrc/image/people/mckinley.png' => 'fb8f16ce',
'rsrc/image/people/taft.png' => 'd7bc402c', 'rsrc/image/people/taft.png' => 'd7bc402c',
'rsrc/image/people/washington.png' => '40dd301c', 'rsrc/image/people/washington.png' => '40dd301c',
'rsrc/image/phortune/balanced.png' => 'f6ba2691',
'rsrc/image/phortune/paypal.png' => '9747cb33',
'rsrc/image/phortune/stripe.png' => 'bfedc2ce',
'rsrc/image/phortune/test.png' => '0235d8a7',
'rsrc/image/phortune/wepay.png' => 'b37163ce',
'rsrc/image/phrequent_active.png' => 'a466a8ed', 'rsrc/image/phrequent_active.png' => 'a466a8ed',
'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 'rsrc/image/phrequent_inactive.png' => 'bfc15a69',
'rsrc/image/search-white.png' => '64cc0d45', 'rsrc/image/search-white.png' => '64cc0d45',

View file

@ -130,7 +130,6 @@ final class PhortuneAccountViewController extends PhortuneController {
$provider = $method->buildPaymentProvider(); $provider = $method->buildPaymentProvider();
$item->addAttribute($provider->getPaymentMethodProviderDescription()); $item->addAttribute($provider->getPaymentMethodProviderDescription());
$item->setImageURI($provider->getPaymentMethodIcon());
$edit_uri = $this->getApplicationURI('card/'.$id.'/edit/'); $edit_uri = $this->getApplicationURI('card/'.$id.'/edit/');

View file

@ -161,7 +161,7 @@ final class PhortuneCartCheckoutController
$add_providers = $this->loadCreatePaymentMethodProvidersForMerchant( $add_providers = $this->loadCreatePaymentMethodProvidersForMerchant(
$merchant); $merchant);
if ($add_providers) { if ($add_providers) {
$new_method = phutil_tag( $new_method = javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button grey',

View file

@ -27,7 +27,7 @@ abstract class PhortuneController extends PhabricatorController {
$rows[] = array( $rows[] = array(
$charge->getID(), $charge->getID(),
$cart_href, $cart_href,
$charge->getPaymentProviderKey(), $charge->getProviderPHID(),
$charge->getPaymentMethodPHID(), $charge->getPaymentMethodPHID(),
$charge->getAmountAsCurrency()->formatForDisplay(), $charge->getAmountAsCurrency()->formatForDisplay(),
$charge->getStatus(), $charge->getStatus(),

View file

@ -29,8 +29,12 @@ final class PhortunePaymentMethodCreateController
return new Aphront404Response(); return new Aphront404Response();
} }
$cart_id = $request->getInt('cartID');
if ($cart_id) {
$cancel_uri = $this->getApplicationURI("cart/{$cart_id}/checkout/");
} else {
$cancel_uri = $this->getApplicationURI($account->getID().'/'); $cancel_uri = $this->getApplicationURI($account->getID().'/');
$account_uri = $this->getApplicationURI($account->getID().'/'); }
$providers = $this->loadCreatePaymentMethodProvidersForMerchant($merchant); $providers = $this->loadCreatePaymentMethodProvidersForMerchant($merchant);
if (!$providers) { if (!$providers) {
@ -58,7 +62,7 @@ final class PhortunePaymentMethodCreateController
->setTitle(pht('Add Payment Method')) ->setTitle(pht('Add Payment Method'))
->appendParagraph(pht('Choose a payment method to add:')) ->appendParagraph(pht('Choose a payment method to add:'))
->appendChild($content) ->appendChild($content)
->addCancelButton($account_uri); ->addCancelButton($cancel_uri);
} }
$provider = $providers[$provider_id]; $provider = $providers[$provider_id];
@ -107,11 +111,11 @@ final class PhortunePaymentMethodCreateController
// If we added this method on a cart flow, return to the cart to // If we added this method on a cart flow, return to the cart to
// check out. // check out.
$cart_id = $request->getInt('cartID');
if ($cart_id) { if ($cart_id) {
$next_uri = $this->getApplicationURI( $next_uri = $this->getApplicationURI(
"cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID()); "cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID());
} else { } else {
$account_uri = $this->getApplicationURI($account->getID().'/');
$next_uri = new PhutilURI($account_uri); $next_uri = new PhutilURI($account_uri);
$next_uri->setFragment('payment'); $next_uri->setFragment('payment');
} }
@ -140,7 +144,7 @@ final class PhortunePaymentMethodCreateController
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Add Payment Method')) ->setValue(pht('Add Payment Method'))
->addCancelButton($account_uri)); ->addCancelButton($cancel_uri));
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($provider->getPaymentMethodDescription()) ->setHeaderText($provider->getPaymentMethodDescription())
@ -172,18 +176,20 @@ final class PhortunePaymentMethodCreateController
$this->requireResource('phortune-css'); $this->requireResource('phortune-css');
$icon = id(new PHUIIconView()) $icon = id(new PHUIIconView())
->setImage($icon_uri) ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN)
->addClass('phortune-payment-icon'); ->setSpriteIcon($provider->getPaymentMethodIcon());
$button = id(new PHUIButtonView()) $button = id(new PHUIButtonView())
->setSize(PHUIButtonView::BIG) ->setSize(PHUIButtonView::BIG)
->setColor(PHUIButtonView::GREY) ->setColor(PHUIButtonView::GREY)
->setIcon($icon) ->setIcon($icon)
->setText($description) ->setText($description)
->setSubtext($details); ->setSubtext($details)
->setMetadata(array('disableWorkflow' => true));
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($viewer) ->setUser($viewer)
->setAction($request->getRequestURI())
->addHiddenInput('providerID', $provider->getProviderConfig()->getID()) ->addHiddenInput('providerID', $provider->getProviderConfig()->getID())
->appendChild($button); ->appendChild($button);

View file

@ -121,7 +121,7 @@ final class PhortuneBalancedPaymentProvider extends PhortunePaymentProvider {
} }
public function getPaymentMethodIcon() { public function getPaymentMethodIcon() {
return celerity_get_resource_uri('/rsrc/image/phortune/balanced.png'); return 'Balanced';
} }
public function getPaymentMethodProviderDescription() { public function getPaymentMethodProviderDescription() {

View file

@ -148,7 +148,7 @@ final class PhortunePayPalPaymentProvider extends PhortunePaymentProvider {
} }
public function getPaymentMethodIcon() { public function getPaymentMethodIcon() {
return celerity_get_resource_uri('rsrc/image/phortune/paypal.png'); return 'PayPal';
} }
public function getPaymentMethodProviderDescription() { public function getPaymentMethodProviderDescription() {

View file

@ -212,13 +212,12 @@ abstract class PhortunePaymentProvider {
require_celerity_resource('phortune-css'); require_celerity_resource('phortune-css');
$icon_uri = $this->getPaymentMethodIcon();
$description = $this->getPaymentMethodProviderDescription(); $description = $this->getPaymentMethodProviderDescription();
$details = $this->getPaymentMethodDescription(); $details = $this->getPaymentMethodDescription();
$icon = id(new PHUIIconView()) $icon = id(new PHUIIconView())
->setImage($icon_uri) ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN)
->addClass('phortune-payment-icon'); ->setSpriteIcon($this->getPaymentMethodIcon());
$button = id(new PHUIButtonView()) $button = id(new PHUIButtonView())
->setSize(PHUIButtonView::BIG) ->setSize(PHUIButtonView::BIG)

View file

@ -29,7 +29,7 @@ final class PhortuneStripePaymentProvider extends PhortunePaymentProvider {
} }
public function getPaymentMethodIcon() { public function getPaymentMethodIcon() {
return celerity_get_resource_uri('/rsrc/image/phortune/stripe.png'); return 'Stripe';
} }
public function getPaymentMethodProviderDescription() { public function getPaymentMethodProviderDescription() {

View file

@ -34,7 +34,7 @@ final class PhortuneTestPaymentProvider extends PhortunePaymentProvider {
} }
public function getPaymentMethodIcon() { public function getPaymentMethodIcon() {
return celerity_get_resource_uri('/rsrc/image/phortune/test.png'); return 'TestPayment';
} }
public function getPaymentMethodProviderDescription() { public function getPaymentMethodProviderDescription() {

View file

@ -148,7 +148,7 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider {
} }
public function getPaymentMethodIcon() { public function getPaymentMethodIcon() {
return celerity_get_resource_uri('/rsrc/image/phortune/wepay.png'); return 'WePay';
} }
public function getPaymentMethodProviderDescription() { public function getPaymentMethodProviderDescription() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB