Merchant Name is Undefined
binhly opened this issue · comments
In the sandbox environment, when pulling transactions from the initial update, the transaction object throws a NoMethodError error.
But inspecting the object shows that the merchant name is there:
transactions_response = client.transactions.get(account.access_token, 30.days.ago, Date.today, count: transactions_count)
transactions_response.transactions.each do |transaction|
p transaction.inspect
"#<Plaid::Models::Transaction account_id=\"dBPQlJmQxACEn3xqjk3gFGXPqdpEmxuZnaAyl\" amount=500 category=[\"Food and Drink\", \"Restaurants\", \"Fast Food\"] category_id=\"13005032\" date=\"2020-06-23\" iso_currency_code=\"USD\" location=#<Plaid::Models::TransactionLocation> merchant_name=\"KFC\" name=\"KFC\" payment_channel=\"in store\" payment_meta=#<Plaid::Models::TransactionPaymentMeta> pending=false transaction_id=\"3oemWv9myDHGXv4WBNv7fJ7NegV155cqRyDJk\" transaction_type=\"place\">"
causes this:
undefined method
merchant_name' for #Plaid::Models::Transaction:0x00007fe1fd51e910`
This is using the latest version of the Plaid Gem.
Please disregard. Removing the Plaid gem and then adding it back solved the problem.