[git] gnupg-doc - branch, preview, updated. 82dc5493e47742a665f276561f730364ce96d172

by Werner Koch cvs at cvs.gnupg.org
Tue May 30 09:17:41 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, preview has been updated
       via  82dc5493e47742a665f276561f730364ce96d172 (commit)
      from  865f328df3e277a405b5b519df8a1dba85531131 (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 82dc5493e47742a665f276561f730364ce96d172
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 7dae23d..4f617a7 100755
--- a/cgi/procdonate.cgi
+++ b/cgi/procdonate.cgi
@@ -865,6 +865,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.
@@ -1090,8 +1131,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                               | 47 +++++++++++++++++++++++-
 web/donate/{paypal-can.org => paypal-can.de.org} | 16 ++++++--
 web/donate/paypal-can.ja.org                     |  9 ++++-
 web/donate/paypal-can.org                        | 12 +++++-
 4 files changed, 75 insertions(+), 9 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