def authenticate
      begin
        client = Plaid::Client.new(env: PlaidRails.env,
          client_id: PlaidRails.client_id,
          secret: PlaidRails.secret,
          public_key: PlaidRails.public_key)
        @exchange_token = client.item.public_token.exchange(link_params[:public_token])
        @params = link_params.merge!(token: link_params[:public_token])
        
      rescue => e
        Rails.logger.error "Error: #{e}"
        render text: e.message, status: 500
      end
    end
def authenticate
      begin
        client = Plaid::Client.new(env: PlaidRails.env,
          client_id: PlaidRails.client_id,
          secret: PlaidRails.secret,
          public_key: PlaidRails.public_key)
        @exchange_token = client.item.public_token.exchange(link_params[:public_token])
        @params = link_params.merge!(token: link_params[:public_token])
        
      rescue => e
        Rails.logger.error "Error: #{e}"
        render text: e.message, status: 500
      end
    end
/plaid/authenticate