some template fixes, db seed stuff
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 14:29:39 +0000 (10:29 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 14:29:39 +0000 (10:29 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.stripe-payments.sql
Open-ILS/src/templates/opac/myopac/main_payment_form.tt2
Open-ILS/src/templates/opac/parts/stripe.tt2

index 28308df..6c0eff9 100644 (file)
@@ -3870,11 +3870,11 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'string', null)
 
-,( 'credit.processor.stripe.privatekey', 'credit',
-    oils_i18n_gettext('credit.processor.stripe.privatekey',
+,( 'credit.processor.stripe.secretkey', 'credit',
+    oils_i18n_gettext('credit.processor.stripe.secretkey',
         'Stripe secret key',
         'coust', 'label'),
-    oils_i18n_gettext('credit.processor.stripe.privatekey',
+    oils_i18n_gettext('credit.processor.stripe.secretkey',
         'Stripe secret key',
         'coust', 'description'),
     'string', null)
index e76305a..25a3a41 100644 (file)
@@ -11,7 +11,7 @@ BEGIN;
 --      my fault for setting the precedent with c.p.{authorizenet|paypal|payflowpro}.enabled)
 --  'credit.default.processor' must be 'Stripe'
 --  NEW 'credit.processor.stripe.pubkey' must be set
---  NEW 'credit.processor.stripe.privatekey' must be set
+--  NEW 'credit.processor.stripe.secretkey' must be set
 
 INSERT into config.org_unit_setting_type
 ( name, grp, label, description, datatype, fm_class ) VALUES
@@ -34,11 +34,11 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'string', null)
 
-,( 'credit.processor.stripe.privatekey', 'credit',
-    oils_i18n_gettext('credit.processor.stripe.privatekey',
+,( 'credit.processor.stripe.secretkey', 'credit',
+    oils_i18n_gettext('credit.processor.stripe.secretkey',
         'Stripe secret key',
         'coust', 'label'),
-    oils_i18n_gettext('credit.processor.stripe.privatekey',
+    oils_i18n_gettext('credit.processor.stripe.secretkey',
         'Stripe secret key',
         'coust', 'description'),
     'string', null)
index c5cd8ed..1a631c9 100644 (file)
@@ -5,7 +5,6 @@
     myopac_main_page = "payment_form";
 
     last_chance = CGI.param("last_chance");
-    use_stripe = ctx.get_org_setting(ctx.user.home_ou.id, 'opac.processor.stripe.enabled');
 %]
 [% IF ctx.fines.balance_owed <= 0 %]
 <div>
@@ -28,7 +27,7 @@
     <form method="post" id="payment_form"
     [% IF use_stripe %]
     onsubmit="return stripe_onsubmit();"
-    [% ENDIF %]
+    [% END %]
     >
         <input type="hidden" name="last_chance" value="1" />
         [% FOR xact IN CGI.param('xact') %]
@@ -39,7 +38,7 @@
         [% END %]
         [% IF use_stripe %]
         <input type="hidden" name="stripe_token" id="stripe_token" />
-        [% ENDIF %]
+        [% END %]
         <table>
             <tbody>
                 <tr>
                     data-stripe="number"
                     [% ELSE %]
                     name="number"
-                    [% ENDIF %]
+                    [% END %]
                     /></td>
                 </tr>
                 <tr>
                         data-stripe="cvc"
                         [% ELSE %]
                         name="cvv2"
-                        [% ENDIF %]
+                        [% END %]
                         /></td>
                 </tr>
                 <tr>
                         data-stripe="exp_month"
                         [% ELSE %]
                         name="expire_month"
-                        [% END IF %]
+                        [% END %]
                         >
                             <option value="01">[% l("January") %]</option>
                             <option value="02">[% l("February") %]</option>
                         data-stripe="exp_year"
                         [% ELSE %]
                         name="expire_year"
-                        [% ENDIF %]
+                        [% END %]
                         >
                         [% year = date.format(date.now, '%Y');
                         y = year;
index e857fff..feeba12 100644 (file)
@@ -1,5 +1,7 @@
 [%- PROCESS "opac/parts/header.tt2";
-    IF myopac_main_page == "payment_form" AND ctx.get_org_setting(ctx.user.home_ou.id, 'opac.processor.stripe.enabled')%]
+IF myopac_main_page == "payment_form" AND
+ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.stripe.enabled') AND ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.default') == 'Stripe';
+    use_stripe = 1; %]
 
         <script type="text/javascript" src="https://js.stripe.com/v2/"></script> <!-- use an ou setting for this url? -->
         <script type="text/javascript">