Skip to content

Commit

Permalink
Fixed django#575 -- Created Stripe customers with an email address.
Browse files Browse the repository at this point in the history
This ensures the first recurring donation gets a receipt mail.
  • Loading branch information
timgraham committed Dec 11, 2015
1 parent 65689e4 commit 5fc5da8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fundraising/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def make_donation(self):
customer.source = stripe_token
customer.save()
else:
customer = stripe.Customer.create(card=stripe_token)
customer = stripe.Customer.create(card=stripe_token, email=receipt_email)
hero.stripe_customer_id = customer.id
hero.save()

Expand Down
1 change: 1 addition & 0 deletions fundraising/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_submitting_donation_form_recurring(self, charge_create, customer_create
self.assertEqual(donations[0].subscription_amount, 100)
self.assertEqual(donations[0].receipt_email, 'test@example.com')
self.assertEqual(donations[0].payment_set.count(), 0)
customer_create.assert_called_with(email='test@example.com', card='test')

@patch('stripe.Customer.create')
@patch('stripe.Charge.create')
Expand Down

0 comments on commit 5fc5da8

Please sign in to comment.