Currently, the option to record the credit card payment, not as a cash transaction is not available in QuickBooks Online. However, you can use a third-party app to handle the recording of the payment. I suggest looking for an app through this site: https://apps.intuit.com.
Since we don't recommend which app you should use, I recommend checking the user reviews from the Intuit App Center. All listed apps will integrate with our QuickBooks product, and it includes an overview of the features.