finish course purchase function