phillc73 / abettor

An R package for connecting to the online betting exchange Betfair, via their API-NG product, using JSON-RPC.
Other
51 stars 36 forks source link

Modify getAccountStatement so that it can retrieve more than 100 records #30

Closed Soccerama closed 3 years ago

Soccerama commented 3 years ago

I've updated this so that it can retrieve all available records - which is the default. The code is not pretty. The data returned from the API is messy as one of the columns is a data.frame (legacyData) and it is not possible to rbind the retrieved data.frames together. For some reason it is possible to cbind them once they've been transposed. In addition, the legacyData columns are not in a consistent order and it is necessary to reorder them before combining them. The default behaviour works as expected, also using fromRecordValue and recordCountValue works. The fromDate and toDate fields are only used in a few specific cases and I've not tested them specifically. It would be helpful if someone else could test this thoroughly as I've been working around in circles all day on trying to make this work.

phillc73 commented 3 years ago

Thanks. I'm going to merge this and see how it works out! You've probably tested it as much as many of the other functions. Nonetheless, I'll have a look at the function overall and see if I can find anything.

One thing to note: for historic reasons I used camel case for everything in this package. In the future I'd probably use snake case, but I'm not going to change everything now. Therefore, in a subsequent commit I will change PAGE_SIZE to pageSize.