Changeset - a162559a05f5
[Not reviewed]
0 1 0
Sachi King - 7 years ago 2017-04-22 09:06:47
nakato@nakato.io
NotImplmented refund

We don't actually do it. Ban it for now.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
registripe/views.py
Show inline comments
...
 
@@ -161,24 +161,25 @@ def refund(request, credit_note_id):
 

	
 
    data = {
 
        "credit_note": cn.credit_note,
 
        "form": form,
 
    }
 

	
 
    return render(
 
        request, "registrasion/stripe/refund.html", data
 
    )
 

	
 

	
 
def process_refund(cn, form):
 
    raise NotImplementedError("Does not actually refund a user")
 
    payment = form.cleaned_data["payment"]
 
    charge = payment.charge
 

	
 
    to_refund = cn.credit_note.value
 
    stripe_charge_id = charge.stripe_charge.id
 

	
 
    # Test that the given charge is allowed to be refunded.
 
    max_refund = actions.charges.calculate_refund_amount(charge)
 

	
 
    if max_refund < to_refund:
 
        raise ValidationError(
 
            "You must select a payment holding greater value than "
0 comments (0 inline, 0 general)