I've only been able to trace it back to Asimov's "Foundation" series, first started in 1942. Anyone know if this trend of currency naming goes back any further?
It certainly goes back further than 1942. In my opinion, it most likely originated with John W. Campbell in the early 1930s. I will present the evidence.
In the online OED, the science-fictional "credit" is sense 14a of the noun:
a. In various informal or fictional contexts: a unit of currency. Later also: a unit used as a measure of a person's entitlement to use of a particular resource, service, product, etc.
1893 Frank Leslie's Pop. Monthly Oct. 486/1 Company scrip, or credits issued for services on the public buildings, canals, etc., forms the currency of the colony.
1937 E. E. Smith in Astounding Stories Dec. 68/2 Bid, one thousand credits per packet of ten. Offered, none at any price.
1962 H. B. Piper in Analog Sci. Fiction/Fact Dec. 122/2 Our currency is based on services to society. Our monetary unit is simply called a credit.
[. . .]
I'm not sure the 1893 example was in exactly the sense we're looking for, and it seems unlikely to have influenced the use of the term by the science fiction writers of the Gernsback and Campbell eras. Anyway, according to the title of your question, you want the earliest use of "credit" as a unit of currency in science fiction, so we can ignore that 1893 citation.
That's the best we can do with the OED. Turning to the Science Fiction Citations page, we see that there is an "unverified" example from John W. Campbell's "The Mightiest Machine", which ran as a 5-part serial in Astounding Stories beginning with the December 1934 issue. Here "unverified" means that the word "credit" was found in a later (and perhaps revised) reprint of Campbell's story, and no one has checked to see if that word is in the original magazine version. That web page has not been updated for a long time. Actually, the 1934 citation has been verified; the exact location (Astounding Stories, Dec. 1934, p. 23, column 1, available at the Internet Archive) is given in Jeff Prucher's Hugo-winning book Brave New Words: The Oxford Dictionary of Science Fiction as well as the exact quotation:
Right enough, and tell me why I have to build that five-million-credit flying laboratory.
There are still earlier examples of "credit" in Campbell's 1932 "Invaders from the Infinite", though the meaning may not be completely clear from the context. The following quotations are from Amazing Stories Quarterly, Spring-Summer 1932, available at the Internet Archive. This one is from Chapter III, p. 153, column 1:
The actual missing material did not represent more than a tiny cut, perhaps as wide as one of your credit-discs. You could slip a thin piece of metal in between them, but not so much as your finger.
The other example is from Chapter IV, p. 155, column 1:
When the men arrived from the hilltop, the work was practically done, and Wade stepped up to Morey, busily checking off a list of required items.
"Everything you ordered came through?" he asked.
:Yes—thanks to Dad, and to the 'pull' of a two-billion dollar private fortune. Who says credit-units don't have their value? This expedition never would have gotten through, if it hadn't been for that. We succeeded in ditching two big orders in the process. Ganymede Mining lost some time—and they are already howling. So is Martian Lead—which is very sad.
Update. According to the ISFDB, the Spring–Summer issue of Amazing Stories Quarterly was published in April of 1932; moreover, "'April 20, 1932' is printed at the bottom of the table of contents." Thus it is probably antedated by the following citation for the form "credit unit" from the story "Prison Planet" by R. F. Starzl in the March 5, 1932, issue of Argosy:
In that instant of murder Sillokan could not watch the technie, and Ranvall tore open the door to disappear into the night. The Martian paid him no attention. Closing the door, he removed the tiny reel from the dead man's clutch, neatly packed the bundles of credit units into the case, and quietly took his departure.
The first instance of "credits" is in the 1888 novel "Looking Backward 2000-1887" by Edward Bellamy. This is both the first time money is referred to as "credits" in scifi (though they are called both "credits" and "dollars") and the first time an abstract "digital" currency is described in scifi. Specifically, the story features the first scifi description of what we would now call a "debit card", though they are actually called "credit cards" in the novel. Describing a Marxist utopia, all citizens receive an equal amount of credits from the state, represented on a punch card. No physical money is in circulation.
A credit corresponding to his share of the annual product of the nation is given to every citizen on the public books at the beginning of each year, and a credit card issued him with which he procures at the public storehouses, found in every community, whatever he desires whenever he desires it. This arrangement, you will see, totally obviates the necessity for business transactions of any sort between individuals and consumers. Perhaps you would like to see what our credit cards are like.
"You observe," he pursued as I was curiously examining the piece of pasteboard he gave me, "that this card is issued for a certain number of dollars. We have kept the old word, but not the substance. The term, as we use it, answers to no real thing, but merely serves as an algebraical symbol for comparing the values of products with one another. For this purpose they are all priced in dollars and cents, just as in your day. The value of what I procure on this card is checked off by the clerk, who pricks out of these tiers of squares the price of what I order."
Note that the punch-cards alluded to here was not a scifi prediction of early computers, but had already been a real-world technology for 150 years before the book was published [2,3].