Closed Cubicle13 closed 1 year ago
Had some help, got fixed. Saw a lot of users wanted this as well; posting to help others. Feel free to comment.
#Gets all payments after the last retrieved id (last_id)
def get_all_payment(last_id:int = 0) -> list[Payment]:
paylist:list[Payment] = []
newer_id = last_id
while(True):
pagination = Pagination()
pagination.count = 3
pagination.newer_id = newer_id
pl:list[Payment] = Payment.list(params=pagination.url_params_next_page).value
if (len(pl) == 0):
break
pl.extend(paylist)
paylist = pl
newer_id = paylist[0].id_
time.sleep(1)
return paylist
a = get_all_payment()
a
Steps to reproduce:
What should happen:
This should make a list of all transactions (in this case 2 by two)
What happens:
It says "there is no previous page." or "there is no next page." when I try doing this with url_params_next page.
Traceback
Extra info:
Looked everywhere on the Bunq Developer forum, other bunq SDKs, other API's.