Person A offers some digital goods to Person B, they both don't know each other. Person B however requires that Person A show him the goods beforehand as proof that they are legit, which reveal them in such a way(and no, it's not possible any other way), that Person A can be scammed and not got paid.
How should a deal be made, where neither entities can scam each other, but also Person B to pay for sure.
Do you mean for example selling an ebook? So showing the digital good beforehand means actually sending it before the payment?
The only solution is using a trusted escrow. Persons A and B agree a detailed description, person A sends the good to the escrow and he confirms the good is as described (and decides by himself whether its legit). Then person B sends the payment to A, the escrow confirms it and forwards the good to person B.
Of course the escrow would also receive the good but there's no other way. Person A could use the same escrow several times (instead of giving away the good to several escrows) and should trust him enough that he won't re-sell it.
'Escrow' is the answer to most 'how to deal' questions.