Skip to content
Open
Show file tree
Hide file tree
Changes from all 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,5 +1,9 @@
# Changelog

## Unreleased

* Fix issue where validation errors from creating a plan were not surfaced (#223)

## 4.5.0
* Add plan create/update/find API endpoint
* Add support for `TransactionReview` webhook notification
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