Credit card payment fails on NULL mailing address

Bug #1429268 reported by Bill Erickson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
2.8
Fix Released
Undecided
Unassigned
2.9
Fix Released
Undecided
Unassigned

Bug Description

Evergreen master, circa 2.8, likely affects all versions.

Making a credit card payment from the TPAC if no mailing_address is set on the user results in an internal server error:

Can't call method "country" on an undefined value at /opt/kcls/perl/lib/site_perl/5.14.4/OpenILS/Application/Circ/CreditCard.pm line 216.

All address fields needed for payment are collected by the TPAC in the CC payment form, except country, which is set in the back-end by inspecting the user's mailing address. If no mailing address is set, it dies.

===

Granted, this is an edge case, since addresses are effectively required by the patron reg. UI, but the field is NULL-able and anything that can happen, will happen.

I'm considering a patch which falls back to using the billing_address, if no mailing_address is present, and if both are unset, using the value for the "Default Country for New Addresses in Patron Editor" org unit setting.

Michele Morgan (mmorgan)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Doh! I forgot to share the code. Thanks for the reminder, Michele.

Freshly rebased w/ master. FWIW, we're using this in production.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1429268-cc-payment-no-addr

Bill Erickson (berick)
tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.9.1
Changed in evergreen:
milestone: 2.9.1 → 2.next
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_2_9, and rel_2_8. Thanks, Bill!

no longer affects: evergreen/2.7
Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
milestone: 2.next → 2.10-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.