Fix the DOCDATA_PAYMENT_SUCCESS_MARGIN check, moved code up.