Skip to content

Commit

Permalink
Fixed bank_id issue, correct ID are used.
Browse files Browse the repository at this point in the history
xml2json sees the bank id's as oct numbers, used a quickfix in this
library.
  • Loading branch information
koenbollen committed Aug 8, 2013
1 parent 63edb86 commit a2968cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mollie.js
Expand Up @@ -203,12 +203,18 @@ mollie.ideal = {
if( res.bank.bank_id === undefined ) {
for( var b in res.bank ) {
bank = res.bank[b]
banks[ bank.bank_id ] = bank
// Mollie sends bank id's in four digits with zero padding
// and xml2json sees that as oct numbers. Here's a quick fix:
bank_id = parseInt(bank.bank_id.toString(8),10)
banks[ bank_id ] = bank
}
}
else
{
banks[ res.bank.bank_id ] = res.bank
// Mollie sends bank id's in four digits with zero padding
// and xml2json sees that as oct numbers. Here's a quick fix:
bank_id = parseInt(res.bank.bank_id.toString(8),10)
banks[ bank_id ] = res.bank
}
}
callback( banks )
Expand Down

0 comments on commit a2968cf

Please sign in to comment.