I'm using plaid to attempt to get transactions from a linked account. In sandbox I was not getting any errors but once I moved into development I started seeing "ITEM_LOGIN_REQUIRED" while trying to get transactions. I'm using the plaid react component and plaid ruby gem. I suspect that there isn't an error in my code as much as the flow through Plaids api which like the following
User interacts with Link -> logs into account with creds -> account is linked and public_token is returned -> public_token exchanged for access_token which is stored in DB -> access_token used to lookup transactions -> Plaid returns error. -> take user through update mode -> lookup transactions -> error -> rinse and repeat.
Below is where I'm looking up transaction and where I get the error.
start_date = Date.new(date[0].to_i, date[1].to_i, 1).strftime('%Y-%m-%d')
end_date = Date.new(date[0].to_i, date[1].to_i, -1).strftime('%Y-%m-%d')
plaid_env = Rails.application.config.plaid_env
client_id = Rails.application.config.client_id
secret = Rails.application.config.secret
public_key = Rails.application.config.public_key
client = Plaid::Client.new(env: plaid_env,
client_id: client_id,
secret: secret,
public_key: public_key)
transaction_response = client.transactions.get(access_token, start_date, end_date)
transactions = transaction_response.transactions