:raising_hand_man: Disable payment for refunded/canceled orders. I know that #3636 have asked for this, but it has no data about this issue so here we go.
When the order is refunded/canceled, customers should not be able to pay for it again.
But they can! :smile_cat:

@maarcingebala seems like a bug to me. Your thoughts?
IMHO, even the partially refunded order shouldn't be paid again.
Right, it looks like a bug. If an order is refunded, partially refunded or canceled customers shouldn't be able to pay. We have to also make sure that they can retry payment if they placed an order, tried to pay but the payment has failed. We should also provide test cases for these scenarios.
I will take a look whenever I have some free time for it.
For now, I've unassigned you @NyanKiyoshi, anyone who we'll have time to tackle it will be able to take it.
I had worked on it a week ago during my free time, but I got stuck, so I did not go further and then forgot about this issue.
My problem was that I鈥檓 not sure how Saleor should behave when an order is whether partially or fully refunded. Should we flag the order as closed? Thus, make it inactive. Then no payment or change would be possible.
The other thing I thought about was that we might ask the staff user to choose if to close a refunded order.
Then, another thing to be careful about, is if we closed an order when partially refunded, the staff user should still be able to refund again a new amount.
@NyanKiyoshi Maybe we could just disable payment for refunded order in storefront 1.0 first as a starter?
@jxltom it must disable from the core!
@jxltom
@maarcingebala
@NyanKiyoshi
i changed the check_order_status function.
def check_order_status(func):
"""Check if order meets preconditions of payment process.
Order can not have draft status or be fully paid. Billing address
must be provided.
If not, redirect to order details page.
"""
# pylint: disable=cyclic-import
from .models import Order
@wraps(func)
def decorator(*args, **kwargs):
token = kwargs.pop("token")
order = get_object_or_404(Order.objects.confirmed(), token=token)
if not order.billing_address or order.is_fully_paid() or not order.status == 'cancelled' :
return redirect("order:details", token=order.token)
kwargs["order"] = order
return func(*args, **kwargs)
return decorator
and in the front i changed order details .
{% if not order.is_partly_paid and not order.status == 'canceled' %}
and problem is solved:)
if there is a mistake with my code or any problem .
please some one tell me:)