Receiving Payment via Credit Card

Hello

I’m confused by how to record payment made by credit card.

I receive payment by credit card, for example an amount of $1000 is received by credit card, then the company which provides our credit card machine will charge a 1.8% which is $18.
Then the company send me an invoice for $18, and make a bank transfer of $982 to my bank account.

How do I key in this transaction in manager?

Been thinking for a few hours, currently what I do is:

Create Journal Entry 1 (When transaction happened)
Debit: Accounts Receivable (Credit Card Company) $1000
Credit: Income - Sales $1000

Create Journal Entry 2 (When receiving payment)
Debit: Income - Sales $982
Debit: Accounts Payable (Credit Card Company) $18
Credit: Accounts Receivable (Credit Card Company) $1000

Create Bank Transaction (When receiving payment)
Income - Sales $982

But something is still wrong, there are 2 records of this payment in my Income - Sales account. One from Bank Receipt and another from Journal Entry.
How do I solve this issue?

There is no need to use journal entries.

You do a Receive Money to the Credit Card Account
Sales +1000
Credit cards expenses -18

Then when you pay the credit card
use the Inter account transfer

See the guide Set up credit cards