While credit cards and checks spend the same as money in the form of coins and bills, credit is not legal tender.
The Legal Tender Statute only applies to debt. A store can pre-emptively refuse legal tender coins and bills before a debt is incurred. In fact, a store can decide to only accept roasted almonds as payment.
From the US Treasury website
... [T]he Coinage Act of 1965, specifically Section 31 U.S.C. 5103, entitled "Legal tender," which states: "United States coins and currency (including Federal reserve notes and circulating notes of Federal reserve banks and national banks) are legal tender for all debts, public charges, taxes, and dues."
This statute means that all United States money as identified above are a valid and legal offer of payment for debts when tendered to a creditor. There is, however, no Federal statute mandating that a private business, a person or an organization must accept currency or coins as for payment for goods and/or services. Private businesses are free to develop their own policies on whether or not to accept cash unless there is a State law which says otherwise. For example, a bus line may prohibit payment of fares in pennies or dollar bills.
A check is not legal tender. A check is conditional payment and does not immediately discharge a debt.
Supreme Court of Wyoming
AZTEC GAS OIL CORPORATION v. ROEMER OIL COMPANY
AZTEC GAS & OIL CORPORATION, a Nevada Corporation, Appellant (Defendant), v. ROEMER OIL COMPANY, a Colorado Corporation, Appellee (Plaintiff).
No.96-180.
-- December 05, 1997
We adopt a definition of legal tender consistent with both the UCC and regional common law and hold that payment by check does not discharge a debt unless and until the check is honored; once honored, the time of payment relates back to the time the check is delivered.
NY Times 1907 article on legal tender limitations during that time