Is there a solution to allow credit card swiping from mobile devices for event and contribution pages?
Yes there is! iATS Payments has an encrypted USB card reader that works with its CiviCRM iATS extension as well as a mobile phone card reader that works with their App.
For the mobile option: we're actively working on code required to be pushing them into your CiviCRM as well.
Organizations use it during checkout at fundraising events and in the office to swipe card / walk-ins.