Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[ljcom] r8380: Emergency Saturday fix: PayPal has stopp...

Committer: gariev
Emergency Saturday fix: PayPal has stopped to receive payment details in GET-requests
U   branches/r63.4/htdocs/pay/modify.bml
U   branches/r63.4/htdocs/pay/modify.bml.text.local
Modified: branches/r63.4/htdocs/pay/modify.bml
===================================================================
--- branches/r63.4/htdocs/pay/modify.bml	2010-03-26 14:41:57 UTC (rev 8379)
+++ branches/r63.4/htdocs/pay/modify.bml	2010-03-27 11:13:05 UTC (rev 8380)
@@ -234,16 +234,31 @@
 
             my $count = scalar(@{$cartobj->{'items'}});
             my $amount = $cartobj->{'amount'};
-            my $pp_url = "$LJ::PAYPAL_URL?amount=$amount" .
-                        "&return=http%3A//www.$LJ::DOMAIN/paidaccounts/thankyou.bml" .
-                        "&item_name=" . LJ::eurl("Cart ID $cart ($count item(s))") .
-                        "&custom=" . LJ::eurl("cart=$cart") .
-                        "&business=$LJ::PAYPAL_ACCT" .
-                        "&cmd=_xclick" .
-                        "&no_shipping=1" .
-                        "&no_note=1" .
-                        "&notify_url=http%3A//www.$LJ::DOMAIN/paidaccounts/pp_notify.bml";
-            return BML::redirect($pp_url);
+            my $item_name = LJ::ehtml("Cart ID $cart ($count item(s))");
+            my $custom = LJ::ehtml("cart=$cart");
+            ## some clever guy put escaped account name into config
+            my $business_account_name = LJ::durl($LJ::PAYPAL_ACCT);
+
+            ##
+            ## PayPal has stopped to receive payment params from URL (request method GET),
+            ## but the same params in POST request are ok.
+            ## 
+            $title = $ML{'.ccprocessordown.paypal.link'};
+            $body .= <<"FORM";
+<?h1 $ML{'.ccprocessordown.paypal.go_to_paypal'} h1?>
+<form method='POST' action='$LJ::PAYPAL_URL'>
+<input type='hidden' name='amount'      value='$amount'>
+<input type='hidden' name='return'      value='http://www.$LJ::DOMAIN/paidaccounts/thankyou.bml'>
+<input type='hidden' name='item_name'   value='$item_name'>
+<input type='hidden' name='custom'      value='$custom'>
+<input type='hidden' name='business'    value='$business_account_name'>
+<input type='hidden' name='cmd'         value='_xclick'>
+<input type='hidden' name='no_shipping' value='1'>
+<input type='hidden' name='no_note'     value='1'>
+<input type='hidden' name='notify_url'  value='http://www.$LJ::DOMAIN/paidaccounts/pp_notify.bml'>
+<input type="image" alt="Make payments with PayPal - it's fast, free and secure!" name="submit" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif">
+FORM
+            return;
         } elsif ($paymeth eq "webmoney") {
             # when a user checks out via webmoney we'll first display a confirmation page
             # explaining what webmoney is and next steps they must follow.  once the user

Modified: branches/r63.4/htdocs/pay/modify.bml.text.local
===================================================================
--- branches/r63.4/htdocs/pay/modify.bml.text.local	2010-03-26 14:41:57 UTC (rev 8379)
+++ branches/r63.4/htdocs/pay/modify.bml.text.local	2010-03-27 11:13:05 UTC (rev 8380)
@@ -17,6 +17,8 @@
 
 .ccprocessordown.paypal.link=Pay with PayPal
 
+.ccprocessordown.paypal.go_to_paypal=Press the button below to go to PayPal site:
+
 .ccprocessordown.text=Our primary credit card processing gateway is temporarily unavailable for reasons outside our control.
 
 .ccprocessordown.title=Primary Credit Card Processor Unavailable

Tags: bml, gariev, ljcom, local
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