'Verifies that the purchase type is of a valid type.'

def check_purchase_type(self, purchase_type):

    if (purchase_type in (CONTRIB_REFUND, CONTRIB_CHARGEBACK)):
        log_info('Valid    receipt,    but    refunded')
        raise RefundedReceipt
    elif (purchase_type in (CONTRIB_PURCHASE, CONTRIB_NO_CHARGE)):
        log_info('Valid    receipt')
        return
    else:
        log_info('Valid    receipt,    but    invalid    contribution')
        raise InvalidReceipt('WRONG_PURCHASE')
