diff --git a/resources/celerity/map.php b/resources/celerity/map.php index eb7862b810..2638acd08c 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -306,11 +306,6 @@ return array( 'rsrc/image/people/mckinley.png' => 'fb8f16ce', 'rsrc/image/people/taft.png' => 'd7bc402c', '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_inactive.png' => 'bfc15a69', 'rsrc/image/search-white.png' => '64cc0d45', diff --git a/src/applications/phortune/controller/PhortuneAccountViewController.php b/src/applications/phortune/controller/PhortuneAccountViewController.php index 1017f05ee1..39b23d6dba 100644 --- a/src/applications/phortune/controller/PhortuneAccountViewController.php +++ b/src/applications/phortune/controller/PhortuneAccountViewController.php @@ -130,7 +130,6 @@ final class PhortuneAccountViewController extends PhortuneController { $provider = $method->buildPaymentProvider(); $item->addAttribute($provider->getPaymentMethodProviderDescription()); - $item->setImageURI($provider->getPaymentMethodIcon()); $edit_uri = $this->getApplicationURI('card/'.$id.'/edit/'); diff --git a/src/applications/phortune/controller/PhortuneCartCheckoutController.php b/src/applications/phortune/controller/PhortuneCartCheckoutController.php index 6284c3a04b..fae092ece2 100644 --- a/src/applications/phortune/controller/PhortuneCartCheckoutController.php +++ b/src/applications/phortune/controller/PhortuneCartCheckoutController.php @@ -161,7 +161,7 @@ final class PhortuneCartCheckoutController $add_providers = $this->loadCreatePaymentMethodProvidersForMerchant( $merchant); if ($add_providers) { - $new_method = phutil_tag( + $new_method = javelin_tag( 'a', array( 'class' => 'button grey', diff --git a/src/applications/phortune/controller/PhortuneController.php b/src/applications/phortune/controller/PhortuneController.php index 9195b18c10..87bd6eef7b 100644 --- a/src/applications/phortune/controller/PhortuneController.php +++ b/src/applications/phortune/controller/PhortuneController.php @@ -27,7 +27,7 @@ abstract class PhortuneController extends PhabricatorController { $rows[] = array( $charge->getID(), $cart_href, - $charge->getPaymentProviderKey(), + $charge->getProviderPHID(), $charge->getPaymentMethodPHID(), $charge->getAmountAsCurrency()->formatForDisplay(), $charge->getStatus(), diff --git a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php index 043ee82ff2..831f3983b0 100644 --- a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php +++ b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php @@ -29,8 +29,12 @@ final class PhortunePaymentMethodCreateController return new Aphront404Response(); } - $cancel_uri = $this->getApplicationURI($account->getID().'/'); - $account_uri = $this->getApplicationURI($account->getID().'/'); + $cart_id = $request->getInt('cartID'); + if ($cart_id) { + $cancel_uri = $this->getApplicationURI("cart/{$cart_id}/checkout/"); + } else { + $cancel_uri = $this->getApplicationURI($account->getID().'/'); + } $providers = $this->loadCreatePaymentMethodProvidersForMerchant($merchant); if (!$providers) { @@ -58,7 +62,7 @@ final class PhortunePaymentMethodCreateController ->setTitle(pht('Add Payment Method')) ->appendParagraph(pht('Choose a payment method to add:')) ->appendChild($content) - ->addCancelButton($account_uri); + ->addCancelButton($cancel_uri); } $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 // check out. - $cart_id = $request->getInt('cartID'); if ($cart_id) { $next_uri = $this->getApplicationURI( "cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID()); } else { + $account_uri = $this->getApplicationURI($account->getID().'/'); $next_uri = new PhutilURI($account_uri); $next_uri->setFragment('payment'); } @@ -140,7 +144,7 @@ final class PhortunePaymentMethodCreateController ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Add Payment Method')) - ->addCancelButton($account_uri)); + ->addCancelButton($cancel_uri)); $box = id(new PHUIObjectBoxView()) ->setHeaderText($provider->getPaymentMethodDescription()) @@ -172,18 +176,20 @@ final class PhortunePaymentMethodCreateController $this->requireResource('phortune-css'); $icon = id(new PHUIIconView()) - ->setImage($icon_uri) - ->addClass('phortune-payment-icon'); + ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN) + ->setSpriteIcon($provider->getPaymentMethodIcon()); $button = id(new PHUIButtonView()) ->setSize(PHUIButtonView::BIG) ->setColor(PHUIButtonView::GREY) ->setIcon($icon) ->setText($description) - ->setSubtext($details); + ->setSubtext($details) + ->setMetadata(array('disableWorkflow' => true)); $form = id(new AphrontFormView()) ->setUser($viewer) + ->setAction($request->getRequestURI()) ->addHiddenInput('providerID', $provider->getProviderConfig()->getID()) ->appendChild($button); diff --git a/src/applications/phortune/provider/PhortuneBalancedPaymentProvider.php b/src/applications/phortune/provider/PhortuneBalancedPaymentProvider.php index eb9be17358..c2e74be345 100644 --- a/src/applications/phortune/provider/PhortuneBalancedPaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneBalancedPaymentProvider.php @@ -121,7 +121,7 @@ final class PhortuneBalancedPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodIcon() { - return celerity_get_resource_uri('/rsrc/image/phortune/balanced.png'); + return 'Balanced'; } public function getPaymentMethodProviderDescription() { diff --git a/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php b/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php index c1632c52e1..91d92915a5 100644 --- a/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php +++ b/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php @@ -148,7 +148,7 @@ final class PhortunePayPalPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodIcon() { - return celerity_get_resource_uri('rsrc/image/phortune/paypal.png'); + return 'PayPal'; } public function getPaymentMethodProviderDescription() { diff --git a/src/applications/phortune/provider/PhortunePaymentProvider.php b/src/applications/phortune/provider/PhortunePaymentProvider.php index 3874752ede..a6e925cb1e 100644 --- a/src/applications/phortune/provider/PhortunePaymentProvider.php +++ b/src/applications/phortune/provider/PhortunePaymentProvider.php @@ -212,13 +212,12 @@ abstract class PhortunePaymentProvider { require_celerity_resource('phortune-css'); - $icon_uri = $this->getPaymentMethodIcon(); $description = $this->getPaymentMethodProviderDescription(); $details = $this->getPaymentMethodDescription(); $icon = id(new PHUIIconView()) - ->setImage($icon_uri) - ->addClass('phortune-payment-icon'); + ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN) + ->setSpriteIcon($this->getPaymentMethodIcon()); $button = id(new PHUIButtonView()) ->setSize(PHUIButtonView::BIG) diff --git a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php index e50f6a6a57..6cef2cbf3e 100644 --- a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php @@ -29,7 +29,7 @@ final class PhortuneStripePaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodIcon() { - return celerity_get_resource_uri('/rsrc/image/phortune/stripe.png'); + return 'Stripe'; } public function getPaymentMethodProviderDescription() { diff --git a/src/applications/phortune/provider/PhortuneTestPaymentProvider.php b/src/applications/phortune/provider/PhortuneTestPaymentProvider.php index cbff927fb7..4750931b71 100644 --- a/src/applications/phortune/provider/PhortuneTestPaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneTestPaymentProvider.php @@ -34,7 +34,7 @@ final class PhortuneTestPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodIcon() { - return celerity_get_resource_uri('/rsrc/image/phortune/test.png'); + return 'TestPayment'; } public function getPaymentMethodProviderDescription() { diff --git a/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php b/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php index 7dacd7ed32..9f22c76632 100644 --- a/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php @@ -148,7 +148,7 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodIcon() { - return celerity_get_resource_uri('/rsrc/image/phortune/wepay.png'); + return 'WePay'; } public function getPaymentMethodProviderDescription() { diff --git a/webroot/rsrc/image/phortune/balanced.png b/webroot/rsrc/image/phortune/balanced.png deleted file mode 100644 index ef94cd3ca8..0000000000 Binary files a/webroot/rsrc/image/phortune/balanced.png and /dev/null differ diff --git a/webroot/rsrc/image/phortune/paypal.png b/webroot/rsrc/image/phortune/paypal.png deleted file mode 100644 index ef94cd3ca8..0000000000 Binary files a/webroot/rsrc/image/phortune/paypal.png and /dev/null differ diff --git a/webroot/rsrc/image/phortune/stripe.png b/webroot/rsrc/image/phortune/stripe.png deleted file mode 100644 index ef94cd3ca8..0000000000 Binary files a/webroot/rsrc/image/phortune/stripe.png and /dev/null differ diff --git a/webroot/rsrc/image/phortune/test.png b/webroot/rsrc/image/phortune/test.png deleted file mode 100644 index ef94cd3ca8..0000000000 Binary files a/webroot/rsrc/image/phortune/test.png and /dev/null differ diff --git a/webroot/rsrc/image/phortune/wepay.png b/webroot/rsrc/image/phortune/wepay.png deleted file mode 100644 index ef94cd3ca8..0000000000 Binary files a/webroot/rsrc/image/phortune/wepay.png and /dev/null differ