Compare commits

...

2 commits

2 changed files with 11 additions and 3 deletions

View file

@ -38,11 +38,13 @@
<section class="mb4"> <section class="mb4">
<noscript> <noscript>
<div style="padding: 1rem; border: 2px solid #0f0; margin-bottom: 1.5rem"> <div style="padding: 1rem; border: 2px solid #0f0; margin-bottom: 1.5rem">
<p><marquee><strong>Hey there!</strong></marquee> Thanks for visiting our site <strong>without JavaScript</strong>! We respect your choice and make a significant effort to ensure our site works without JavaScript or, where necessary, to use only free software JavaScript.</p> <p><marquee><strong>Hey there!</strong></marquee> Thanks for visiting our site <strong>without JavaScript</strong>!</p>
<p>The bad news is that our credit card/ACH payment services <strong>Stripe and PayPal don't work without JavaScript</strong>. We also don't currently have the resources to handle PCI compliant credit-card processing directly.</p> <p>We do our best to ensure our site works without JavaScript or, where necessary, to use only free software JavaScript.</p>
<p>We'd still love to have you as a Sustainer though, and will gladly accept your payment by <a href="#wire-transfer">wire transfer</a> or <a href="#paper-check">paper check</a> . If those aren't feasible, please <a href="mailto:donate@sfconservancy.org">get in touch</a> and we'll try to work something out. Thanks for your support!</p> <p>The bad news is that all credit card/ACH payment services that are available to us, like Stripe and PayPal, <strong>don't work without JavaScript</strong>. We also don't currently have the resources to handle PCI compliant credit-card processing directly.</p>
<p>You can still become a Sustainer by making a payment by <a href="#wire-transfer">wire transfer</a> or <a href="#paper-check">paper check</a>. If those aren't feasible, please <a href="mailto:donate@sfconservancy.org">get in touch</a> and we'll try to work something out. Thanks for your support! And we think you are very cool!</p>
<img src="{% static 'img/dancing-banana.gif' %}" alt="Dancing Banana"> <img src="{% static 'img/dancing-banana.gif' %}" alt="Dancing Banana">
</div> </div>

View file

@ -88,6 +88,12 @@ def sustainers_stripe(request):
if form.is_valid(): if form.is_valid():
order = form.save() order = form.save()
base_url = f'{request.scheme}://{request.get_host()}' base_url = f'{request.scheme}://{request.get_host()}'
# There are a few options for integrating with Stripe. A common one, and
# possibly the least intrusive is to use the proprietary
# https://js.stripe.com/v3/ to embed Stripe form fields into your own
# form. Another embeds a hosted form in your page. The approach we've used
# is to redirect to a hosted checkout page. This is far from perfect, but it
# avoids adding proprietary JS on sfconservancy.org.
stripe_checkout_url = create_checkout_session( stripe_checkout_url = create_checkout_session(
order.id, order.email, order.amount, order.recurring, base_url order.id, order.email, order.amount, order.recurring, base_url
) )