If payment processor is Stripe, only show payment form if Javascript enabled. collab/senator/opac-stripe
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 11 Oct 2013 04:53:52 +0000 (00:53 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 11 Oct 2013 04:55:07 +0000 (00:55 -0400)
Stripe doesn't work without it.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/opac/myopac/main_payment_form.tt2
Open-ILS/src/templates/opac/parts/js.tt2

index cecb607..b1dd27c 100644 (file)
@@ -16,7 +16,14 @@ END %]
         "total is non-positive.  We cannot process non-positive amounts.") %]
 </div>
 [% ELSE %]
-<div id="pay_fines_now">
+[% IF ctx.use_stripe %]
+<noscript>
+    [% l("Your browser does not have Javascript enabled, and we cannot " _
+        "process credit card payments without it.  Please change your " _
+        "browser settings and try again.") %]
+</noscript>
+[% END %]
+<div id="pay_fines_now"[% IF ctx.use_stripe %] class="hide_me"[% END %]>
     [% IF last_chance %]
     <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
     <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="post">
@@ -128,7 +135,7 @@ END %]
                 </tr>
                 <tr>
                     <td>[% l('Credit Card #') %]</td>
-                    <td><input type="number" maxlength="16" 
+                    <td><input type="text" maxlength="16"
                     [% IF ctx.use_stripe %]
                     data-stripe="number"
                     [% ELSE %]
@@ -139,7 +146,7 @@ END %]
                 <tr>
                     <td>[% l('Security Code') %]</td>
                     <td>
-                        <input type="number" size="4" maxlength="5" 
+                        <input type="text" size="4" maxlength="5"
                         [% IF ctx.use_stripe %]
                         data-stripe="cvc"
                         [% ELSE %]
index 67d09fb..ed68480 100644 (file)
@@ -1,6 +1,10 @@
 <!-- JS imports, etc.  -->
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js"></script>
 
+[%- IF ctx.use_stripe %]
+<script type="text/javascript">unHideMe($("pay_fines_now"));[%# the DOM is loaded now, right? %]</script>
+[% END -%]
+
 [%- IF ctx.is_staff %]
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js"></script>
     [% IF ctx.page == 'record' %]