Skip to content

Instantly share code, notes, and snippets.

@tomriley
Created August 18, 2009 17:31
Show Gist options
  • Save tomriley/169846 to your computer and use it in GitHub Desktop.
Save tomriley/169846 to your computer and use it in GitHub Desktop.
detected = ActiveMerchant::Billing::CreditCard.type?(params[:creditcard][:number])
if detected && params[:creditcard][:type] =~ /maestro|switch/ && detected != params[:creditcard][:type]
params[:creditcard][:type] = detected
logger.warn "Changed card type to #{detected}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment