You forgot the select(.creditcard) - see my comment on the gist - as this one does not filter out null'ed creditcards:
name=`date +'%Y%m%d'`;
echo "name,creditcard" > $name;
jq -r '.[] | select(.creditcard) | [.name, .creditcard] | @csv' data.json >> $name