Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r11966: LJSUP-12206 (Remove SMS payments as a pa...

Committer: ailyin
LJSUP-12206 (Remove SMS payments as a payment option)
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Pay.pm
U   trunk/cgi-bin/LJ/Response/Error.pm
U   trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm
U   trunk/cgi-bin/LJ/Widget/IPPU/VGiftSmsPay.pm
U   trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm
U   trunk/templates/Shop/PaymentMethods.tmpl
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/bin/upgrading/en_LJ.dat	2012-05-16 07:24:18 UTC (rev 11966)
@@ -4901,6 +4901,8 @@
 
 partner_sites.ui.doc.view.title=Comments Widget documentation
 
+pay_sup_sms.disabled=SMS payments are disabled
+
 pay.account.xmonths=[[num]] [[?num|month|months]]
 
 pay.blurb.bonus.text=Want to have more userpics, make phone posts, or upload more pictures? <a [[aopts]]>Add a bonus feature</a> to your account!

Modified: trunk/cgi-bin/LJ/Pay.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay.pm	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/cgi-bin/LJ/Pay.pm	2012-05-16 07:24:18 UTC (rev 11966)
@@ -753,9 +753,8 @@
     my $u = shift;
 
     # disable flag can be a ref or not
-    if (my $dis = $LJ::DISABLED{pay_sup_sms}) {
-        return ref $dis ? ! $dis->($u) : ! $dis;
-    }
+    return unless LJ::is_enabled( 'pay_sup_sms', $u );
+
     ## Allow SUP-SMS payment if any of the following is true:
     ## 1. Remote user is logged in and he/she is SUP enabled user
     ## 2. Remote is anonymous user with ex-USSR IP addresses

Modified: trunk/cgi-bin/LJ/Response/Error.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/Error.pm	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/cgi-bin/LJ/Response/Error.pm	2012-05-16 07:24:18 UTC (rev 11966)
@@ -18,6 +18,7 @@
 
     $self->output_http_headers;
 
+    LJ::Request->status( $self->http_status );
     LJ::Request->notes( 'http_errors_no_bml' => 1 );
     LJ::Request->content_type('text/html; charset=utf-8');
     LJ::Request->send_cookies;    

Modified: trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm	2012-05-16 07:24:18 UTC (rev 11966)
@@ -19,9 +19,13 @@
 sub handle_post {
     my ($class, $post, %opts) = @_;
 
+    my $remote = $class->get_effective_remote;
+    unless ( LJ::is_enabled( 'pay_sup_sms', $remote ) ) {
+        return LJ::Lang::ml('pay_sup_sms.disabled');
+    }
+
     BML::set_language_scope('/pay/modify.bml');
 
-    my $remote = $class->get_effective_remote;
     my $now = time();
 
     my ($id) = $post->{uh} =~ m#uh-(\d+)#;

Modified: trunk/cgi-bin/LJ/Widget/IPPU/VGiftSmsPay.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/IPPU/VGiftSmsPay.pm	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/cgi-bin/LJ/Widget/IPPU/VGiftSmsPay.pm	2012-05-16 07:24:18 UTC (rev 11966)
@@ -13,6 +13,11 @@
 sub render_body {
     my ($class, %opts) = @_;
 
+    my $remote = $class->get_effective_remote;
+    unless ( LJ::is_enabled( 'pay_sup_sms', $remote ) ) {
+        return LJ::Lang::ml('pay_sup_sms.disabled');
+    }
+
     my $key = $opts{vgift};
     my $body;
     my $vg = LJ::Pay::ShopVGift->new(name => $key);
@@ -22,7 +27,6 @@
         hover => LJ::ehtml(BML::ml("vgift.$vg_key.anon")),
         id    => 'smspay-image',
     );
-    my $remote = LJ::get_remote();
 
     $body .= "<div id='smspay-order-div'>";
     $body .= "<table><tr><td valign='top' style='padding-right: 10px'>";

Modified: trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm	2012-05-16 07:24:18 UTC (rev 11966)
@@ -11,7 +11,11 @@
 sub need_res {
     my $self = shift;
 
-    LJ::need_res(qw(js/widget_ippu/userheadsmspay.js));
+    my $remote = LJ::get_remote();
+    if ( LJ::is_enabled( 'pay_sup_sms', $remote ) ) {
+        LJ::need_res(qw(js/widget_ippu/userheadsmspay.js));
+    }
+
     $self->SUPER::need_res();
 }
 

Modified: trunk/templates/Shop/PaymentMethods.tmpl
===================================================================
--- trunk/templates/Shop/PaymentMethods.tmpl	2012-05-16 07:18:52 UTC (rev 11965)
+++ trunk/templates/Shop/PaymentMethods.tmpl	2012-05-16 07:24:18 UTC (rev 11966)
@@ -14,7 +14,9 @@
         <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" />
     </a>
-    <span class="shop-payment-text-link"><a href="<TMPL_VAR lj_siteroot>/sup/sms_tos.bml"><TMPL_VAR expr="ml('/shop/index.bml.storefront.paymentmethods.sup_text')"></a></span>
+    <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>
+    </TMPL_IF>
 <TMPL_ELSE>
     <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=7016" alt="PayPal" />

Tags: ailyin, andy, dat, ljcom, 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