bunq/ts/bunq.classes.transaction.ts

68 lines
1.7 KiB
TypeScript
Raw Normal View History

2019-10-02 21:34:05 +00:00
import * as plugins from './bunq.plugins';
2020-08-21 01:33:30 +00:00
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
2019-10-02 21:34:05 +00:00
2020-08-21 01:33:30 +00:00
export class BunqTransaction {
public static fromApiObject(monetaryAccountRefArg: BunqMonetaryAccount, apiObjectArg: any) {
2019-10-02 21:34:05 +00:00
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];
2020-08-25 12:57:14 +00:00
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,
};
2019-10-02 21:34:05 +00:00
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;
};
2020-08-21 01:33:30 +00:00
public monetaryAccountRef: BunqMonetaryAccount;
2019-10-02 21:34:05 +00:00
2020-08-21 01:33:30 +00:00
constructor(monetaryAccountRefArg: BunqMonetaryAccount) {
2019-10-02 21:34:05 +00:00
this.monetaryAccountRef = monetaryAccountRefArg;
}
2020-06-20 01:47:53 +00:00
}