[git] gnupg-doc - branch, master, updated. 035bc0d1ccdc03f912e49f55cf15f204b27648e6

by Werner Koch cvs at cvs.gnupg.org
Tue May 30 12:36:45 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GnuPG website and other docs".

The branch, master has been updated
       via  035bc0d1ccdc03f912e49f55cf15f204b27648e6 (commit)
       via  612f4fd1b0911ed79e1a510bdcdd3215aa32310e (commit)
      from  f6fb4b66eedd07ce781aa878085fb65a4d07c053 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 035bc0d1ccdc03f912e49f55cf15f204b27648e6
Author: Werner Koch <wk at gnupg.org>
Date:   Tue May 30 09:37:07 2017 +0200

    cgi: Fix getting Lang from the session data.
    
    In the session data dictionary we use "Lang" and not "lang".  Fix
    this so that the ocrrect pages are shown.
    
    Also fix a too long field laben in a German translation.

diff --git a/cgi/procdonate.cgi b/cgi/procdonate.cgi
index 2e6f39a..6f666ff 100755
--- a/cgi/procdonate.cgi
+++ b/cgi/procdonate.cgi
@@ -603,7 +603,7 @@ sub check_donation ()
     }
 
     # Now create a session.
-    $data{"lang"} = $lang;
+    $data{"Lang"} = $lang;
     $data{"Stripeamount"} = $stripeamount;
     $data{"Euroamount"} = $euroamount;
     $data{"Recur"} = $recur;
@@ -633,8 +633,8 @@ sub resend_main_page ()
 
     payproc ('SESSION get ' . $sessid, \%data) or fail $data{"ERR_Description"};
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
     $amount = $data{"Amount"};
     $currency = $data{"Currency"};
@@ -774,8 +774,8 @@ sub complete_stripe_checkout ()
     $paytype = $data{"Paytype"};
 
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
 
     # Do the checkout.
@@ -820,8 +820,8 @@ sub get_paypal_approval ()
         or fail $data{"ERR_Description"};
 
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
 
     $request{"Currency"} = $data{"Currency"};
@@ -881,8 +881,8 @@ sub cancel_paypal_checkout ()
         or fail $data{"ERR_Description"};
 
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
 
     if ( $data{"Paytype"} ne "pp" ) {
@@ -925,8 +925,8 @@ sub confirm_paypal_checkout ()
         or fail $data{"ERR_Description"};
 
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
 
     if ( $data{"Paytype"} ne "pp" ) {
@@ -1008,8 +1008,8 @@ sub complete_sepa ()
         or fail $data{"ERR_Description"};
 
     # If the session has a lang value use that.
-    if ($data{"lang"} ne '') {
-        $lang = $data{"lang"};
+    if ($data{"Lang"} ne '') {
+        $lang = $data{"Lang"};
     }
 
     $request{"Currency"} = $data{"Currency"};
diff --git a/web/donate/checkout-se.de.org b/web/donate/checkout-se.de.org
index 2177b09..43169f3 100644
--- a/web/donate/checkout-se.de.org
+++ b/web/donate/checkout-se.de.org
@@ -105,7 +105,7 @@
               </div>
             </div>
             <div class="form-group">
-              <label class="col-sm-3 control-label">Verwendungszweck</label>
+              <label class="col-sm-3 control-label">Zweck</label>
               <div class="col-sm-9">
                 <p class="form-control-static"><!--SEPA_REF--></p>
               </div>

commit 612f4fd1b0911ed79e1a510bdcdd3215aa32310e
Author: Werner Koch <wk at gnupg.org>
Date:   Tue May 30 09:14:01 2017 +0200

    cgi: Allow returning to the donation form after a paypal cancel
    
    Also added a German Cancel page.  Needs the latest payproc to work.

diff --git a/cgi/procdonate.cgi b/cgi/procdonate.cgi
index 21e4df1..2e6f39a 100755
--- a/cgi/procdonate.cgi
+++ b/cgi/procdonate.cgi
@@ -863,6 +863,47 @@ sub get_paypal_approval ()
 }
 
 
+# The is called by paypal after the user hit cancel.  We need to
+# extract the alias to get back the session data.
+sub cancel_paypal_checkout ()
+{
+    my $aliasid;
+    my $payerid;
+    my %data;
+
+    $aliasid = $q->param("aliasid");
+
+    # Get the session from the alias.
+    payproc ('SESSION sessid ' . $aliasid, \%data)
+        or fail $data{"ERR_Description"};
+    $sessid = $data{"_SESSID"};
+    payproc ('SESSION get ' . $sessid, \%data)
+        or fail $data{"ERR_Description"};
+
+    # If the session has a lang value use that.
+    if ($data{"lang"} ne '') {
+        $lang = $data{"lang"};
+    }
+
+    if ( $data{"Paytype"} ne "pp" ) {
+        fail "Invalid paytype for Paypal transaction";
+    }
+
+    # Set vars for the checkout page.
+    $amount = $data{"Amount"};
+    $currency = $data{"Currency"};
+    $paytype = $data{"Paytype"};
+    $stripeamount = $data{"Stripeamount"};
+    $euroamount = $data{"Euroamount"};
+    $recur = $data{"Recur"};
+    $name = $data{"Name"};
+    $mail = $data{"Mail"};
+    $message = $data{"Message"};
+
+    write_cancel_page ();
+}
+
+
 # The is called by paypal after approval.  We need to extract the alias
 # and the payerid and store it in the session.  Then we ask to confirm
 # the payment.
@@ -1088,8 +1129,10 @@ elsif ($mode eq 'checkout-stripe') {
     complete_stripe_checkout();
 }
 elsif ($mode eq 'cancel-paypal') {
-    # Fixme: Destroy the alias of the session.
-    write_cancel_page();
+    # Paypal transaction has been canceled by Paypal or the user.
+    # Show the cancel page which has a button to return to the
+    # main donation page.
+    cancel_paypal_checkout();
 }
 elsif ($mode eq 'confirm-paypal') {
     # We have approval from Paypal - show the confirm checkout page.
diff --git a/web/donate/paypal-can.org b/web/donate/paypal-can.de.org
similarity index 80%
copy from web/donate/paypal-can.org
copy to web/donate/paypal-can.de.org
index 78d4740..b5953b3 100644
--- a/web/donate/paypal-can.org
+++ b/web/donate/paypal-can.de.org
@@ -1,5 +1,5 @@
 #                                                    -*- html -*-
-#+TITLE: GnuPG - Donate - Paypal Cancelled
+#+TITLE: GnuPG - Spenden - Appruch Paypal Zahlung
 #+STARTUP: showall
 #+SETUPFILE: "../share/setup.inc"
 
@@ -14,7 +14,7 @@
     <script defer src="/share/3rdparty/jquery/jquery.min.js"></script>
     <script defer src="/share/3rdparty/bootstrap/bootstrap.min.js"></script>
   </head>
-  <body lang="en">
+  <body lang="de">
     <!-- Fixed navbar -->
     <nav class="navbar navbar-default navbar-fixed-top">
       <div class="container">
@@ -45,7 +45,8 @@
         <div class="col-md-7 col-md-offset-2">
           <h2>Cancelled</h2>
           <p>
-          You cancelled the donation process.
+          Sie haben den Spendenzahlung abgebrochen oder ein
+          Dauerauftrag ist mittels Ihres Paypal Kontos nicht möglich.
           </p>
         </div>
       </div>
@@ -53,7 +54,14 @@
       <div class="row">
         <div class="col-sm-5 col-md-offset-2">
           <p>
-            <a class="btn btn-default btn-sm" href="/donate">Back</a>
+            <form action="/cgi-bin/procdonate.cgi" method="POST"
+                  class="form-inline">
+              <input type="hidden" name="mode" value="re-main" />
+              <input type="hidden" name="sessid" value="<!--SESSID-->" />
+              <input type="hidden" name="lang" value="<!--LANG-->" />
+              <input type="submit" class="btn btn-default btn-sm"
+                     value="Zurück" />
+            </form>
           </p>
         </div>
       </div>
diff --git a/web/donate/paypal-can.ja.org b/web/donate/paypal-can.ja.org
index 452ff77..75be564 100644
--- a/web/donate/paypal-can.ja.org
+++ b/web/donate/paypal-can.ja.org
@@ -53,7 +53,14 @@
       <div class="row">
         <div class="col-sm-5 col-md-offset-2">
           <p>
-            <a class="btn btn-default btn-sm" href="/donate">戻る</a>
+            <form action="/cgi-bin/procdonate.cgi" method="POST"
+                  class="form-inline">
+              <input type="hidden" name="mode" value="re-main" />
+              <input type="hidden" name="sessid" value="<!--SESSID-->" />
+              <input type="hidden" name="lang" value="<!--LANG-->" />
+              <input type="submit" class="btn btn-default btn-sm"
+                     value="戻る" />
+            </form>
           </p>
         </div>
       </div>
diff --git a/web/donate/paypal-can.org b/web/donate/paypal-can.org
index 78d4740..c867fef 100644
--- a/web/donate/paypal-can.org
+++ b/web/donate/paypal-can.org
@@ -45,7 +45,8 @@
         <div class="col-md-7 col-md-offset-2">
           <h2>Cancelled</h2>
           <p>
-          You cancelled the donation process.
+          You cancelled the donation process or a recurring donation
+          was not possible using your Paypal account.
           </p>
         </div>
       </div>
@@ -53,7 +54,14 @@
       <div class="row">
         <div class="col-sm-5 col-md-offset-2">
           <p>
-            <a class="btn btn-default btn-sm" href="/donate">Back</a>
+            <form action="/cgi-bin/procdonate.cgi" method="POST"
+                  class="form-inline">
+              <input type="hidden" name="mode" value="re-main" />
+              <input type="hidden" name="sessid" value="<!--SESSID-->" />
+              <input type="hidden" name="lang" value="<!--LANG-->" />
+              <input type="submit" class="btn btn-default btn-sm"
+                     value="Back" />
+            </form>
           </p>
         </div>
       </div>

-----------------------------------------------------------------------

Summary of changes:
 cgi/procdonate.cgi                               | 69 +++++++++++++++++++-----
 web/donate/checkout-se.de.org                    |  2 +-
 web/donate/{paypal-can.org => paypal-can.de.org} | 16 ++++--
 web/donate/paypal-can.ja.org                     |  9 +++-
 web/donate/paypal-can.org                        | 12 ++++-
 5 files changed, 87 insertions(+), 21 deletions(-)
 copy web/donate/{paypal-can.org => paypal-can.de.org} (80%)


hooks/post-receive
-- 
The GnuPG website and other docs
http://git.gnupg.org




More information about the Gnupg-commits mailing list