Changeset - 6c87b9d08a2d
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-09-21 23:38:22
chrisjrn@gmail.com
Documentation, and edge case.
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
registripe/views.py
Show inline comments
...
 
@@ -30,6 +30,13 @@ def pubkey_script(request):
 

	
 

	
 
def card(request, invoice_id):
 
    ''' View that shows and processes a Stripe CreditCardForm to pay the given
 
    invoice. Redirects back to the invoice once the invoice is fully paid.
 

	
 
    Arguments:
 
        invoice_id (castable to str): The invoice id for the invoice to pay.
 

	
 
    '''
 

	
 
    form = forms.CreditCardForm(request.POST or None)
 

	
...
 
@@ -40,6 +47,9 @@ def card(request, invoice_id):
 

	
 
    to_invoice = redirect("invoice", inv.invoice.id)
 

	
 
    if inv.invoice.balance_due() <= 0:
 
        return to_invoice
 

	
 
    if request.POST and form.is_valid():
 
        try:
 
            inv.validate_allowed_to_pay()  # Verify that we're allowed to do this.
0 comments (0 inline, 0 general)