mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
Make Phortune checkout UI a little less bad
Summary: Ref T2787. There were some mega-uggo buttons and such; reduce the uggo-ness by a hair. Test Plan: {F179686} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D10006
This commit is contained in:
parent
d6eb1c67e7
commit
9a892dd906
8 changed files with 63 additions and 62 deletions
|
@ -84,7 +84,7 @@ return array(
|
||||||
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
|
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
|
||||||
'rsrc/css/application/pholio/pholio.css' => '47dffb9c',
|
'rsrc/css/application/pholio/pholio.css' => '47dffb9c',
|
||||||
'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb',
|
'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb',
|
||||||
'rsrc/css/application/phortune/phortune.css' => '012360a6',
|
'rsrc/css/application/phortune/phortune.css' => '9149f103',
|
||||||
'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad',
|
'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad',
|
||||||
'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071',
|
'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071',
|
||||||
'rsrc/css/application/policy/policy-edit.css' => '05cca26a',
|
'rsrc/css/application/policy/policy-edit.css' => '05cca26a',
|
||||||
|
@ -767,7 +767,7 @@ return array(
|
||||||
'pholio-inline-comments-css' => '8e545e49',
|
'pholio-inline-comments-css' => '8e545e49',
|
||||||
'phortune-credit-card-form' => '2290aeef',
|
'phortune-credit-card-form' => '2290aeef',
|
||||||
'phortune-credit-card-form-css' => 'b25b4beb',
|
'phortune-credit-card-form-css' => 'b25b4beb',
|
||||||
'phortune-css' => '012360a6',
|
'phortune-css' => '9149f103',
|
||||||
'phrequent-css' => 'ffc185ad',
|
'phrequent-css' => 'ffc185ad',
|
||||||
'phriction-document-css' => '7d7f0071',
|
'phriction-document-css' => '7d7f0071',
|
||||||
'phui-action-header-view-css' => '83e2cc86',
|
'phui-action-header-view-css' => '83e2cc86',
|
||||||
|
|
|
@ -146,6 +146,13 @@ final class PhortuneCartCheckoutController
|
||||||
$viewer);
|
$viewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$one_time_options = phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'phortune-payment-onetime-list',
|
||||||
|
),
|
||||||
|
$one_time_options);
|
||||||
|
|
||||||
$provider_form = new PHUIFormLayoutView();
|
$provider_form = new PHUIFormLayoutView();
|
||||||
$provider_form->appendChild(
|
$provider_form->appendChild(
|
||||||
id(new AphrontFormMarkupControl())
|
id(new AphrontFormMarkupControl())
|
||||||
|
|
|
@ -181,7 +181,37 @@ abstract class PhortunePaymentProvider {
|
||||||
PhortuneAccount $account,
|
PhortuneAccount $account,
|
||||||
PhortuneCart $cart,
|
PhortuneCart $cart,
|
||||||
PhabricatorUser $user) {
|
PhabricatorUser $user) {
|
||||||
throw new PhortuneNotImplementedException($this);
|
|
||||||
|
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');
|
||||||
|
|
||||||
|
$button = id(new PHUIButtonView())
|
||||||
|
->setSize(PHUIButtonView::BIG)
|
||||||
|
->setColor(PHUIButtonView::GREY)
|
||||||
|
->setIcon($icon)
|
||||||
|
->setText($description)
|
||||||
|
->setSubtext($details);
|
||||||
|
|
||||||
|
$uri = $this->getControllerURI(
|
||||||
|
'checkout',
|
||||||
|
array(
|
||||||
|
'cartID' => $cart->getID(),
|
||||||
|
));
|
||||||
|
|
||||||
|
return phabricator_form(
|
||||||
|
$user,
|
||||||
|
array(
|
||||||
|
'action' => $uri,
|
||||||
|
'method' => 'POST',
|
||||||
|
),
|
||||||
|
$button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,17 @@ final class PhortunePaypalPaymentProvider extends PhortunePaymentProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaymentMethodDescription() {
|
public function getPaymentMethodDescription() {
|
||||||
return 'Paypal Account';
|
return pht('Credit Card or Paypal Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaymentMethodIcon() {
|
public function getPaymentMethodIcon() {
|
||||||
return 'rsrc/phortune/paypal.png';
|
return celerity_get_resource_uri('rsrc/image/phortune/paypal.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaymentMethodProviderDescription() {
|
public function getPaymentMethodProviderDescription() {
|
||||||
return 'Paypal';
|
return 'Paypal';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function canHandlePaymentMethod(PhortunePaymentMethod $method) {
|
public function canHandlePaymentMethod(PhortunePaymentMethod $method) {
|
||||||
$type = $method->getMetadataValue('type');
|
$type = $method->getMetadataValue('type');
|
||||||
return ($type == 'paypal');
|
return ($type == 'paypal');
|
||||||
|
@ -58,33 +57,6 @@ final class PhortunePaypalPaymentProvider extends PhortunePaymentProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderOneTimePaymentButton(
|
|
||||||
PhortuneAccount $account,
|
|
||||||
PhortuneCart $cart,
|
|
||||||
PhabricatorUser $user) {
|
|
||||||
|
|
||||||
$uri = $this->getControllerURI(
|
|
||||||
'checkout',
|
|
||||||
array(
|
|
||||||
'cartID' => $cart->getID(),
|
|
||||||
));
|
|
||||||
|
|
||||||
return phabricator_form(
|
|
||||||
$user,
|
|
||||||
array(
|
|
||||||
'action' => $uri,
|
|
||||||
'method' => 'POST',
|
|
||||||
),
|
|
||||||
phutil_tag(
|
|
||||||
'button',
|
|
||||||
array(
|
|
||||||
'class' => 'green',
|
|
||||||
'type' => 'submit',
|
|
||||||
),
|
|
||||||
pht('Pay with Paypal')));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -( Controllers )-------------------------------------------------------- */
|
/* -( Controllers )-------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,13 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaymentMethodIcon() {
|
public function getPaymentMethodIcon() {
|
||||||
return 'rsrc/phortune/wepay.png';
|
return celerity_get_resource_uri('/rsrc/image/phortune/wepay.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaymentMethodProviderDescription() {
|
public function getPaymentMethodProviderDescription() {
|
||||||
return 'WePay';
|
return 'WePay';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function canHandlePaymentMethod(PhortunePaymentMethod $method) {
|
public function canHandlePaymentMethod(PhortunePaymentMethod $method) {
|
||||||
$type = $method->getMetadataValue('type');
|
$type = $method->getMetadataValue('type');
|
||||||
return ($type == 'wepay');
|
return ($type == 'wepay');
|
||||||
|
@ -64,32 +63,6 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderOneTimePaymentButton(
|
|
||||||
PhortuneAccount $account,
|
|
||||||
PhortuneCart $cart,
|
|
||||||
PhabricatorUser $user) {
|
|
||||||
|
|
||||||
$uri = $this->getControllerURI(
|
|
||||||
'checkout',
|
|
||||||
array(
|
|
||||||
'cartID' => $cart->getID(),
|
|
||||||
));
|
|
||||||
|
|
||||||
return phabricator_form(
|
|
||||||
$user,
|
|
||||||
array(
|
|
||||||
'action' => $uri,
|
|
||||||
'method' => 'POST',
|
|
||||||
),
|
|
||||||
phutil_tag(
|
|
||||||
'button',
|
|
||||||
array(
|
|
||||||
'class' => 'green',
|
|
||||||
'type' => 'submit',
|
|
||||||
),
|
|
||||||
pht('Pay with WePay')));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -( Controllers )-------------------------------------------------------- */
|
/* -( Controllers )-------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,15 @@ final class PhortunePaymentMethodQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function willFilterPage(array $methods) {
|
protected function willFilterPage(array $methods) {
|
||||||
|
foreach ($methods as $key => $method) {
|
||||||
|
try {
|
||||||
|
$method->buildPaymentProvider();
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
unset($methods[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$accounts = id(new PhortuneAccountQuery())
|
$accounts = id(new PhortuneAccountQuery())
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
->withPHIDs(mpull($methods, 'getAccountPHID'))
|
->withPHIDs(mpull($methods, 'getAccountPHID'))
|
||||||
|
|
|
@ -48,7 +48,8 @@ final class PhortunePaymentMethod extends PhortuneDAO
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription() {
|
public function getDescription() {
|
||||||
return '...';
|
$provider = $this->buildPaymentProvider();
|
||||||
|
return $provider->getPaymentMethodProviderDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetadataValue($key, $default = null) {
|
public function getMetadataValue($key, $default = null) {
|
||||||
|
|
|
@ -15,3 +15,12 @@
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phortune-payment-onetime-list {
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.phortune-payment-onetime-list button {
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue