2 (typeof(SelfCheckManager) == "undefined") ?
3 (function PaymentForm() {}) : SelfCheckManager
6 proto.drawPayFinesPage = function(patron, onPaymentSubmit) {
8 this.finesTBody = dojo.byId("oils-selfck-fines-tbody");
10 // find the total selected amount
13 dojo.query('[name=selector]', this.finesTbody),
16 total += Number(input.getAttribute('balance_owed'));
19 total = total.toFixed(2);
21 dojo.query("span", "oils-selfck-cc-payment-summary")[0].innerHTML = total;
23 oilsSelfckCCNumber.attr('value', '');
24 oilsSelfckCCMonth.attr('value', '01');
25 oilsSelfckCCYear.attr('value', new Date().getFullYear());
26 oilsSelfckCCFName.attr('value', patron.first_given_name());
27 oilsSelfckCCLName.attr('value', patron.family_name());
28 var addr = patron.billing_address() || patron.mailing_address();
31 oilsSelfckCCStreet.attr('value', addr.street1()+' '+addr.street2());
32 oilsSelfckCCCity.attr('value', addr.city());
33 oilsSelfckCCState.attr('value', addr.state());
34 oilsSelfckCCZip.attr('value', addr.post_code());
37 dojo.connect(oilsSelfckEditDetails, 'onChange',
47 function(dij) { dij.attr('disabled', !newVal); }
54 dojo.connect(oilsSelfckCCSubmit, 'onClick',
56 progressDialog.show(true);
57 self.sendCCPayment(onPaymentSubmit);
62 // In this form, this code only supports global on/off credit card
63 // payments and does not dissallow payments to transactions that started
64 // at remote locations or transactions that have accumulated billings at
65 // remote locations that dissalow credit card payments.
66 // TODO add per-transaction blocks for orgs that do not support CC payments
68 proto.sendCCPayment = function(onPaymentSubmit) {
71 userid : this.patron.id(),
72 payment_type : 'credit_card_payment',
76 number : oilsSelfckCCNumber.attr('value'),
77 expire_year : oilsSelfckCCYear.attr('value'),
78 expire_month : oilsSelfckCCMonth.attr('value'),
79 billing_first : oilsSelfckCCFName.attr('value'),
80 billing_last : oilsSelfckCCLName.attr('value'),
81 billing_address : oilsSelfckCCStreet.attr('value'),
82 billing_city : oilsSelfckCCCity.attr('value'),
83 billing_state : oilsSelfckCCState.attr('value'),
84 billing_zip : oilsSelfckCCZip.attr('value')
89 // find the selected transactions
91 dojo.query('[name=selector]', this.finesTbody),
95 input.getAttribute('xact'),
96 Number(input.getAttribute('balance_owed')).toFixed(2)
103 var resp = fieldmapper.standardRequest(
104 ['open-ils.circ', 'open-ils.circ.money.payment'],
105 {params : [this.authtoken, args]}
108 progressDialog.hide();
110 var evt = openils.Event.parse(resp);
113 else if (typeof(onPaymentSubmit) == "function")