mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-03-21 12:29:03 +01:00
improve error message in case of payzen error
This commit is contained in:
parent
6cd74ac33e
commit
136159a2b5
@ -27,7 +27,12 @@ class PayZen::Client
|
||||
}
|
||||
|
||||
res = Net::HTTP.post(uri, payload.to_json, headers)
|
||||
JSON.parse(res.body) if res.is_a?(Net::HTTPSuccess)
|
||||
raise PayzenError unless res.is_a?(Net::HTTPSuccess)
|
||||
|
||||
json = JSON.parse(res.body)
|
||||
raise PayzenError(json['answer']['errorMessage']) if json['status'] == 'ERROR'
|
||||
|
||||
json
|
||||
end
|
||||
|
||||
def base_url
|
||||
|
Loading…
x
Reference in New Issue
Block a user