diff --git a/conservancy/supporters/templates/supporters/sustainers_stripe.html b/conservancy/supporters/templates/supporters/sustainers_stripe.html index 37456eb469baf65ec08e447f93a5562aa8903901..8c007112bfc417dd24ec9856ad3c0ac41a86bdb4 100644 --- a/conservancy/supporters/templates/supporters/sustainers_stripe.html +++ b/conservancy/supporters/templates/supporters/sustainers_stripe.html @@ -31,13 +31,115 @@ transform: scale(1.05); } + + {% endblock %} {% block content %} -

Become a Sustainer Now

+ + +

Become a Sustainer Now

Sustainers help us do our work in a strategic, long-term way.

+
+

“If software freedom is important to you, I can't think of a + more effective way to use your money than to support Conservancy.”

+

Made Up Person

+
+
+
+ + + +
+ {% csrf_token %} +
+ Become a Sustainer + {{ form.errors }} +
+
+ +
+
+
+

To send your receipt

+
+
+
+
+ +

Sizing: + Women's, + Men's

+ +
+ Software Freedom Conservancy T-shirt +
+ + +
+ + + +
+
+
+ +

Credit card and ACH payments are processed with Stripe. We also accept payment by paper check and wire transfer and PayPal. Our sustainer program has a minimum of $120 USD per year, but we also accept donations of smaller amounts.

+ +
+ + + +
+
- -
- 84.5% -
-
$15,558
-
Remaining of the $100,000 goal
-
-
-
15 days
-
Remaining
-
- - -
-
- Software Freedom Conservancy T-shirt -
Our new Sustainer T-shirt
-
-
{% endblock %} diff --git a/conservancy/supporters/templates/supporters/sustainers_stripe2.html b/conservancy/supporters/templates/supporters/sustainers_stripe2.html index a5b84d198b61c531c3d5b884f70f0534687b84d7..db88b46a0c010c8355e14bdf4c16a7157de7b5fc 100644 --- a/conservancy/supporters/templates/supporters/sustainers_stripe2.html +++ b/conservancy/supporters/templates/supporters/sustainers_stripe2.html @@ -39,15 +39,17 @@ -
-
-
+
+ + +
+

Giving is known to increase happiness, but are + you sure? + Undo

diff --git a/conservancy/supporters/urls.py b/conservancy/supporters/urls.py index ea0bcbd3131967136989c8bae7d00f81551afe6e..23ea194804b058f2577a17a89e6919dc2bfc6e72 100644 --- a/conservancy/supporters/urls.py +++ b/conservancy/supporters/urls.py @@ -4,7 +4,7 @@ from django.views.generic import TemplateView from . import views urlpatterns = [ - path('', views.sustainers), + path('', views.sustainers, name='sustainers'), path('banner/', TemplateView.as_view(template_name='supporters/banners.html')), path('banners/', TemplateView.as_view(template_name='supporters/banners.html')), path('success/', views.success), diff --git a/conservancy/supporters/views.py b/conservancy/supporters/views.py index afc210f590dfb47c58bb03e3ce1ef5d5d425adcc..7ec1bdd63b160e2242e1627682c619f693ea238b 100644 --- a/conservancy/supporters/views.py +++ b/conservancy/supporters/views.py @@ -76,7 +76,20 @@ def create_checkout_session(reference_id, email: str, amount: int, recurring: st def sustainers_stripe(request): - return render(request, 'supporters/sustainers_stripe.html', {}) + if request.method == 'POST': + form = forms.SustainerForm(request.POST) + if form.is_valid(): + order = form.save(commit=False) + order.recurring = form.data['recurring'] + if order.recurring == 'month': + order.amount = form.cleaned_data['amount_monthly'] + order.save() + base_url = f'{request.scheme}://{request.get_host()}' + stripe_checkout_url = create_checkout_session(order.id, order.email, order.amount, order.recurring, base_url) + return redirect(stripe_checkout_url) + else: + form = forms.SustainerForm() + return render(request, 'supporters/sustainers_stripe.html', {'form': form}) def sustainers_stripe2(request):