Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
5abc4e7976 | |||
58f4855cb6 | |||
c34846c82f | |||
2656f1a9a9 | |||
e63d24eb13 | |||
f0e27bf7c8 |
4354
package-lock.json
generated
4354
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mojoio/bunq",
|
||||
"version": "1.0.19",
|
||||
"version": "1.0.22",
|
||||
"private": false,
|
||||
"description": "a bunq api abstraction package",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './bunq.plugins';
|
||||
import * as paths from './bunq.paths';
|
||||
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||
|
||||
export interface IBunqConstructorOptions {
|
||||
deviceName: string;
|
||||
@ -92,9 +92,9 @@ export class BunqAccount {
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
const accountsArray: MonetaryAccount[] = [];
|
||||
const accountsArray: BunqMonetaryAccount[] = [];
|
||||
for (const apiAccount of apiMonetaryAccounts) {
|
||||
accountsArray.push(MonetaryAccount.fromAPIObject(this, apiAccount));
|
||||
accountsArray.push(BunqMonetaryAccount.fromAPIObject(this, apiAccount));
|
||||
}
|
||||
return accountsArray;
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import * as plugins from './bunq.plugins';
|
||||
import { BunqAccount } from './bunq.classes.account';
|
||||
import { Transaction } from './bunq.classes.transaction';
|
||||
import { BunqTransaction } from './bunq.classes.transaction';
|
||||
|
||||
export type TAccountType = 'joint' | 'savings' | 'bank';
|
||||
|
||||
/**
|
||||
* a monetary account
|
||||
*/
|
||||
export class MonetaryAccount {
|
||||
export class BunqMonetaryAccount {
|
||||
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
|
||||
const newMonetaryAccount = new this(bunqAccountRef);
|
||||
|
||||
@ -105,9 +105,9 @@ export class MonetaryAccount {
|
||||
this.id,
|
||||
paginationOptions
|
||||
);
|
||||
const transactionsArray: Transaction[] = [];
|
||||
const transactionsArray: BunqTransaction[] = [];
|
||||
for (const apiTransaction of apiTransactions) {
|
||||
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
|
||||
transactionsArray.push(BunqTransaction.fromApiObject(this, apiTransaction));
|
||||
}
|
||||
return transactionsArray;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as plugins from './bunq.plugins';
|
||||
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||
|
||||
export class Transaction {
|
||||
public static fromApiObject(monetaryAccountRefArg: MonetaryAccount, apiObjectArg: any) {
|
||||
export class BunqTransaction {
|
||||
public static fromApiObject(monetaryAccountRefArg: BunqMonetaryAccount, apiObjectArg: any) {
|
||||
const newTransaction = new this(monetaryAccountRefArg);
|
||||
Object.assign(newTransaction, apiObjectArg.Payment);
|
||||
return newTransaction;
|
||||
@ -20,7 +20,31 @@ export class Transaction {
|
||||
public type: 'MASTERCARD' | 'BUNQ';
|
||||
public merchant_reference: null;
|
||||
public alias: [Object];
|
||||
public counterparty_alias: [Object];
|
||||
public counterparty_alias: {
|
||||
iban: string,
|
||||
is_light: any,
|
||||
display_name: string,
|
||||
avatar: {
|
||||
uuid: string,
|
||||
image: [
|
||||
{
|
||||
attachment_public_uuid: string,
|
||||
height: number,
|
||||
width: number,
|
||||
content_type: string,
|
||||
},
|
||||
],
|
||||
anchor_uuid: null,
|
||||
},
|
||||
label_user: {
|
||||
uuid: null,
|
||||
display_name: string,
|
||||
country: string,
|
||||
avatar: null,
|
||||
public_nick_name: string,
|
||||
},
|
||||
country: string,
|
||||
};
|
||||
public attachment: [];
|
||||
public geolocation: null;
|
||||
public batch_id: null;
|
||||
@ -35,9 +59,9 @@ export class Transaction {
|
||||
value: string;
|
||||
};
|
||||
|
||||
public monetaryAccountRef: MonetaryAccount;
|
||||
public monetaryAccountRef: BunqMonetaryAccount;
|
||||
|
||||
constructor(monetaryAccountRefArg: MonetaryAccount) {
|
||||
constructor(monetaryAccountRefArg: BunqMonetaryAccount) {
|
||||
this.monetaryAccountRef = monetaryAccountRefArg;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user