I think the error that you are getting is referring to the setCredit section. The credits are used to apply a previous vendor credit to a bill. You are passing in the Bill TxnID as the credit, but it's a bill transaction, not a credit transaction so QuickBooks is saying it can't find the credit transaction as it doesn't really exist.
If you remove the 4 line section for the ISetCredit, your payment should go through correctly.