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

POST /transactions/advanced_search 422 #40

Closed
itsmeduncan opened this issue May 14, 2013 · 4 comments
Closed

POST /transactions/advanced_search 422 #40

itsmeduncan opened this issue May 14, 2013 · 4 comments

Comments

@itsmeduncan
Copy link

A new error has started popping up when running code that has worked for the last few days:

[Braintree] [14/May/2013 16:48:39 UTC] POST /transactions/advanced_search_ids 200
[Braintree] [14/May/2013 16:49:11 UTC] POST /transactions/advanced_search 422
rake aborted!
Unprocessable entity due to an invalid request
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/util.rb:4:in `extract_attribute_as_array'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/transaction_gateway.rb:133:in `_fetch_transactions'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/transaction_gateway.rb:70:in `block in search'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/resource_collection.rb:14:in `call'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/resource_collection.rb:14:in `block in each'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/resource_collection.rb:13:in `each'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/resource_collection.rb:13:in `each_slice'
/srv/project/shared/bundle/ruby/2.0.0/gems/braintree-2.23.0/lib/braintree/resource_collection.rb:13:in `each'
transactions = Braintree::Transaction.search do |search|
  search.settled_at <= day.end_of_day
  search.settled_at >= day.beginning_of_day
end
transactions.maximum_size # <-- good! (it's 160)
transactions.first # <-- good!
transactions.first.id # <-- good!

transactions.each { |tran| p tran.id } # <-- bad!

ERROR MESSAGE:
[Braintree] [14/May/2013 16:33:25 UTC] POST /transactions/advanced_search 422
Braintree::UnexpectedError: Unprocessable entity due to an invalid request
from /Users/Alex/.rvm/gems/ruby-1.9.3-p392/gems/braintree-2.21.0/lib/braintree/util.rb:4:in `extract_attribute_as_array'

Including @xgess for notifications.

@AncaU
Copy link

AncaU commented May 15, 2013

Hi, I've got the same error yesterday (and it persists today) without changing anything to the code.

@dan-manges
Copy link
Contributor

Hi, I'm a developer at Braintree. I'm sorry about the exceptions that you're seeing. What's happening is that the initial request to retrieve the search results is returning successfully, but the subsequent HTTP request to fetch the transaction details is timing out. Unfortunately, the time out is representing itself oddly in the form of the 422 response, which the client library isn't expecting, so it's raising the Braintree::UnexpectedError exception. This may have been caused by a performance regression in a recent release, which we're currently looking into.

@dan-manges
Copy link
Contributor

We've released an update to production that resolves this issue. Please let us know here or at support@braintreepayments.com if you continue to have any problems.

@AncaU
Copy link

AncaU commented May 17, 2013

Thanks Dan! All is back on track!

crookedneighbor added a commit that referenced this issue Dec 26, 2017
…ate_to_dispute_webhooks

Supdev yl1h qpo2 add effective date to dispute webhooks
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

3 participants