vlab-research / fly

The Fly Survey platform
Other
2 stars 3 forks source link

Reloadly credentials should be stored in the database #9

Closed nandanrao closed 2 years ago

nandanrao commented 3 years ago

These are currently passed as env vars, but we want each user to have their own credentials.

  1. Use pageid from the PaymentEvent to look up the user and get credentials from the credentials table (https://github.com/vlab-research/fly/blob/e3adaf3445c36f1b2c3fb9c1fede87ce67b54b7d/devops/sql/migrate-15.sql#L1)

DoD

NOTE: currently Dinersclub does not test the request made by the reloadly provider, it only tests how it handles responses. To complete this task we will need to test the request made, thus updating the test functions/framework to handle that requirement.

Additionally, the tests do not currently have any dependency on the database. This will need to be added, for this task. A pattern can be found here:

https://github.com/vlab-research/fly/blob/e3adaf3445c36f1b2c3fb9c1fede87ce67b54b7d/scribble/state_test.go

In this pattern, we have no way to ensure the table format in the test matches the table format in the current version of the database, that is kept in-sync manually :( - there is a separate issue for that.