Legacy bugfix. Variable no longer exists.
BUGFIX: tender refund to gift card correctly
Better error detection on missing or unwritable files