If you know only the last 4 digits of the card or some random card numbers, then you can use the software that generates the rest of the cards using an algorithm called "Luhn" or "Moon".
This software is available on GitHub.
It seems to me that generating a valid card number will be very difficult, if at all possible.
In addition, you can only use this card number on sites where payment is not required to enter the CVV code, and there are not very many such sites and you need to search for them.
That is, in order to fully use the card number, you will also need to generate a CVV code for it, as well as know the card expiration date.
Entering the first and last name is not required in all payment gateways, but merchants require entering the card number, CVV code and expiration date (month and year) without fail.