Do not want store credit card details I am using Drupal 8 Commerce 2 Onsite payment gateway with USAepay payment gateway. I do not want to store credit card details in the database, even it should not save last 4 digit last of card number. Is there any way?
There is a reason that they have made it like that.
Take a look at this page, it describes why.

Onsite Payment Gateways always store credit card info
Payment gateways have different capabilities. Some support storing a user's card in the gateway. Others have an &quot;offsite&quot; flow, sending you to their site to collect card info and then returning you back to the commerce site when done.
An &quot;Onsite&quot; payment gateway is one that keeps the visitor on the site, collects the card numbers and posts it from the site to the gateway. In Drupal Commerce 2, the payment flow for onsite gateways is completely different than in Commerce 1, Ubercart, or many other shopping carts: it now stores the credit card in the gateway first, and creates a &quot;Payment Method&quot; associated with the user that contains the token from the gateway. It can then use that token for any future charges (as long as the gateway continues to honor it).