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

Dealing with payment notifications that don't match an existing transaction #19

Open
habbes opened this issue May 3, 2020 · 0 comments

Comments

@habbes
Copy link
Member

habbes commented May 3, 2020

How should we deal with payment notifications coming from the payment gateway that do not match any transaction in our database?

There are two possible cases to consider:

  • The transaction was initiated from our app, but the app failed/or db crashed before a transaction record was persisted in the database (we make the payment request to the gateway before storing the transaction record). In this case the payment gateway should have some metadata about the transaction, e.g. we store the ID of the user who initiated the transaction in metadata.fromUser field when make a request to Africa's Talking. We can use this information to create a transaction record with all the necessary details (basically doing an upsert when updating the transaction record)

  • The payment was made to our account without going initiating through the app. We should find out from the provider whether this is possible and decide how to deal with it, e.g. do we create a concept of "anonymous" transactions? Do we attempt to match the transaction's phone number with a user in our database? Do we create a new user account on the fly if the source phone number does not exist? etc.

@habbes habbes mentioned this issue May 3, 2020
5 tasks
@habbes habbes added this to the Minor release milestone May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant