diff --git a/README.rst b/README.rst index 7442d24..8a4ce67 100644 --- a/README.rst +++ b/README.rst @@ -173,9 +173,9 @@ To list paying customers, execute: .. code-block:: sql - SELECT * FROM rb_pay_what_you_can - INNER JOIN rb_user ON rb_user.id = rb_pay_what_you_can.user_id - WHERE amount > 0 AND rb_user.stripe_id IS NOT NULL; + SELECT * FROM rb_payment + INNER JOIN rb_user ON rb_user.id = rb_payment.user_id + WHERE status = 'completed'; Python Pyramid Shell ============================================== diff --git a/journal.rst b/journal.rst index 03f7a53..7ac8dc6 100644 --- a/journal.rst +++ b/journal.rst @@ -225,12 +225,12 @@ We should build a Remarkbox to matrix bridge. I bet it is a lot like working wit Sat Apr 3 10:40:05 PM EDT 2021 ===================================== -this is a useful SQL query to SELECT users who want to pay and also gave a credit card. +this is a useful SQL query to SELECT users who have paid. :: - SELECT * FROM rb_pay_what_you_can - INNER JOIN rb_user ON rb_user.id = rb_pay_what_you_can.user_id - WHERE amount > 0 and rb_user.stripe_id is not null; + SELECT * FROM rb_payment + INNER JOIN rb_user ON rb_user.id = rb_payment.user_id + WHERE status = 'completed'; diff --git a/remarkbox/tests/test_views.py b/remarkbox/tests/test_views.py index b5dee4f..49c2cfb 100644 --- a/remarkbox/tests/test_views.py +++ b/remarkbox/tests/test_views.py @@ -282,72 +282,6 @@ class AuthenticatedFunctionalTests(FunctionalTests): self.dbsession.refresh(namespace_request) self.assertTrue(namespace_request.verified) - ## the only reason we need to patch is because of temporary operator email. - #@patch("smtplib.SMTP") - #def test_billing(self, mock_smtp): - - # self._log_in_test_user(self.test_creds1) - - # billing_response = self.testapp.post( - # "/billing/add-card", - # { - # "email": "test@remarkbox.com", - # "csrf_token": self.csrf, - # "stripeToken": "tok_visa", - # }, - # ) - - # self.dbsession.refresh(self.test_user1) - # customer = stripe.Customer.retrieve(self.test_user1.stripe_id) - # self.assertEqual( - # customer.sources.retrieve(customer.default_source).brand, "Visa" - # ) - - # self.testapp.post( - # "/billing/add-card", - # { - # "email": "test@remarkbox.com", - # "csrf_token": self.csrf, - # "stripeToken": "tok_amex", - # }, - # ) - - # for source in customer.sources.list(): - # if source.brand == "Visa": - # visa = source - # if source.brand == "American Express": - # amex = source - - # self.testapp.post( - # "/billing/update-card", - # { - # "email": "test@remarkbox.com", - # "csrf_token": self.csrf, - # "action": "make-card-active", - # "card_id": amex.id, - # }, - # ) - - # customer = stripe.Customer.retrieve(self.test_user1.stripe_id) - # self.assertEqual( - # customer.sources.retrieve(customer.default_source).brand, "American Express" - # ) - - # self.testapp.post( - # "/billing/update-card", - # { - # "email": "test@remarkbox.com", - # "csrf_token": self.csrf, - # "action": "delete-card", - # "card_id": amex.id, - # }, - # ) - - # customer = stripe.Customer.retrieve(self.test_user1.stripe_id) - # self.assertEqual( - # customer.sources.retrieve(customer.default_source).brand, "Visa" - # ) - @patch("smtplib.SMTP") def test_notifications(self, mock_smtp): """