@pax2pay/model-banking 0.1.214 → 0.1.216
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Operation/Creatable.ts +32 -0
- package/Organization/Contact/index.ts +5 -4
- package/Rail/Card.ts +12 -0
- package/Rail/index.ts +3 -0
- package/Transaction/Incoming.ts +13 -0
- package/dist/Operation/Creatable.d.ts +3 -0
- package/dist/Operation/Creatable.js +31 -0
- package/dist/Operation/Creatable.js.map +1 -1
- package/dist/Organization/Contact/index.d.ts +3 -2
- package/dist/Organization/Contact/index.js +3 -2
- package/dist/Organization/Contact/index.js.map +1 -1
- package/dist/Rail/Card.d.ts +2 -0
- package/dist/Rail/Card.js +12 -0
- package/dist/Rail/Card.js.map +1 -1
- package/dist/Rail/index.d.ts +3 -0
- package/dist/Rail/index.js.map +1 -1
- package/dist/Settlement/Status.d.ts +2 -2
- package/dist/Transaction/Incoming.d.ts +2 -0
- package/dist/Transaction/Incoming.js +13 -0
- package/dist/Transaction/Incoming.js.map +1 -1
- package/package.json +1 -1
package/Operation/Creatable.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as cryptly from "cryptly"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
3
|
import { isly } from "isly"
|
|
4
|
+
import { Card } from "../Card"
|
|
5
|
+
import { Settlement } from "../Settlement"
|
|
4
6
|
import { Changes } from "./Changes"
|
|
5
7
|
|
|
6
8
|
export interface Creatable {
|
|
@@ -34,4 +36,34 @@ export namespace Creatable {
|
|
|
34
36
|
})
|
|
35
37
|
export const is = type.is
|
|
36
38
|
export const flaw = type.flaw
|
|
39
|
+
export function fromRefund(account: string, entry: Settlement.Entry.Refund.Creatable, stack: Card.Stack): Creatable {
|
|
40
|
+
const [currency, amount] = entry.amount
|
|
41
|
+
return {
|
|
42
|
+
account: account,
|
|
43
|
+
currency,
|
|
44
|
+
type: "refund",
|
|
45
|
+
changes: {
|
|
46
|
+
actual: {
|
|
47
|
+
type: "add",
|
|
48
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
49
|
+
status: "pending",
|
|
50
|
+
},
|
|
51
|
+
incomingReserved: {
|
|
52
|
+
type: "add",
|
|
53
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
54
|
+
status: "pending",
|
|
55
|
+
},
|
|
56
|
+
[`fee_${stack}_${entry.batch}`]: {
|
|
57
|
+
type: "subtract" as const,
|
|
58
|
+
amount: entry.fee.other[currency] ?? 0,
|
|
59
|
+
status: "pending" as const,
|
|
60
|
+
},
|
|
61
|
+
[`settle_${stack}_${entry.batch}`]: {
|
|
62
|
+
type: "subtract" as const,
|
|
63
|
+
amount: amount,
|
|
64
|
+
status: "pending" as const,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
}
|
|
37
69
|
}
|
|
@@ -5,13 +5,13 @@ import { Addresses as ContactAddresses } from "./Addresses"
|
|
|
5
5
|
|
|
6
6
|
export interface Contact {
|
|
7
7
|
address: Contact.Addresses
|
|
8
|
-
email:
|
|
8
|
+
email: string
|
|
9
9
|
name: {
|
|
10
10
|
first: string
|
|
11
11
|
last: string
|
|
12
12
|
}
|
|
13
13
|
phone: {
|
|
14
|
-
number:
|
|
14
|
+
number: string
|
|
15
15
|
code: isoly.CallingCode
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -23,14 +23,15 @@ export namespace Contact {
|
|
|
23
23
|
export type Address = ContactAddress
|
|
24
24
|
export const type = isly.object<Contact>({
|
|
25
25
|
address: Addresses.type,
|
|
26
|
-
email: isly.string(),
|
|
26
|
+
email: isly.string(/^\S+@\S+\.\S+$/),
|
|
27
27
|
name: isly.object<Contact["name"]>({
|
|
28
28
|
first: isly.string(),
|
|
29
29
|
last: isly.string(),
|
|
30
30
|
}),
|
|
31
31
|
phone: isly.object<Contact["phone"]>({
|
|
32
|
-
number: isly.string(),
|
|
32
|
+
number: isly.string(/^\d+$/),
|
|
33
33
|
code: isly.fromIs("CallingCode", isoly.CallingCode.is),
|
|
34
34
|
}),
|
|
35
35
|
})
|
|
36
|
+
export const is = type.is
|
|
36
37
|
}
|
package/Rail/Card.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { isly } from "isly"
|
|
|
2
2
|
import { Acquirer } from "../Acquirer"
|
|
3
3
|
import { Card as ModelCard } from "../Card"
|
|
4
4
|
import { Merchant } from "../Merchant"
|
|
5
|
+
import { Rule } from "../Rule"
|
|
5
6
|
|
|
6
7
|
export interface Card {
|
|
7
8
|
type: "card"
|
|
@@ -37,6 +38,17 @@ export namespace Card {
|
|
|
37
38
|
})
|
|
38
39
|
export const is = type.is
|
|
39
40
|
export const flaw = type.flaw
|
|
41
|
+
export function from(card: ModelCard | Rule.State.Card): Card {
|
|
42
|
+
return {
|
|
43
|
+
type: "card",
|
|
44
|
+
scheme: card.scheme,
|
|
45
|
+
id: card.id,
|
|
46
|
+
iin: card.details.iin,
|
|
47
|
+
last4: card.details.last4,
|
|
48
|
+
expiry: card.details.expiry,
|
|
49
|
+
holder: card.details.holder,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
40
52
|
export const Counterpart = CardCounterpart
|
|
41
53
|
export type Counterpart = CardCounterpart
|
|
42
54
|
}
|
package/Rail/index.ts
CHANGED
package/Transaction/Incoming.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
1
2
|
import { isly } from "isly"
|
|
2
3
|
import { Rail } from "../Rail"
|
|
4
|
+
import { Settlement } from "../Settlement"
|
|
3
5
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
4
6
|
import { Reference as TransactionReference } from "./Reference"
|
|
5
7
|
|
|
@@ -16,4 +18,15 @@ export namespace Incoming {
|
|
|
16
18
|
})
|
|
17
19
|
export const is = type.is
|
|
18
20
|
export const flaw = type.flaw
|
|
21
|
+
export function fromRefund(entry: Settlement.Entry.Refund.Creatable, card: Rail.Card): Incoming {
|
|
22
|
+
const [currency, amount] = entry.amount
|
|
23
|
+
return {
|
|
24
|
+
account: card,
|
|
25
|
+
currency,
|
|
26
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
27
|
+
posted: isoly.DateTime.now(),
|
|
28
|
+
counterpart: { type: "card", merchant: entry.merchant, acquirer: entry.acquirer },
|
|
29
|
+
description: "Refund transaction.",
|
|
30
|
+
}
|
|
31
|
+
}
|
|
19
32
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as cryptly from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
3
|
import { isly } from "isly";
|
|
4
|
+
import { Card } from "../Card";
|
|
5
|
+
import { Settlement } from "../Settlement";
|
|
4
6
|
import { Changes } from "./Changes";
|
|
5
7
|
export interface Creatable {
|
|
6
8
|
account: cryptly.Identifier;
|
|
@@ -14,4 +16,5 @@ export declare namespace Creatable {
|
|
|
14
16
|
const type: isly.object.ExtendableType<Creatable>;
|
|
15
17
|
const is: isly.Type.IsFunction<Creatable>;
|
|
16
18
|
const flaw: isly.Type.FlawFunction;
|
|
19
|
+
function fromRefund(account: string, entry: Settlement.Entry.Refund.Creatable, stack: Card.Stack): Creatable;
|
|
17
20
|
}
|
|
@@ -26,5 +26,36 @@ export var Creatable;
|
|
|
26
26
|
});
|
|
27
27
|
Creatable.is = Creatable.type.is;
|
|
28
28
|
Creatable.flaw = Creatable.type.flaw;
|
|
29
|
+
function fromRefund(account, entry, stack) {
|
|
30
|
+
const [currency, amount] = entry.amount;
|
|
31
|
+
return {
|
|
32
|
+
account: account,
|
|
33
|
+
currency,
|
|
34
|
+
type: "refund",
|
|
35
|
+
changes: {
|
|
36
|
+
actual: {
|
|
37
|
+
type: "add",
|
|
38
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
39
|
+
status: "pending",
|
|
40
|
+
},
|
|
41
|
+
incomingReserved: {
|
|
42
|
+
type: "add",
|
|
43
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
44
|
+
status: "pending",
|
|
45
|
+
},
|
|
46
|
+
[`fee_${stack}_${entry.batch}`]: {
|
|
47
|
+
type: "subtract",
|
|
48
|
+
amount: entry.fee.other[currency] ?? 0,
|
|
49
|
+
status: "pending",
|
|
50
|
+
},
|
|
51
|
+
[`settle_${stack}_${entry.batch}`]: {
|
|
52
|
+
type: "subtract",
|
|
53
|
+
amount: amount,
|
|
54
|
+
status: "pending",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
Creatable.fromRefund = fromRefund;
|
|
29
60
|
})(Creatable || (Creatable = {}));
|
|
30
61
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Operation/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Operation/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,CAsDzB;AAtDD,WAAiB,SAAS;IACZ,eAAK,GAAG;QACpB,UAAU;QACV,kBAAkB;QAClB,UAAU;QACV,kBAAkB;QAClB,eAAe;QACf,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,SAAS;KACA,CAAA;IAEG,cAAI,GAAG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,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACtC,MAAM,EAAE,SAAkB;iBAC1B;gBACD,CAAC,UAAU,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE;oBACnC,IAAI,EAAE,UAAmB;oBACzB,MAAM,EAAE,MAAM;oBACd,MAAM,EAAE,SAAkB;iBAC1B;aACD;SACD,CAAA;IACF,CAAC;IA7Be,oBAAU,aA6BzB,CAAA;AACF,CAAC,EAtDgB,SAAS,KAAT,SAAS,QAsDzB"}
|
|
@@ -4,13 +4,13 @@ import { Address as ContactAddress } from "./Address";
|
|
|
4
4
|
import { Addresses as ContactAddresses } from "./Addresses";
|
|
5
5
|
export interface Contact {
|
|
6
6
|
address: Contact.Addresses;
|
|
7
|
-
email:
|
|
7
|
+
email: string;
|
|
8
8
|
name: {
|
|
9
9
|
first: string;
|
|
10
10
|
last: string;
|
|
11
11
|
};
|
|
12
12
|
phone: {
|
|
13
|
-
number:
|
|
13
|
+
number: string;
|
|
14
14
|
code: isoly.CallingCode;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
@@ -20,4 +20,5 @@ export declare namespace Contact {
|
|
|
20
20
|
const Address: typeof ContactAddress;
|
|
21
21
|
type Address = ContactAddress;
|
|
22
22
|
const type: isly.object.ExtendableType<Contact>;
|
|
23
|
+
const is: isly.Type.IsFunction<Contact>;
|
|
23
24
|
}
|
|
@@ -8,15 +8,16 @@ export var Contact;
|
|
|
8
8
|
Contact.Address = ContactAddress;
|
|
9
9
|
Contact.type = isly.object({
|
|
10
10
|
address: Contact.Addresses.type,
|
|
11
|
-
email: isly.string(),
|
|
11
|
+
email: isly.string(/^\S+@\S+\.\S+$/),
|
|
12
12
|
name: isly.object({
|
|
13
13
|
first: isly.string(),
|
|
14
14
|
last: isly.string(),
|
|
15
15
|
}),
|
|
16
16
|
phone: isly.object({
|
|
17
|
-
number: isly.string(),
|
|
17
|
+
number: isly.string(/^\d+$/),
|
|
18
18
|
code: isly.fromIs("CallingCode", isoly.CallingCode.is),
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
21
|
+
Contact.is = Contact.type.is;
|
|
21
22
|
})(Contact || (Contact = {}));
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/Contact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAe3D,MAAM,KAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/Contact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAe3D,MAAM,KAAW,OAAO,CAkBvB;AAlBD,WAAiB,OAAO;IACV,iBAAS,GAAG,gBAAgB,CAAA;IAE5B,eAAO,GAAG,cAAc,CAAA;IAExB,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU;QACxC,OAAO,EAAE,QAAA,SAAS,CAAC,IAAI;QACvB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACpC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAkB;YAClC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;YACpB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;SACnB,CAAC;QACF,KAAK,EAAE,IAAI,CAAC,MAAM,CAAmB;YACpC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAC5B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;SACtD,CAAC;KACF,CAAC,CAAA;IACW,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAlBgB,OAAO,KAAP,OAAO,QAkBvB"}
|
package/dist/Rail/Card.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { isly } from "isly";
|
|
|
2
2
|
import { Acquirer } from "../Acquirer";
|
|
3
3
|
import { Card as ModelCard } from "../Card";
|
|
4
4
|
import { Merchant } from "../Merchant";
|
|
5
|
+
import { Rule } from "../Rule";
|
|
5
6
|
export interface Card {
|
|
6
7
|
type: "card";
|
|
7
8
|
scheme: ModelCard.Scheme;
|
|
@@ -24,6 +25,7 @@ export declare namespace Card {
|
|
|
24
25
|
const type: isly.object.ExtendableType<Card>;
|
|
25
26
|
const is: isly.Type.IsFunction<Card>;
|
|
26
27
|
const flaw: isly.Type.FlawFunction;
|
|
28
|
+
function from(card: ModelCard | Rule.State.Card): Card;
|
|
27
29
|
const Counterpart: typeof CardCounterpart;
|
|
28
30
|
type Counterpart = CardCounterpart;
|
|
29
31
|
}
|
package/dist/Rail/Card.js
CHANGED
|
@@ -24,6 +24,18 @@ export var Card;
|
|
|
24
24
|
});
|
|
25
25
|
Card.is = Card.type.is;
|
|
26
26
|
Card.flaw = Card.type.flaw;
|
|
27
|
+
function from(card) {
|
|
28
|
+
return {
|
|
29
|
+
type: "card",
|
|
30
|
+
scheme: card.scheme,
|
|
31
|
+
id: card.id,
|
|
32
|
+
iin: card.details.iin,
|
|
33
|
+
last4: card.details.last4,
|
|
34
|
+
expiry: card.details.expiry,
|
|
35
|
+
holder: card.details.holder,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
Card.from = from;
|
|
27
39
|
Card.Counterpart = CardCounterpart;
|
|
28
40
|
})(Card || (Card = {}));
|
|
29
41
|
//# sourceMappingURL=Card.js.map
|
package/dist/Rail/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rail/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rail/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAiBtC,IAAU,eAAe,CAMxB;AAND,WAAU,eAAe;IACX,oBAAI,GAAG,IAAI,CAAC,MAAM,CAAkB;QAChD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,QAAQ,EAAE,QAAQ,CAAC,IAAI;KACvB,CAAC,CAAA;AACH,CAAC,EANS,eAAe,KAAf,eAAe,QAMxB;AACD,MAAM,KAAW,IAAI,CA0BpB;AA1BD,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAClD,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI;QAC7B,EAAE,EA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
2
|
export type Status = "succeeded" | ["failed", string] | "ongoing";
|
|
3
3
|
export declare namespace Status {
|
|
4
|
-
const type: isly.Type<
|
|
5
|
-
const is: isly.Type.IsFunction<
|
|
4
|
+
const type: isly.Type<["failed", string] | "succeeded" | "ongoing">;
|
|
5
|
+
const is: isly.Type.IsFunction<["failed", string] | "succeeded" | "ongoing">;
|
|
6
6
|
const flaw: isly.Type.FlawFunction;
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Rail } from "../Rail";
|
|
3
|
+
import { Settlement } from "../Settlement";
|
|
3
4
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
4
5
|
import { Reference as TransactionReference } from "./Reference";
|
|
5
6
|
export interface Incoming extends TransactionCreatable {
|
|
@@ -11,4 +12,5 @@ export declare namespace Incoming {
|
|
|
11
12
|
const type: isly.object.ExtendableType<Incoming>;
|
|
12
13
|
const is: isly.Type.IsFunction<Incoming>;
|
|
13
14
|
const flaw: isly.Type.FlawFunction;
|
|
15
|
+
function fromRefund(entry: Settlement.Entry.Refund.Creatable, card: Rail.Card): Incoming;
|
|
14
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import { isly } from "isly";
|
|
2
3
|
import { Rail } from "../Rail";
|
|
3
4
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
@@ -11,5 +12,17 @@ export var Incoming;
|
|
|
11
12
|
});
|
|
12
13
|
Incoming.is = Incoming.type.is;
|
|
13
14
|
Incoming.flaw = Incoming.type.flaw;
|
|
15
|
+
function fromRefund(entry, card) {
|
|
16
|
+
const [currency, amount] = entry.amount;
|
|
17
|
+
return {
|
|
18
|
+
account: card,
|
|
19
|
+
currency,
|
|
20
|
+
amount: isoly.Currency.add(currency, amount, entry.fee.other[currency] ?? 0),
|
|
21
|
+
posted: isoly.DateTime.now(),
|
|
22
|
+
counterpart: { type: "card", merchant: entry.merchant, acquirer: entry.acquirer },
|
|
23
|
+
description: "Refund transaction.",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
Incoming.fromRefund = fromRefund;
|
|
14
27
|
})(Incoming || (Incoming = {}));
|
|
15
28
|
//# sourceMappingURL=Incoming.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Incoming.js","sourceRoot":"../","sources":["Transaction/Incoming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Incoming.js","sourceRoot":"../","sources":["Transaction/Incoming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAO/D,MAAM,KAAW,QAAQ,CAmBxB;AAnBD,WAAiB,QAAQ;IACX,aAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAW;QAC9D,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAA;IACW,WAAE,GAAG,SAAA,IAAI,CAAC,EAAE,CAAA;IACZ,aAAI,GAAG,SAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,UAAU,CAAC,KAAwC,EAAE,IAAe;QACnF,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAA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