bunq/ts/bunq.classes.transaction.ts

45 lines
1.2 KiB
TypeScript
Raw Normal View History

2019-10-02 21:34:05 +00:00
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);
2019-12-15 17:21:23 +00:00
Object.assign(newTransaction, apiObjectArg.Payment);
2019-10-02 21:34:05 +00:00
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;
}
}