'Add a donation to an order.
Args:
order (Order): The order to add this donation to.
donation_amount (Decimal): The amount the user is donating.
Keyword Args:
course_id (CourseKey): If provided, associate this donation with a particular course.
currency (str): The currency used for the the donation.
Raises:
InvalidCartItem: The provided course ID is not valid.
Returns:
Donation'

@classmethod
@transaction.atomic
def add_to_order(cls, order, donation_amount, course_id=None, currency='usd'):

    super(Donation, cls).add_to_order(order, currency=currency)
    description = cls._line_item_description(course_id=course_id)
    params = {'order': order, 'user': order.user, 'status': order.status, 'qty': 1, 'unit_cost': donation_amount, 'currency': currency, 'line_desc': description}
    if (course_id is not None):
        params['course_id'] = course_id
        params['donation_type'] = 'course'
    else:
        params['donation_type'] = 'general'
    return cls.objects.create(**params)
