bunq/ts/bunq.classes.transaction.ts
2019-10-02 23:34:05 +02:00

45 lines
1.2 KiB
TypeScript

import * as plugins from './bunq.plugins';
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
export class Transaction {
public static fromApiObject(monetaryAccountRefArg: MonetaryAccount, apiObjectArg: any) {
const newTransaction = new this(monetaryAccountRefArg);
Object.assign(newTransaction, apiObjectArg);
return newTransaction;
}
public id: number;
public created: string;
public updated: string;
public monetary_account_id: number;
public amount: {
currency: string;
value: string;
};
public description: string;
public type: 'MASTERCARD' | 'BUNQ';
public merchant_reference: null;
public alias: [Object];
public counterparty_alias: [Object];
public attachment: [];
public geolocation: null;
public batch_id: null;
public allow_chat: boolean;
public scheduled_id: null;
public address_billing: null;
public address_shipping: null;
public sub_type: 'PAYMENT';
public request_reference_split_the_bill: [];
public balance_after_mutation: {
currency: string;
value: string;
};
public monetaryAccountRef: MonetaryAccount;
constructor(monetaryAccountRefArg: MonetaryAccount) {
this.monetaryAccountRef = monetaryAccountRefArg;
}
}