From 734dd176ce8075fafa8c9227af99e34a3d2d790d Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 12 Jun 2020 09:57:03 -0400 Subject: [PATCH] LP1774892 stripe elements This commmit changes the OPAC to use https://js.stripe.com/v3/ instead of https://js.stripe.com/v2/ for processing payments through Stripe. Additionally, it disables the "internal" credit card form in the staff client when Stripe is the payment processor (or if the processor is not set at all), as that does not currently work. It also does not replace Business::Stripe's use of the "Charges API" with the newer "Payment Intents" API on the backend, but credit card details are still not sent to the Evergreen server. Signed-off-by: Jason Etheridge --- Open-ILS/src/templates/opac/css/style.css.tt2 | 11 ++ .../templates/opac/myopac/main_payment_form.tt2 | 132 +++++++++++++++------ Open-ILS/src/templates/opac/parts/stripe.tt2 | 30 +---- .../staff/circ/patron/t_cc_payment_dialog.tt2 | 2 +- .../web/js/ui/default/staff/circ/patron/bills.js | 15 ++- 5 files changed, 122 insertions(+), 68 deletions(-) diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 72c092fa4f..6fe12ea051 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -1367,6 +1367,17 @@ div.result_table_utils_cont { text-align:center; } +/* Stripe's payment form */ +#payment-form +{ + background-color: [% css_colors.accent_ultralight %]; + width: 50%; +} +#card-element +{ + padding: 10px; +} + /* text to state what is seen on cc statement */ .cc_disclaimer { diff --git a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 index 455af6a91c..6c40229a65 100644 --- a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 @@ -24,8 +24,96 @@ "process credit card payments without it. Please change your " _ "browser settings and try again.") %] + +
+
+ +
+ +
+ + + +
+ + +
+[% ELSE %] +
[% IF last_chance %]

[% l("Are you sure you are ready to charge ") %] @@ -85,11 +173,7 @@ [% l('Cancel') %] [% ELSE %] -

+ [% FOR xact IN CGI.param('xact') %] @@ -97,9 +181,6 @@ [% FOR xact IN CGI.param('xact_misc') %] [% END %] - [% IF ctx.use_stripe %] - - [% END %] @@ -161,36 +242,18 @@ - + +
-
- @@ -210,13 +273,7 @@
- [% year = date.format(date.now, '%Y'); y = year; WHILE y < year + 10; # show ten years starting now %] @@ -249,3 +306,4 @@ [% END %] [% END %] +[% END %] diff --git a/Open-ILS/src/templates/opac/parts/stripe.tt2 b/Open-ILS/src/templates/opac/parts/stripe.tt2 index ea4ca04a61..29fea86025 100644 --- a/Open-ILS/src/templates/opac/parts/stripe.tt2 +++ b/Open-ILS/src/templates/opac/parts/stripe.tt2 @@ -1,35 +1,9 @@ [%- PROCESS "opac/parts/header.tt2" %] [% IF ctx.use_stripe %] - + [%- END %] diff --git a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 index 1551f56b94..4511b51357 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 @@ -13,7 +13,7 @@