4 Commits

Author SHA1 Message Date
9fbaac20d3 1.0.15 2019-12-15 23:07:47 +00:00
270d1406c5 fix(transactions): enter a starting transaction 2019-12-15 23:07:46 +00:00
3cec57e3e7 1.0.14 2019-12-15 17:21:55 +00:00
cebb8a5555 fix(core): update 2019-12-15 17:21:54 +00:00
4 changed files with 16 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/bunq",
"version": "1.0.13",
"version": "1.0.15",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/bunq",
"version": "1.0.13",
"version": "1.0.15",
"private": false,
"description": "a bunq api abstraction package",
"main": "dist/index.js",

View File

@ -9,7 +9,7 @@ let testBunqAccount: bunq.BunqAccount;
const testBunqOptions: bunq.IBunqConstructorOptions = {
apiKey: testQenv.getEnvVarOnDemand('BUNQ_APIKEY'),
deviceName: 'mojoiobunqpackage',
environment: 'PRODUCTION'
environment: 'SANDBOX'
};
tap.test('should create a valid bunq account', async () => {

View File

@ -91,8 +91,19 @@ export class MonetaryAccount {
/**
* gets all transactions no this account
*/
public async getTransactions() {
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id);
public async getTransactions(startingIdArg: number | false = false) {
const paginationOptions: {
count?: number;
newer_id?: number | false;
older_id?: number | false;
} = {
count: 200,
newer_id: startingIdArg
};
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id, paginationOptions);
const transactionsArray: Transaction[] = [];
for (const apiTransaction of apiTransactions) {
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));