e02d9565114539a14145993bb20e653a62883a30
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / main_pay.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "pay" %]
6 <div id="myopac_summary_div">
7
8     [% IF ctx.payment_response.textcode %]
9         <div class="payment-error">
10             <span title="[% ctx.payment_response.textcode %]">
11                 [% ctx.payment_response.desc || ctx.payment_response.textcode %]
12             </span><br />
13             [% ctx.payment_response.note %]
14             [% ctx.payment_response.payload.error_message %]
15         </div>
16         <p>
17             [%
18                 url_args = {xact => [], xact_misc => []};
19                 FOR k IN ['xact', 'xact_misc'];
20                     FOR val IN CGI.param(k);
21                         url_args.$k.push(val);
22                     END;
23                 END;
24                 retry_url =  mkurl(ctx.opac_root _ '/myopac/main_payment_form', url_args, 1);
25             %]
26             <br/>
27             <a href="[% retry_url %]">[% l('Go back') %]</a>
28             [% l('to try again or to cancel this payment attempt.') %]
29         </p>
30     [% ELSE %]
31         <p><big>[% l('Your payment has been approved.') %]</big></p>
32         [% IF ctx.printable_receipt.template_output;
33             print_args = [];
34             FOR p IN ctx.payment_response.payments;
35                 print_args.push('payment=' _ p);
36             END %]
37         <p>[ <a href="[% ctx.opac_root %]/myopac/receipt_print?[% print_args.join('&amp;') %]"
38             target="_egrecpt"
39             onclick="try { print_node('printable-receipt'); } catch (e) { window.print(); } return false;">[% l('Print receipt') %]</a> ]</p>
40         <tt id="printable-receipt">
41             [% ctx.printable_receipt.template_output.data %]
42         </tt>
43         [% ELSE %]
44         <div class="payment-error">
45             [% l(
46                 'Error creating receipt: [_1]',
47                     (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) ||
48                     ctx.printable_receipt.error_output.data ||
49                     l('No receipt data returned from server')
50                 ) | html %]
51         </div>
52         [% END %]
53         <p>[ <a href="[% ctx.opac_root %]/myopac/main">[%
54             l("Back to Account Summary") %]</a> ]</p>
55     [% END %]
56 </div>
57 [% END %]