Source code for shoop.testing.models._methods
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from shoop.core.models import (
CustomCarrier, CustomPaymentProcessor, PaymentStatus
)
[docs]class CarrierWithCheckoutPhase(CustomCarrier):
pass
[docs]class PaymentWithCheckoutPhase(CustomPaymentProcessor):
[docs] def process_payment_return_request(self, service, order, request):
if order.payment_status == PaymentStatus.NOT_PAID and order.payment_data.get("input_value"):
order.payment_status = PaymentStatus.DEFERRED
order.add_log_entry("Customer promised to pay his bills.")
order.save(update_fields=("payment_status",))