diff --git a/docker-compose.yml b/docker-compose.yml index 44b1a911..277365f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,9 @@ services: - LOCAL=True - BUCKET=cs-outputs-dev-1 - MAILGUN_API_KEY=${MAILGUN_API_KEY} + - USE_STRIPE=${USE_STRIPE} + - STRIPE_SECRET=${STRIPE_SECRET} + - WEBHOOK_SECRET=${WEBHOOK_SECRET} ports: - "8000:8000" container_name: web diff --git a/webapp/apps/billing/webhooks.py b/webapp/apps/billing/webhooks.py index 4e19d4c2..50510a1f 100644 --- a/webapp/apps/billing/webhooks.py +++ b/webapp/apps/billing/webhooks.py @@ -14,17 +14,11 @@ def invoice_payment_failed(event, link="test"): print("processing invoice.payment_failed event...") - print("sending mail...") - user = event.customer.user - if hasattr(user, "email"): - target_email = user.email - else: - target_email = "hank@compute.studio" send_mail( - "Your Payment Failed", - f"Please pay the invoice at: {link}", - "hank@compute.studio", - [target_email], + "Compute Studio", + "Payment failed", + "Compute Studio ", + ["hank@compute.studio"], fail_silently=False, ) @@ -33,9 +27,9 @@ def customer_created(event): print("processing customer.created event...") customer = Customer.objects.get(stripe_id=event.data["object"]["id"]) send_mail( - "Welcome to Compute Studio", - "Thanks for joining!", - "hank@compute.studio", + "Compute Studio", + "Your payment method was set successfully! Please write back if you have any questions.", + "Compute Studio ", [customer.user.email], fail_silently=False, )