jamesaoverton/clovertonemusic

Purchases exist in the purchases databases that do not have associated files on the server

Closed this issue · 3 comments

This can happen when you initiate a payment in Stripe by clicking on the "Buy now" button on our shopping cart page, but no notification is sent to the server to indicate that the payment has completed. This can happen either if the user cancels the payment, or if there is some glitch when Stripe tries to hit our callback URL for completing payments (in which case the user will see an error page). Either way, from the server's point of view, payment was never made, and therefore it does not get marked as paid and no purchase directory is created.

When records like this are encountered at server startup there should be a log message in the server, and the entries in the database should be removed.

This is exactly what we discussed and agreed to, but I've changed my mind about the last point: Now I would prefer that the incomplete purchases stay in the database/sheet, as long as they're marked clearly as incomplete. This may give us useful information about purchase behaviour.

Incomplete purchases should not show up in the list of purchases on the user's account page.

I don't think that it would ever happen than you have a purchase link for an incomplete purchase, so I don't think we need code to handle that case.

Ok that is essentially the original behaviour. I'll change it back. I'll keep the warning message at startup, though.

See this commit:: a321cb0