BTCMarkets / API

API
120 stars 30 forks source link

Fund Transfer - ERROR #92

Closed adamsandri closed 6 years ago

adamsandri commented 6 years ago

Hi, I'm successfully creating orders and a bunch of other stuff, but can't figure out why the EFT is failing. Below is a JSON dump from my Python program when trying to transfer $1.05 for example:

{'accountNumber': '32548536', 'bsbNumber': '063651', 'accountName': 'Adam Sandri', 'currency': 'AUD', 'amount': 105000000, 'bankName': 'CBA'}

{u'errorCode': 1, u'errorMessage': u'Authentication failed.', u'success': False}

Note: The only two differences I can see from the example are, a) single quote vs double quote, but this works for all other methods and seems to be the way that Python prints the string, and b) the json.dumps method seems to change the order of the elements - shouldn't matter?

Any help would be greatly appreciated, as I've been stuck on this issue for a couple of weeks!

adamsandri commented 6 years ago

Doh, just got it working!

The order of elements was the issue. If you need a particular order; in Python you can use collections.OrderedDict:

eg.

from collections import OrderedDict json.dumps(OrderedDict([("a", 1), ("b", 2)]))

Sorry for the false alarm, but hopefully this is helpful for someone else..