Praise be to Allah.
There is nothing wrong with collecting donations online and allowing the one who wants to donate to pay by credit card, so long as the organization that is collecting the donations takes responsibility for paying the fee to the credit card company, and the donor should not have to pay it.
That is because if the credit card company charges this fee (2.5%) to the organization that is collecting donations, it is regarded as a fee for transferring the money to it.
It is not permissible to take this fee from the customer (the one who is giving the donation) then give it to the credit card company, if the card is not prepaid, because that in reality is riba, as it is a loan that brings a benefit. Withdrawing from a credit card that has not been prepaid is, in effect, a loan that the customer takes from the company, so it is not permissible to pay back anything in addition to that.
A statement to that effect was issued by the Islamic Fiqh Council in its twelfth session in Riyadh, in the Kingdom of Saudi Arabia, 25 Jumada al-Aakhirah 1421- 1 Rajab 1421 AH (23-28 September 2000). The text of the statement is as follows:
b) It is permissible for the issuing bank to charge a fee to the company that accepts this card and sells on that basis, provided that the company sells the product by credit card for the same amount as it sells it for cash.
Thirdly: Cash withdrawals by the card carrier are a loan from the issuer, and there is nothing wrong with that from a shar‘i point of view so long as it will not result in interest (riba). Set fees that are not connected to the amount or duration of this loan are not regarded as interest.
Any charges in addition to the set charges, such as if the charges exceed the amount required to cover the services offered, are haraam because that is riba which is forbidden in sharee‘ah, as was stated by the council in its report no. 13 (10/2) and 13 (1/3).
End quote. See the complete text in Majallat Majma‘ al-Fiqh, vol. 3, p. 673, and in the answer to question no. 97530.
If the donor uses a riba-based credit card, there is nothing wrong with accepting his donation, because it is wealth that belongs to him and it is permissible for him to dispose of it, and the sin of riba is on him.
And Allah knows best.