2018-07-07 22:01:06 +00:00
|
|
|
# -*- mode: python; coding: utf-8 -*-
|
2020-11-23 16:06:37 +00:00
|
|
|
# Re2o est un logiciel d'administration développé initiallement au Rézo Metz. Il
|
2018-07-07 22:01:06 +00:00
|
|
|
# se veut agnostique au réseau considéré, de manière à être installable en
|
|
|
|
# quelques clics.
|
|
|
|
#
|
|
|
|
# Copyright © 2018 Hugo Levy-Falk
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
|
2018-07-02 19:13:13 +00:00
|
|
|
class PaymentMethodMixin:
|
2018-07-07 22:01:06 +00:00
|
|
|
"""A simple mixin to avoid redefining end_payment if you don't need to"""
|
2018-07-02 19:13:13 +00:00
|
|
|
|
2021-02-02 19:58:12 +00:00
|
|
|
def end_payment(self, invoice, request, *args, **kwargs):
|
2018-07-02 19:13:13 +00:00
|
|
|
"""Redefine this method in order to get a different ending to the
|
|
|
|
payment session if you whish.
|
|
|
|
|
|
|
|
Must return a HttpResponse-like object.
|
|
|
|
"""
|
2021-02-02 19:58:12 +00:00
|
|
|
return self.payment.end_payment(invoice, request, use_payment_method=False, *args, **kwargs)
|