[git] gnupg-doc - branch, preview, updated. 31d1c4b99569185dc4c00d7ce1d11c305591a634

by Werner Koch cvs at cvs.gnupg.org
Thu May 11 16:34:47 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  31d1c4b99569185dc4c00d7ce1d11c305591a634 (commit)
      from  8528ce94143a0d2ab020aa0382258611fbf25217 (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 31d1c4b99569185dc4c00d7ce1d11c305591a634
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 11 16:30:16 2017 +0200

    cgi: Improve Stripe recurring donations

diff --git a/cgi/procdonate.cgi b/cgi/procdonate.cgi
index 2a768b2..f2860c6 100755
--- a/cgi/procdonate.cgi
+++ b/cgi/procdonate.cgi
@@ -87,6 +87,7 @@ sub write_template ($) {
     my $publishname;
     my $check_paytype = 'none';
     my $stripe_data_email = '';
+    my $stripe_data_label_value = 'Donate now';
 
     # Avoid broken HTML attributes.
     $amount =~ s/\x22/\x27/g;
@@ -138,12 +139,15 @@ sub write_template ($) {
     } elsif ( $recur =~ /12/ ) {
         $recur_month   = ' selected="selected"';
         $recur_text    = 'monthly';
+        $stripe_data_label_value = 'Donate monthly';
     } elsif ( $recur =~ /4/ ) {
         $recur_quarter = ' selected="selected"';
         $recur_text    = 'quarterly';
+        $stripe_data_label_value = 'Donate quarterly';
     } elsif ( $recur =~ /1/ ) {
         $recur_year    = ' selected="selected"';
         $recur_text    = 'yearly';
+        $stripe_data_label_value = 'Donate yearly';
     }
 
 
@@ -208,6 +212,7 @@ sub write_template ($) {
             || s/(<selected=\x22selected\x22)?><!--RECUR_YEAR-->/$recur_year>/
             || s/<!--RECUR_TEXT-->/$recur_text/
             || s/<!--STRIPE_DATA_EMAIL-->/$stripe_data_email/
+            || s/<!--STRIPE_DATA_LABEL_VALUE-->/$stripe_data_label_value/
             || s/<!--PUBLISH_NAME-->/$publishname/
             || s/<!--SEPA_REF-->/$separef/
             || s/<!--ERRORSTR-->/$errorstr/
@@ -491,6 +496,8 @@ sub complete_stripe_checkout ()
 {
     my %data;
     my %stripe;
+    my $recur;
+    my $recur_text = '';
 
     # fixme: Change the error message to note that the card has not
     # been charged.  Somehow delete the token
@@ -522,17 +529,30 @@ sub complete_stripe_checkout ()
     }
 
     # Print thanks
+    $recur = $stripe{"Recur"};
+    if ( $recur =~ /12/ ) {
+        $recur_text    = 'Monthly';
+    } elsif ( $recur =~ /4/ ) {
+        $recur_text    = 'Quarterly';
+    } elsif ( $recur =~ /1/ ) {
+        $recur_text    = 'Yearly';
+    } else {
+        $recur_text    = 'Just once';
+    }
 
     $message = <<EOF;
-Amount ..: $stripe{"Amount"} $stripe{"Currency"}
-Recurring: $stripe{"Recur"}
-Desc ....: $stripe{"Desc"}
-Cardno...: *$stripe{"Last4"}
-Processor: Stripe
-Email ...: $stripe{"Email"}
-Charge-Id: $stripe{"Charge-Id"}
-Timestamp: $stripe{"_timestamp"}
+Amount ....: $stripe{"Amount"} $stripe{"Currency"}
+Recurring .: $recur_text
+Desc ......: $stripe{"Desc"}
+Cardno.....: *$stripe{"Last4"}
+Processor .: Stripe
+Charge-Id .: $stripe{"Charge-Id"}
+Timestamp .: $stripe{"_timestamp"}
+Email .....: $stripe{"Email"}
 EOF
+    if ($stripe{"account-id"} ne '') {
+        $message = $message . "Account-Id : " . $stripe{"account-id"};
+    }
     if ($stripe{"Live"} eq 'f') {
         $message = $message . "\n!!! TEST TRANSACTION !!!";
     }
diff --git a/web/donate/checkout-cc.org b/web/donate/checkout-cc.org
index 69b2a87..c2809eb 100644
--- a/web/donate/checkout-cc.org
+++ b/web/donate/checkout-cc.org
@@ -16,7 +16,8 @@ Information on your intended donation:
  <tr>
    <td align="right">Amount:</td>
    <td><!--AMOUNT-->
-       <!--CURRENCY--> <!--RECUR_TEXT--></td>
+       <!--CURRENCY-->
+       <!--RECUR_TEXT--></td>
  </tr>
  <tr>
    <td align="right">Name:</td>
@@ -67,8 +68,8 @@ Information on your intended donation:
         data-description="Donation to the GnuPG project"
         data-amount="<!--STRIPEAMOUNT-->"
         data-currency="<!--CURRENCY-->"
-        data-panel-label="Donate {{amount}} <!--RECUR_TEXT--> to GnuPG"
-        data-label="Donate <!--RECUR_TEXT--> now"
+        data-panel-label="Donate {{amount}} <!--RECUR_TEXT-->"
+        data-label="<!--STRIPE_DATA_LABEL_VALUE-->"
         <!--STRIPE_DATA_EMAIL-->
       >
       </script>

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

Summary of changes:
 cgi/procdonate.cgi         | 36 ++++++++++++++++++++++++++++--------
 web/donate/checkout-cc.org |  7 ++++---
 2 files changed, 32 insertions(+), 11 deletions(-)


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




More information about the Gnupg-commits mailing list