Skip to content

Commit

Permalink
API errors for iDeal return different var names
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Oct 28, 2013
1 parent 63cc991 commit 4a92d0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mollie.js
Expand Up @@ -307,10 +307,10 @@ mollie.talk = function( path, fields, callback ) {
}

// catch API errors
if( data.resultcode > 10 ) {
if( data.resultcode > 10 || data.type === 'error' ) {
error = new Error('API error')
error.code = data.resultcode
error.error = data.resultmessage
error.code = data.resultcode || data.errorcode
error.error = data.resultmessage || data.message
}
}

Expand Down

0 comments on commit 4a92d0b

Please sign in to comment.