コード例 #1
0
def cart_fee(sender: Event, request: HttpRequest, invoice_address, total, **kwargs):
    mod = ''
    try:
        from pretix_resellers.utils import ResellerException, get_reseller_and_user
    except ImportError:
        pass
    else:
        try:
            get_reseller_and_user(request)
        except ResellerException:
            pass
        else:
            mod = '_resellers'
    return get_fees(sender, total, invoice_address, mod)
コード例 #2
0
def order_meta_signal(sender: Event, request: HttpRequest, **kwargs):
    meta = {}
    try:
        from pretix_resellers.utils import ResellerException, get_reseller_and_user
    except ImportError:
        pass
    else:
        try:
            user, reseller = get_reseller_and_user(request)
            meta['servicefees_reseller_id'] = reseller.pk
        except ResellerException:
            pass
    return meta
コード例 #3
0
def cart_fee(sender: Event, request: HttpRequest, invoice_address, total,
             **kwargs):
    mod = ''
    try:
        from pretix_resellers.utils import ResellerException, get_reseller_and_user
    except ImportError:
        pass
    else:
        try:
            reseller, user = get_reseller_and_user(request)
            config = reseller.configs.get(organizer_id=sender.organizer_id)
            if config.skip_default_service_fees:
                return []
        except ResellerException:
            pass
        else:
            mod = '_resellers'
    return get_fees(sender, total, invoice_address, mod, request)