Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9fbaac20d3 | |||
270d1406c5 | |||
3cec57e3e7 | |||
cebb8a5555 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/bunq",
|
"name": "@mojoio/bunq",
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/bunq",
|
"name": "@mojoio/bunq",
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a bunq api abstraction package",
|
"description": "a bunq api abstraction package",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -9,7 +9,7 @@ let testBunqAccount: bunq.BunqAccount;
|
|||||||
const testBunqOptions: bunq.IBunqConstructorOptions = {
|
const testBunqOptions: bunq.IBunqConstructorOptions = {
|
||||||
apiKey: testQenv.getEnvVarOnDemand('BUNQ_APIKEY'),
|
apiKey: testQenv.getEnvVarOnDemand('BUNQ_APIKEY'),
|
||||||
deviceName: 'mojoiobunqpackage',
|
deviceName: 'mojoiobunqpackage',
|
||||||
environment: 'PRODUCTION'
|
environment: 'SANDBOX'
|
||||||
};
|
};
|
||||||
|
|
||||||
tap.test('should create a valid bunq account', async () => {
|
tap.test('should create a valid bunq account', async () => {
|
||||||
|
@ -91,8 +91,19 @@ export class MonetaryAccount {
|
|||||||
/**
|
/**
|
||||||
* gets all transactions no this account
|
* gets all transactions no this account
|
||||||
*/
|
*/
|
||||||
public async getTransactions() {
|
public async getTransactions(startingIdArg: number | false = false) {
|
||||||
const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id);
|
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[] = [];
|
const transactionsArray: Transaction[] = [];
|
||||||
for (const apiTransaction of apiTransactions) {
|
for (const apiTransaction of apiTransactions) {
|
||||||
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
|
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
|
||||||
|
Reference in New Issue
Block a user