Skip to content

Commit

Permalink
Update payment app
Browse files Browse the repository at this point in the history
  • Loading branch information
aclark4life committed Jun 8, 2024
1 parent 4fc8b9c commit cb359d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ from django import forms

class PaymentForm(forms.Form):
stripeToken = forms.CharField(widget=forms.HiddenInput())
amount = forms.DecimalField(max_digits=10, decimal_places=2)
amount = forms.DecimalField(max_digits=10, decimal_places=2, widget=forms.HiddenInput())
endef

define PAYMENT_MODEL
Expand Down Expand Up @@ -1508,7 +1508,9 @@ from .models import Payment

class PaymentView(View):
def get(self, request):
form = PaymentForm()
# Set the amount you want to charge
amount = 50.00 # for example, $50.00
form = PaymentForm(initial={'amount': amount})
return render(request, 'payment.html', {'form': form, 'stripe_publishable_key': settings.STRIPE_PUBLISHABLE_KEY})

def post(self, request):
Expand Down

0 comments on commit cb359d6

Please sign in to comment.