ADVANCED PAYMENTS prepare_credits rewritten