Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add failed stripe transactions to database #9

Open
echarlie opened this issue Feb 26, 2021 · 4 comments
Open

Do not add failed stripe transactions to database #9

echarlie opened this issue Feb 26, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@echarlie
Copy link
Member

most of these are card testing that stripe blocks as fraud.

@mutantmonkey
Copy link
Member

mutantmonkey commented Feb 27, 2021

If the card is declined, we don't add the transaction to the database. My understanding is that Stripe can now let a transaction go through and then decline it as fraud later on. If that understanding is true, we're going to have to see how to add that integration.

@echarlie
Copy link
Member Author

echarlie commented Mar 1, 2021

Large numbers of small-value online donations end up with "Payment method: None". Clearly Stripe declined these out-of-hand.

The stripe integration should allow more sophisticated removal, but these are cards where stripe does return a failure: we still add them. (this is implicitly the same issue as #5)

@mutantmonkey
Copy link
Member

mutantmonkey commented Mar 2, 2021

Yeah, you're right. We add the transaction to the DB before we know whether or not the card was declined. We should probably delete such transactions in addition to displaying an error. Here's the relevant section of code: https://github.com/wuvt/donormotor/blob/main/donormotor/donate/views.py#L117

@mutantmonkey
Copy link
Member

mutantmonkey commented Mar 2, 2021

@echarlie suggested that I explain why we add the transaction to the DB before marking it as paid. The short answer is that the only reason is to be able to print out the ID if sending the receipt email fails. If whoever looks into this wants to refactor the payment process flow so that we don't do that, that would probably be a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants