replace payment_id for payment_uid
minor changes
orders properly handled