Skip to content

Instantly share code, notes, and snippets.

@jamescook
Created July 7, 2009 13:10
Show Gist options
  • Save jamescook/142064 to your computer and use it in GitHub Desktop.
Save jamescook/142064 to your computer and use it in GitHub Desktop.
Card.transaction do
#TODO
if @card.participating_in_top_up_program? # How do we store this?
top_up_amount = (options[:available_balance] - options[:transaction_amount]).abs
# ... magic step where we record the top up/ do special stuff. Does it need to show up in load reports? A different report?
result.success!
return {:pan => options[:account_number], :status => "00", :credit_advance => top_up_amount}
else
result.success!
return {:pan => options[:account_number], :status => "51", :credit_advance => 0.00}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment