Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Fix issue #223: Replace 'errors' with expected 'api_error_response'

# Changelog
Comment thread
Dani-Kirby marked this conversation as resolved.
Outdated

## 4.5.0
Expand Down
6 changes: 3 additions & 3 deletions lib/braintree/plan_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def _do_create(path, params) # :nodoc:
response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
if response[:plan]
SuccessfulResult.new(:plan => Plan._new(@gateway, response[:plan]))
elsif response[:errors]
ErrorResult.new(@gateway, response[:errors])
elsif response[:api_error_response]
ErrorResult.new(@gateway, response[:api_error_response])
else
raise UnexpectedError, "expected :plan or :errors"
raise UnexpectedError, "expected :plan or :api_error_response"
end
end
end
Expand Down