diff options
author | Magnus Hagander | 2016-07-21 10:00:40 +0000 |
---|---|---|
committer | Magnus Hagander | 2016-07-21 10:00:40 +0000 |
commit | c3fdea3f24ffb321162644493523e46cdb68c01a (patch) | |
tree | 9e455dc3949f11e7f022c0775c67bd943815bc90 /postgresqleu/paypal/util.py | |
parent | 462e36719199a2a3983dd0f36934a42b9bc66a30 (diff) |
Fix for sillyness in paypal api and missing import
That's what I get for not properly testing, yes...
Diffstat (limited to 'postgresqleu/paypal/util.py')
-rw-r--r-- | postgresqleu/paypal/util.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/postgresqleu/paypal/util.py b/postgresqleu/paypal/util.py index 0842416e..dde9db90 100644 --- a/postgresqleu/paypal/util.py +++ b/postgresqleu/paypal/util.py @@ -58,10 +58,10 @@ class PaypalAPI(object): def get_primary_balance(self): r = self._api_call('GetBalance', {}) - if r['L_CURRENCYCODE0'] != settings.CURRENCY_ISO: - raise Exception("Paypal primary currency reportsed as {0} instead of {1}!".format( - r['L_CURRENCYCODE0'], settings.CURRENCY_ISO)) - return Decimal(r['L_AMT0']) + if r['L_CURRENCYCODE0'][0] != settings.CURRENCY_ISO: + raise Exception("Paypal primary currency reported as {0} instead of {1}!".format( + r['L_CURRENCYCODE0'][0], settings.CURRENCY_ISO)) + return Decimal(r['L_AMT0'][0]) def refund_transaction(self, paypaltransid, amount, isfull, refundnote): r = self._api_call('RefundTransaction', { |