журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[ljcom] r12967: LJSUP-14395: Hide Yandex money, Qiwi and...

Committer: nnikulochkina
LJSUP-14395: Hide Yandex money, Qiwi and mobile payments for non-cyr users
U   trunk/cgi-bin/LJ/Pay/Method/YandexMoney.pm
U   trunk/cgi-bin/LJ/Pay/Method.pm
U   trunk/templates/Shop/PaymentMethods.tmpl
Modified: trunk/cgi-bin/LJ/Pay/Method/YandexMoney.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Method/YandexMoney.pm	2012-11-29 10:25:57 UTC (rev 12966)
+++ trunk/cgi-bin/LJ/Pay/Method/YandexMoney.pm	2012-11-29 11:01:53 UTC (rev 12967)
@@ -28,6 +28,17 @@
     return LJ::Pay::can_use_sup_yandex($remote);
 }
 
+sub suitable_for_additional_checks {
+    my ($class, $cart) = @_;
+
+    return 1 unless LJ::is_enabled('dengionline');
+
+    my $u = $cart->get_owner();
+
+    return  LJ::SUP->is_sup_enabled($u) ? 1 : 0;
+}
+
+
 sub allow_open_proxy { 1 }
 
 sub get_page_params {

Modified: trunk/cgi-bin/LJ/Pay/Method.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Method.pm	2012-11-29 10:25:57 UTC (rev 12966)
+++ trunk/cgi-bin/LJ/Pay/Method.pm	2012-11-29 11:01:53 UTC (rev 12967)
@@ -57,6 +57,8 @@
         'PayPal',
         'YandexMoney',
         'WebMoney',
+        'QiWi',
+        'Mobile',
     ],
     'other' => [
         'Free',
@@ -66,11 +68,6 @@
 
 use constant GROUPS_ORDER => [ qw(fast slow other) ];
 
-use constant DO_METHODS_LIST => [
-    'QiWi',
-    ( !$LJ::DISABLED{'dengionline_mob'} ?  'Mobile' : () ),
-];
-
 # initialization code. do not touch this.
 my @METHODS = LJ::ModuleLoader->module_subclasses(__PACKAGE__);
 my %CLASS_MAP;
@@ -149,14 +146,6 @@
         $ret{$group} = \@suitable;
     }
 
-    unless ($LJ::DISABLED{'dengionline'}) {
-        foreach my $method (@{DO_METHODS_LIST()}) {
-            my $method_full = __PACKAGE__ . '::' . $method;
-            next unless $method_full->suitable_for($cart);
-            push @{$ret{'fast'}}, $method_full;
-        }
-    }
-
     return \%ret;
 }
 

Modified: trunk/templates/Shop/PaymentMethods.tmpl
===================================================================
--- trunk/templates/Shop/PaymentMethods.tmpl	2012-11-29 10:25:57 UTC (rev 12966)
+++ trunk/templates/Shop/PaymentMethods.tmpl	2012-11-29 11:01:53 UTC (rev 12967)
@@ -7,12 +7,17 @@
 <TMPL_IF remote_sup>
     <a href="<TMPL_VAR lj_siteroot>/support/faqbrowse.bml?faqid=21#methods" class="paymentmethods-logos">
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/paypal.png?v=21882" alt="PayPal" />
+        <img src="<TMPL_VAR lj_imgprefix>/shop/payment/webmoney.png?v=21882" alt="WebMoney" /><br />
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/yad.png?v=7183" alt="<TMPL_VAR expr="ml('/shop/index.bml.storefront.paymentmethods.yad')">" />
-        <img src="<TMPL_VAR lj_imgprefix>/shop/payment/webmoney.png?v=21882" alt="WebMoney" /><br />
+        <img src="<TMPL_VAR lj_imgprefix>/shop/payment/qiwi.png?v=1" alt="Qiwi" /><br />
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/visa.png?v=21882" alt="VISA" />
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/mastercard.png?v=7016" alt="MasterCard" />
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/aexpress.png?v=7016" alt="American Expess" />
         <img src="<TMPL_VAR lj_imgprefix>/shop/payment/dnovus.png?v=7016" alt="Discover Novus" />
+        <TMPL_IF expr="lj_enabled('dengionline_mob')">
+                <img src="<TMPL_VAR lj_imgprefix>/shop/payment/mts.png?v=1" alt="MTS" />
+                <img src="<TMPL_VAR lj_imgprefix>/shop/payment/megafon.png?v=1" alt="Megafon" />
+        </TMPL_IF>
     </a>
     <TMPL_IF expr="lj_enabled('pay_sup_sms')">
         <span class="shop-payment-text-link"><a href="<TMPL_VAR lj_siteroot>/sup/sms_tos"><TMPL_VAR expr="ml('/shop/index.bml.storefront.paymentmethods.sup_text')"></a></span>

Tags: ljcom, nikulochkina, nnikulochkina, pm, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments