Credit card payment fails on NULL mailing address
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/
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.
Changed in evergreen: | |
status: | New → Confirmed |
tags: | added: pullrequest |
Changed in evergreen: | |
milestone: | none → 2.9.1 |
Changed in evergreen: | |
milestone: | 2.9.1 → 2.next |
Changed in evergreen: | |
milestone: | 2.next → 2.10-beta |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
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