def copy_attributes(fields, order_item):
    """
    Copy valid attributes from order item.
    """
    payload = dict()
    for field in fields:
        if field in order_item.attributes:
            payload[field] = order_item.attributes.get(field)
    return payload
