From: Bill Erickson Date: Thu, 14 Jul 2016 20:16:38 +0000 (-0400) Subject: JBAS-1494 PayFlow Hosted Pages for CC payments X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2e8596c1e5f2e9d9146846d291ae398a8b02b650;p=working%2FEvergreen.git JBAS-1494 PayFlow Hosted Pages for CC payments https://developer.paypal.com/docs/classic/payflow/gs_ppa_hosted_pages/ * Library settings to configure and activate. * New TPAC templates and WWW perl for processing payments. Signed-off-by: Bill Erickson --- diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 index c273bb0662..3bad65b5ca 100644 --- a/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 @@ -16,7 +16,13 @@ -
+[% + pay_form_url = ctx.opac_root _ '/biblio/main_payment_form'; + IF ctx.using_payflow OR CGI.param('use_payflow'); + pay_form_url = ctx.opac_root _ '/payflow/pay_form'; + END; +%] + [% IF ctx.fines.circulation.size > 0 %]
diff --git a/KCLS/openils/var/templates_kcls/opac/parts/myopac/payment_xacts.tt2 b/KCLS/openils/var/templates_kcls/opac/parts/myopac/payment_xacts.tt2 new file mode 100644 index 0000000000..ae7ee82247 --- /dev/null +++ b/KCLS/openils/var/templates_kcls/opac/parts/myopac/payment_xacts.tt2 @@ -0,0 +1,46 @@ +
+
+

[% l('Selected fines you are paying for:') %]

+ +
+ + + + + + [% + FOR f IN ctx.fines.circulation; + NEXT IF CGI.param('xact').size && + !CGI.param('xact').grep(f.xact.id).size; + attrs = {marc_xml => f.marc_xml}; + IF f.marc_xml; + PROCESS get_marc_attrs args=attrs; + ELSIF f.xact.reservation; + attrs.title = f.xact.reservation.target_resource_type.name; + END %] + + + + + [% + END; + FOR f IN ctx.fines.grocery; + NEXT IF CGI.param('xact_misc').size && + !CGI.param('xact_misc').grep(f.xact.id).size %] + + + + + [% END %] + +
[% l('Name') %][% l('Amount') %]
[% attrs.title | html %][% money(f.xact.balance_owed) %]
[% f.xact.last_billing_type | html %][% money(f.xact.balance_owed) %]
+ +
+ +
+ [% l('Total amount to pay:') %] + [% money(ctx.fines.balance_owed) %] +
+ +
+ diff --git a/KCLS/openils/var/templates_kcls/opac/payflow/errors.tt2 b/KCLS/openils/var/templates_kcls/opac/payflow/errors.tt2 new file mode 100644 index 0000000000..15dc23e848 --- /dev/null +++ b/KCLS/openils/var/templates_kcls/opac/payflow/errors.tt2 @@ -0,0 +1,41 @@ +
+[% + +# Map PayFlow POST response codes to patron messages. +# https://developer.paypal.com/docs/classic/payflow/integration-guide/#result-values-and-respmsg-text + +SWITCH ctx.payflow_hosted_ctx.RESULT; + + CASE '12'; # Declined. + l('Declined. Please verify your card details.'); + + CASE '23'; # Invalid CC number (e..g mis-typed) + l('Declined. Please make sure you entered your credit card number correctly.'); + + CASE '25'; # Transaction type not mapped to this host + l('KCLS does not accept AMEX or Discover Card at this time. Please use your Visa or MasterCard.'); + + CASE '114'; # CVV2 or CID Mismatch + l('Declined. Please make sure you entered the three digit code on the back of your card correctly.'); + + CASE '125'; + handled = 0; + l('Declined. '); + + IF ctx.payflow_hosted_ctx.PROCCVV2 == 'N'; + l('Please make sure you entered the three digit code on the back of your card correctly. '); + handled = 1; + END; + + IF NOT handled + OR ctx.payflow_hosted_ctx.AVSADDR == 'N' + OR ctx.payflow_hosted_ctx.AVSZIP == 'N'; + l('Please make sure your billing information matches what the bank has on file for your credit card.'); + END; + + CASE DEFAULT; + l('An unkown error occurred attempting credit card payment.'); +END; + +%] +
diff --git a/KCLS/openils/var/templates_kcls/opac/payflow/footer.tt2 b/KCLS/openils/var/templates_kcls/opac/payflow/footer.tt2 new file mode 100644 index 0000000000..199765cf1e --- /dev/null +++ b/KCLS/openils/var/templates_kcls/opac/payflow/footer.tt2 @@ -0,0 +1,9 @@ +