@pax2pay/model-banking 0.1.118 → 0.1.119
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/Amount.ts +10 -0
- package/Amounts.ts +10 -0
- package/Authorization/Creatable.ts +2 -1
- package/Authorization/Status.ts +47 -0
- package/Authorization/index.ts +83 -18
- package/Card/Changeable.ts +2 -1
- package/Card/Creatable.ts +2 -1
- package/Card/Operation/Settlement.ts +2 -2
- package/Card/Preset.ts +1 -0
- package/Card/index.ts +3 -2
- package/Client/Settlements.ts +2 -2
- package/Identifier.ts +12 -0
- package/{Realm/index.ts → Realm.ts} +2 -1
- package/Rule/State/index.ts +1 -1
- package/Settlement/Creatable.ts +18 -0
- package/Settlement/Entry/Cancel.ts +34 -0
- package/Settlement/Entry/Capture.ts +34 -0
- package/Settlement/Entry/Creatable.ts +18 -0
- package/Settlement/Entry/Refund.ts +34 -0
- package/Settlement/Entry/Summary.ts +21 -0
- package/Settlement/Entry/Unknown.ts +29 -0
- package/Settlement/Entry/index.ts +49 -0
- package/Settlement/Fee.ts +12 -0
- package/Settlement/Settled.ts +19 -0
- package/Settlement/Status.ts +13 -0
- package/Settlement/Total.ts +17 -0
- package/Settlement/index.ts +67 -75
- package/Treasury/Balance/index.ts +5 -9
- package/dist/Amount.d.ts +8 -0
- package/dist/Amount.js +9 -0
- package/dist/Amount.js.map +1 -0
- package/dist/Amounts.d.ts +8 -0
- package/dist/Amounts.js +9 -0
- package/dist/Amounts.js.map +1 -0
- package/dist/Authorization/Creatable.d.ts +2 -2
- package/dist/Authorization/Creatable.js.map +1 -1
- package/dist/Authorization/Status.d.ts +16 -0
- package/dist/Authorization/Status.js +38 -0
- package/dist/Authorization/Status.js.map +1 -0
- package/dist/Authorization/index.d.ts +30 -9
- package/dist/Authorization/index.js +57 -11
- package/dist/Authorization/index.js.map +1 -1
- package/dist/Card/Changeable.d.ts +2 -2
- package/dist/Card/Changeable.js.map +1 -1
- package/dist/Card/Creatable.d.ts +2 -2
- package/dist/Card/Creatable.js.map +1 -1
- package/dist/Card/Operation/Settlement.d.ts +1 -1
- package/dist/Card/Operation/Settlement.js +1 -1
- package/dist/Card/Operation/Settlement.js.map +1 -1
- package/dist/Card/Preset.js.map +1 -1
- package/dist/Card/index.d.ts +3 -2
- package/dist/Card/index.js.map +1 -1
- package/dist/Client/Settlements.d.ts +1 -1
- package/dist/Client/Settlements.js.map +1 -1
- package/dist/Identifier.d.ts +5 -0
- package/dist/Identifier.js +10 -0
- package/dist/Identifier.js.map +1 -0
- package/dist/{Realm/index.d.ts → Realm.d.ts} +2 -1
- package/dist/{Realm/index.js → Realm.js} +2 -1
- package/dist/Realm.js.map +1 -0
- package/dist/Rule/State/index.d.ts +1 -1
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Settlement/Creatable.d.ts +12 -0
- package/dist/Settlement/Creatable.js +13 -0
- package/dist/Settlement/Creatable.js.map +1 -0
- package/dist/Settlement/Entry/Cancel.d.ts +24 -0
- package/dist/Settlement/Entry/Cancel.js +25 -0
- package/dist/Settlement/Entry/Cancel.js.map +1 -0
- package/dist/Settlement/Entry/Capture.d.ts +24 -0
- package/dist/Settlement/Entry/Capture.js +25 -0
- package/dist/Settlement/Entry/Capture.js.map +1 -0
- package/dist/Settlement/Entry/Creatable.d.ts +11 -0
- package/dist/Settlement/Entry/Creatable.js +12 -0
- package/dist/Settlement/Entry/Creatable.js.map +1 -0
- package/dist/Settlement/Entry/Refund.d.ts +24 -0
- package/dist/Settlement/Entry/Refund.js +25 -0
- package/dist/Settlement/Entry/Refund.js.map +1 -0
- package/dist/Settlement/Entry/Summary.d.ts +12 -0
- package/dist/Settlement/Entry/Summary.js +15 -0
- package/dist/Settlement/Entry/Summary.js.map +1 -0
- package/dist/Settlement/Entry/Unknown.d.ts +21 -0
- package/dist/Settlement/Entry/Unknown.js +23 -0
- package/dist/Settlement/Entry/Unknown.js.map +1 -0
- package/dist/Settlement/Entry/index.d.ts +31 -0
- package/dist/Settlement/Entry/index.js +33 -0
- package/dist/Settlement/Entry/index.js.map +1 -0
- package/dist/Settlement/Fee.d.ts +10 -0
- package/dist/Settlement/Fee.js +9 -0
- package/dist/Settlement/Fee.js.map +1 -0
- package/dist/Settlement/Settled.d.ts +13 -0
- package/dist/Settlement/Settled.js +14 -0
- package/dist/Settlement/Settled.js.map +1 -0
- package/dist/Settlement/Status.d.ts +7 -0
- package/dist/Settlement/Status.js +8 -0
- package/dist/Settlement/Status.js.map +1 -0
- package/dist/Settlement/Total.d.ts +13 -0
- package/dist/Settlement/Total.js +14 -0
- package/dist/Settlement/Total.js.map +1 -0
- package/dist/Settlement/index.d.ts +46 -45
- package/dist/Settlement/index.js +49 -47
- package/dist/Settlement/index.js.map +1 -1
- package/dist/Treasury/Balance/index.d.ts +5 -3
- package/dist/Treasury/Balance/index.js +4 -7
- package/dist/Treasury/Balance/index.js.map +1 -1
- package/dist/pax2pay.d.ts +3 -0
- package/dist/pax2pay.js +3 -0
- package/dist/pax2pay.js.map +1 -1
- package/global.d.ts +2 -0
- package/package.json +8 -8
- package/pax2pay.ts +3 -0
- package/tsconfig.json +3 -1
- package/Authorization/Approved.ts +0 -21
- package/Authorization/Base.ts +0 -43
- package/Authorization/Failed.ts +0 -46
- package/Settlement/Entry.ts +0 -87
- package/dist/Authorization/Approved.d.ts +0 -14
- package/dist/Authorization/Approved.js +0 -16
- package/dist/Authorization/Approved.js.map +0 -1
- package/dist/Authorization/Base.d.ts +0 -22
- package/dist/Authorization/Base.js +0 -34
- package/dist/Authorization/Base.js.map +0 -1
- package/dist/Authorization/Failed.d.ts +0 -18
- package/dist/Authorization/Failed.js +0 -41
- package/dist/Authorization/Failed.js.map +0 -1
- package/dist/Realm/index.js.map +0 -1
- package/dist/Settlement/Entry.d.ts +0 -59
- package/dist/Settlement/Entry.js +0 -64
- package/dist/Settlement/Entry.js.map +0 -1
|
@@ -1,52 +1,53 @@
|
|
|
1
|
+
import { cryptly } from "cryptly";
|
|
1
2
|
import { isoly } from "isoly";
|
|
2
3
|
import { isly } from "isly";
|
|
4
|
+
import { Creatable as SettlementCreatable } from "./Creatable";
|
|
3
5
|
import { Entry as SettlementEntry } from "./Entry";
|
|
4
|
-
|
|
6
|
+
import { Fee as SettlementFee } from "./Fee";
|
|
7
|
+
import { Settled } from "./Settled";
|
|
8
|
+
import { Status } from "./Status";
|
|
9
|
+
import { Total as SettlementTotal } from "./Total";
|
|
10
|
+
export interface Settlement {
|
|
11
|
+
id: string;
|
|
12
|
+
by?: string;
|
|
13
|
+
created: isoly.DateTime;
|
|
14
|
+
reference: string;
|
|
15
|
+
processor: string;
|
|
16
|
+
status: Status;
|
|
17
|
+
expected: Settlement.Total;
|
|
18
|
+
outcome?: Settlement.Total;
|
|
19
|
+
settled?: Settled;
|
|
20
|
+
entries?: Settlement.Entry.Summary;
|
|
21
|
+
}
|
|
5
22
|
export declare namespace Settlement {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
status: "ongoing";
|
|
31
|
-
amount: Partial<Record<isoly.Currency, number>>;
|
|
32
|
-
fee: Partial<Record<isoly.Currency, number>>;
|
|
33
|
-
entries: SettlementEntry[];
|
|
34
|
-
}
|
|
35
|
-
namespace Succeeded {
|
|
36
|
-
const type: isly.object.ExtendableType<Succeeded>;
|
|
37
|
-
const is: isly.Type.IsFunction<Succeeded>;
|
|
38
|
-
}
|
|
39
|
-
namespace Failed {
|
|
40
|
-
const type: isly.object.ExtendableType<Failed>;
|
|
41
|
-
const is: isly.Type.IsFunction<Failed>;
|
|
42
|
-
}
|
|
43
|
-
namespace Ongoing {
|
|
44
|
-
const type: isly.object.ExtendableType<Ongoing>;
|
|
45
|
-
const is: isly.Type.IsFunction<Ongoing>;
|
|
23
|
+
const Total: typeof SettlementTotal;
|
|
24
|
+
type Total = SettlementTotal;
|
|
25
|
+
const Fee: typeof SettlementFee;
|
|
26
|
+
type Fee = SettlementFee;
|
|
27
|
+
type Creatable = SettlementCreatable;
|
|
28
|
+
const Creatable: typeof SettlementCreatable;
|
|
29
|
+
type Entry = SettlementEntry;
|
|
30
|
+
namespace Entry {
|
|
31
|
+
type Summary = SettlementEntry.Summary;
|
|
32
|
+
const Summary: typeof import("./Entry/Summary").Summary;
|
|
33
|
+
type Creatable = SettlementEntry.Creatable;
|
|
34
|
+
const Creatable: typeof import("./Entry/Creatable").Creatable;
|
|
35
|
+
type Refund = SettlementEntry.Refund;
|
|
36
|
+
const Refund: typeof import("./Entry/Refund").Refund;
|
|
37
|
+
type Cancel = SettlementEntry.Cancel;
|
|
38
|
+
const Cancel: typeof import("./Entry/Cancel").Cancel;
|
|
39
|
+
type Capture = SettlementEntry.Capture;
|
|
40
|
+
const Capture: typeof import("./Entry/Capture").Capture;
|
|
41
|
+
type Unknown = SettlementEntry.Unknown;
|
|
42
|
+
const Unknown: typeof import("./Entry/Unknown").Unknown;
|
|
43
|
+
const from: typeof SettlementEntry.from;
|
|
44
|
+
const type: isly.Type<SettlementEntry>;
|
|
45
|
+
const is: isly.Type.IsFunction<SettlementEntry>;
|
|
46
|
+
const flaw: isly.Type.FlawFunction;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
function from(id: cryptly.Identifier, creatable: Settlement.Creatable, by: string): Settlement;
|
|
49
|
+
function toFailed(id: string, creatable: Settlement.Creatable, by: string, reason: string): Settlement;
|
|
50
|
+
const type: isly.object.ExtendableType<object>;
|
|
51
|
+
const is: isly.Type.IsFunction<object>;
|
|
49
52
|
const flaw: isly.Type.FlawFunction;
|
|
50
|
-
const Entry: typeof SettlementEntry;
|
|
51
|
-
type Entry = SettlementEntry;
|
|
52
53
|
}
|
package/dist/Settlement/index.js
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
+
import { Creatable as SettlementCreatable } from "./Creatable";
|
|
3
4
|
import { Entry as SettlementEntry } from "./Entry";
|
|
5
|
+
import { Fee as SettlementFee } from "./Fee";
|
|
6
|
+
import { Settled } from "./Settled";
|
|
7
|
+
import { Status } from "./Status";
|
|
8
|
+
import { Total as SettlementTotal } from "./Total";
|
|
4
9
|
export var Settlement;
|
|
5
10
|
(function (Settlement) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
id
|
|
29
|
-
created:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})(Ongoing = Settlement.Ongoing || (Settlement.Ongoing = {}));
|
|
51
|
-
Settlement.type = isly.union(Succeeded.type, Failed.type, Ongoing.type);
|
|
11
|
+
Settlement.Total = SettlementTotal;
|
|
12
|
+
Settlement.Fee = SettlementFee;
|
|
13
|
+
Settlement.Creatable = SettlementCreatable;
|
|
14
|
+
let Entry;
|
|
15
|
+
(function (Entry) {
|
|
16
|
+
Entry.Summary = SettlementEntry.Summary;
|
|
17
|
+
Entry.Creatable = SettlementEntry.Creatable;
|
|
18
|
+
Entry.Refund = SettlementEntry.Refund;
|
|
19
|
+
Entry.Cancel = SettlementEntry.Cancel;
|
|
20
|
+
Entry.Capture = SettlementEntry.Capture;
|
|
21
|
+
Entry.Unknown = SettlementEntry.Unknown;
|
|
22
|
+
Entry.from = SettlementEntry.from;
|
|
23
|
+
Entry.type = SettlementEntry.type;
|
|
24
|
+
Entry.is = SettlementEntry.is;
|
|
25
|
+
Entry.flaw = SettlementEntry.flaw;
|
|
26
|
+
})(Entry = Settlement.Entry || (Settlement.Entry = {}));
|
|
27
|
+
function from(id, creatable, by) {
|
|
28
|
+
return { id, status: "ongoing", by, expected: Settlement.Total.initiate(), ...creatable, created: isoly.DateTime.now() };
|
|
29
|
+
}
|
|
30
|
+
Settlement.from = from;
|
|
31
|
+
function toFailed(id, creatable, by, reason) {
|
|
32
|
+
return {
|
|
33
|
+
id,
|
|
34
|
+
created: isoly.DateTime.now(),
|
|
35
|
+
status: ["failed", reason],
|
|
36
|
+
by,
|
|
37
|
+
processor: creatable.processor,
|
|
38
|
+
reference: creatable.reference,
|
|
39
|
+
expected: Settlement.Total.initiate(),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
Settlement.toFailed = toFailed;
|
|
43
|
+
Settlement.type = isly.object({
|
|
44
|
+
id: isly.string(),
|
|
45
|
+
by: isly.string().optional(),
|
|
46
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
47
|
+
reference: isly.string(),
|
|
48
|
+
processor: isly.string(),
|
|
49
|
+
status: Status.type,
|
|
50
|
+
expected: Settlement.Total.type,
|
|
51
|
+
outcome: Settlement.Total.type.optional(),
|
|
52
|
+
settled: Settled.type.optional(),
|
|
53
|
+
entries: Settlement.Entry.Summary.type.optional(),
|
|
54
|
+
});
|
|
52
55
|
Settlement.is = Settlement.type.is;
|
|
53
56
|
Settlement.flaw = Settlement.type.flaw;
|
|
54
|
-
Settlement.Entry = SettlementEntry;
|
|
55
57
|
})(Settlement || (Settlement = {}));
|
|
56
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Settlement/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Settlement/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAelD,MAAM,KAAW,UAAU,CAuD1B;AAvDD,WAAiB,UAAU;IACb,gBAAK,GAAG,eAAe,CAAA;IAEvB,cAAG,GAAG,aAAa,CAAA;IAGnB,oBAAS,GAAG,mBAAmB,CAAA;IAE5C,IAAiB,KAAK,CAiBrB;IAjBD,WAAiB,KAAK;QAER,aAAO,GAAG,eAAe,CAAC,OAAO,CAAA;QAEjC,eAAS,GAAG,eAAe,CAAC,SAAS,CAAA;QAErC,YAAM,GAAG,eAAe,CAAC,MAAM,CAAA;QAE/B,YAAM,GAAG,eAAe,CAAC,MAAM,CAAA;QAE/B,aAAO,GAAG,eAAe,CAAC,OAAO,CAAA;QAEjC,aAAO,GAAG,eAAe,CAAC,OAAO,CAAA;QACjC,UAAI,GAAG,eAAe,CAAC,IAAI,CAAA;QAC3B,UAAI,GAAG,eAAe,CAAC,IAAI,CAAA;QAC3B,QAAE,GAAG,eAAe,CAAC,EAAE,CAAA;QACvB,UAAI,GAAG,eAAe,CAAC,IAAI,CAAA;IACzC,CAAC,EAjBgB,KAAK,GAAL,gBAAK,KAAL,gBAAK,QAiBrB;IACD,SAAgB,IAAI,CAAC,EAAsB,EAAE,SAA+B,EAAE,EAAU;QACvF,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAA,KAAK,CAAC,QAAQ,EAAE,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAA;IAC9G,CAAC;IAFe,eAAI,OAEnB,CAAA;IACD,SAAgB,QAAQ,CAAC,EAAU,EAAE,SAA+B,EAAE,EAAU,EAAE,MAAc;QAC/F,OAAO;YACN,EAAE;YACF,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;YAC1B,EAAE;YACF,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,QAAQ,EAAE,WAAA,KAAK,CAAC,QAAQ,EAAE;SAC1B,CAAA;IACF,CAAC;IAVe,mBAAQ,WAUvB,CAAA;IAEY,eAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI;QAC/B,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;QACzC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KACjD,CAAC,CAAA;IACW,aAAE,GAAG,WAAA,IAAI,CAAC,EAAE,CAAA;IACZ,eAAI,GAAG,WAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAvDgB,UAAU,KAAV,UAAU,QAuD1B"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type Balance =
|
|
1
|
+
import { Amounts } from "../../Amounts";
|
|
2
|
+
export type Balance = Amounts;
|
|
3
3
|
export type Result = {
|
|
4
4
|
account: string;
|
|
5
5
|
balance: number;
|
|
6
6
|
};
|
|
7
7
|
export declare namespace Balance {
|
|
8
|
-
|
|
8
|
+
const type: import("isly/dist/Type").Type<Partial<Record<"BTN" | "CHE" | "MKD" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>>;
|
|
9
|
+
const is: import("isly/dist/Type").Type.IsFunction<Partial<Record<"BTN" | "CHE" | "MKD" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XSU" | "XTS" | "XUA" | "XXX" | "YER" | "ZAR" | "ZMW" | "ZWL", number>>>;
|
|
10
|
+
const flaw: import("isly/dist/Type").Type.FlawFunction;
|
|
9
11
|
}
|
|
10
12
|
export declare namespace Result {
|
|
11
13
|
function is(value: Result | any): value is Result;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Amounts } from "../../Amounts";
|
|
2
2
|
export var Balance;
|
|
3
3
|
(function (Balance) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.entries(value).every(([k, v]) => isoly.Currency.is(k) && typeof v == "number"));
|
|
8
|
-
}
|
|
9
|
-
Balance.is = is;
|
|
4
|
+
Balance.type = Amounts.type;
|
|
5
|
+
Balance.is = Amounts.is;
|
|
6
|
+
Balance.flaw = Amounts.flaw;
|
|
10
7
|
})(Balance || (Balance = {}));
|
|
11
8
|
export var Result;
|
|
12
9
|
(function (Result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Balance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Balance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvC,MAAM,KAAW,OAAO,CAIvB;AAJD,WAAiB,OAAO;IACV,YAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IACnB,UAAE,GAAG,OAAO,CAAC,EAAE,CAAA;IACf,YAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACjC,CAAC,EAJgB,OAAO,KAAP,OAAO,QAIvB;AACD,MAAM,KAAW,MAAM,CAItB;AAJD,WAAiB,MAAM;IACtB,SAAgB,EAAE,CAAC,KAAmB;QACrC,OAAO,KAAK,IAAI,OAAO,KAAK,IAAI,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,IAAI,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAA;IACjH,CAAC;IAFe,SAAE,KAEjB,CAAA;AACF,CAAC,EAJgB,MAAM,KAAN,MAAM,QAItB"}
|
package/dist/pax2pay.d.ts
CHANGED
|
@@ -15,3 +15,6 @@ export { Settlement } from "./Settlement";
|
|
|
15
15
|
export { Merchant } from "./Merchant";
|
|
16
16
|
export { Rule } from "./Rule";
|
|
17
17
|
export { Authorization } from "./Authorization";
|
|
18
|
+
export { Identifier } from "./Identifier";
|
|
19
|
+
export { Amount } from "./Amount";
|
|
20
|
+
export { Amounts } from "./Amounts";
|
package/dist/pax2pay.js
CHANGED
|
@@ -15,4 +15,7 @@ export { Settlement } from "./Settlement";
|
|
|
15
15
|
export { Merchant } from "./Merchant";
|
|
16
16
|
export { Rule } from "./Rule";
|
|
17
17
|
export { Authorization } from "./Authorization";
|
|
18
|
+
export { Identifier } from "./Identifier";
|
|
19
|
+
export { Amount } from "./Amount";
|
|
20
|
+
export { Amounts } from "./Amounts";
|
|
18
21
|
//# sourceMappingURL=pax2pay.js.map
|
package/dist/pax2pay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
package/global.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pax2pay/model-banking",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.119",
|
|
4
4
|
"description": "Library containing data model types and functions for the Pax2Pay Banking API.",
|
|
5
5
|
"author": "Pax2Pay Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"release": true
|
|
21
21
|
},
|
|
22
22
|
"jest": {
|
|
23
|
-
"globals": {
|
|
24
|
-
"ts-jest": {
|
|
25
|
-
"tsconfig": "tsconfig.test.json"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
23
|
"transform": {
|
|
29
|
-
"^.+\\.(j|t)sx?$":
|
|
24
|
+
"^.+\\.(j|t)sx?$": [
|
|
25
|
+
"ts-jest",
|
|
26
|
+
{
|
|
27
|
+
"tsconfig": "tsconfig.test.json"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
30
|
},
|
|
31
31
|
"transformIgnorePatterns": [
|
|
32
32
|
"<rootDir>/node_modules/(?!(cryptly|authly|isly|isoly|gracely|cloudly-http|cloudly-rest|cloudly-router|cloudly-formdata|@userwidgets|selectively)/.*)"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"authly": "^3.0.6",
|
|
75
75
|
"cloudly-http": "^0.1.6",
|
|
76
76
|
"cloudly-rest": "^0.1.3",
|
|
77
|
-
"cryptly": "
|
|
77
|
+
"cryptly": "3.0.7",
|
|
78
78
|
"gracely": "^2.0.4",
|
|
79
79
|
"isoly": "^2.0.20",
|
|
80
80
|
"isly": "0.1.7",
|
package/pax2pay.ts
CHANGED
|
@@ -15,3 +15,6 @@ export { Settlement } from "./Settlement"
|
|
|
15
15
|
export { Merchant } from "./Merchant"
|
|
16
16
|
export { Rule } from "./Rule"
|
|
17
17
|
export { Authorization } from "./Authorization"
|
|
18
|
+
export { Identifier } from "./Identifier"
|
|
19
|
+
export { Amount } from "./Amount"
|
|
20
|
+
export { Amounts } from "./Amounts"
|
package/tsconfig.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { isly } from "isly"
|
|
2
|
-
import { Transaction } from "../Transaction"
|
|
3
|
-
import { Base } from "./Base"
|
|
4
|
-
import { Creatable } from "./Creatable"
|
|
5
|
-
|
|
6
|
-
export interface Approved extends Base {
|
|
7
|
-
transaction: string
|
|
8
|
-
status: "approved"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export namespace Approved {
|
|
12
|
-
export const type = Base.type.extend<Approved>({
|
|
13
|
-
transaction: isly.string(),
|
|
14
|
-
status: isly.string("approved"),
|
|
15
|
-
})
|
|
16
|
-
export const is = type.is
|
|
17
|
-
export const flaw = type.flaw
|
|
18
|
-
export function fromCreatable(authorization: Creatable, transaction: Transaction): Approved {
|
|
19
|
-
return { ...Base.fromCreatable(authorization), transaction: transaction.id, status: "approved" }
|
|
20
|
-
}
|
|
21
|
-
}
|
package/Authorization/Base.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { cryptly } from "cryptly"
|
|
2
|
-
import { isoly } from "isoly"
|
|
3
|
-
import { isly } from "isly"
|
|
4
|
-
import { Acquirer } from "../Acquirer"
|
|
5
|
-
import { Merchant } from "../Merchant"
|
|
6
|
-
import { Creatable } from "./Creatable"
|
|
7
|
-
|
|
8
|
-
export type Base = {
|
|
9
|
-
id: cryptly.Identifier
|
|
10
|
-
card: string
|
|
11
|
-
created: isoly.DateTime
|
|
12
|
-
amount: [isoly.Currency, number]
|
|
13
|
-
merchant: Merchant
|
|
14
|
-
acquirer: Acquirer
|
|
15
|
-
reference: string
|
|
16
|
-
description: string
|
|
17
|
-
}
|
|
18
|
-
export namespace Base {
|
|
19
|
-
export function fromCreatable(authorization: Creatable): Base {
|
|
20
|
-
return {
|
|
21
|
-
id: cryptly.Identifier.generate(8),
|
|
22
|
-
card: authorization.card,
|
|
23
|
-
created: isoly.DateTime.now(),
|
|
24
|
-
amount: authorization.amount,
|
|
25
|
-
merchant: authorization.merchant,
|
|
26
|
-
acquirer: authorization.acquirer,
|
|
27
|
-
reference: authorization.reference,
|
|
28
|
-
description: authorization.description,
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export const type = isly.object<Base>({
|
|
32
|
-
id: isly.fromIs("Authorization.id", cryptly.Identifier.is),
|
|
33
|
-
card: isly.string(),
|
|
34
|
-
created: isly.fromIs("Authorization.created", isoly.DateTime.is),
|
|
35
|
-
amount: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
36
|
-
merchant: Merchant.type,
|
|
37
|
-
acquirer: Acquirer.type,
|
|
38
|
-
reference: isly.string(),
|
|
39
|
-
description: isly.string(),
|
|
40
|
-
})
|
|
41
|
-
export const is = type.is
|
|
42
|
-
export const flaw = type.flaw
|
|
43
|
-
}
|
package/Authorization/Failed.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { gracely } from "gracely"
|
|
2
|
-
import { isly } from "isly"
|
|
3
|
-
import { Transaction } from "../Transaction"
|
|
4
|
-
import { Base } from "./Base"
|
|
5
|
-
import { Creatable } from "./Creatable"
|
|
6
|
-
|
|
7
|
-
export interface Failed extends Base {
|
|
8
|
-
status: { code: string; reason: string | string[] }
|
|
9
|
-
error?: gracely.Error
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export namespace Failed {
|
|
13
|
-
export const type = Base.type.extend<Failed>({
|
|
14
|
-
status: isly.object({ code: isly.string(), reason: isly.union(isly.string(), isly.string().array()) }),
|
|
15
|
-
error: isly.fromIs("error", gracely.Error.is).optional(),
|
|
16
|
-
})
|
|
17
|
-
export const is = type.is
|
|
18
|
-
export const flaw = type.flaw
|
|
19
|
-
export function fromCreatable(authorization: Creatable, error: gracely.Error): Failed {
|
|
20
|
-
return { ...Base.fromCreatable(authorization), ...statusFrom(error), error }
|
|
21
|
-
}
|
|
22
|
-
export function statusFrom(transaction: gracely.Error): Pick<Failed, "status"> {
|
|
23
|
-
let result: Pick<Failed, "status">
|
|
24
|
-
if (transaction.error?.includes("Card with id"))
|
|
25
|
-
result = { status: { code: "14", reason: "Invalid card number" } }
|
|
26
|
-
else if (transaction.error?.includes("must correspond to card limit")) {
|
|
27
|
-
result = { status: { code: "13", reason: "Invalid amount" } }
|
|
28
|
-
} else if (transaction.error?.includes("Failed to reach account")) {
|
|
29
|
-
result = { status: { code: "78", reason: "Invalid/nonexistent account specified (general)" } }
|
|
30
|
-
} else if (gracely.client.InvalidContent.is(transaction) && transaction.content.description.includes("rules")) {
|
|
31
|
-
const reasons: string[] = transaction.content.details?.notes.reduce(
|
|
32
|
-
(a: string[], c: Transaction.Note) => [...a, `${c.created} ${c.author}: ${c.text ?? ""}`],
|
|
33
|
-
[]
|
|
34
|
-
)
|
|
35
|
-
result = {
|
|
36
|
-
status: {
|
|
37
|
-
code: "62", //Restricted card: "This means that the card that you processed is restricted to where it can be used.
|
|
38
|
-
//The restricted card is only allowed to be used for certain types of businesses or purchases."
|
|
39
|
-
reason: ["Restricted card.", ...reasons],
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
} else
|
|
43
|
-
result = { status: { code: "05", reason: "Do not honor" } } //default
|
|
44
|
-
return result
|
|
45
|
-
}
|
|
46
|
-
}
|
package/Settlement/Entry.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly"
|
|
2
|
-
import { isly } from "isly"
|
|
3
|
-
import { Acquirer } from "../Acquirer"
|
|
4
|
-
import { Merchant } from "../Merchant"
|
|
5
|
-
|
|
6
|
-
export type Entry = Succeeded | Failed
|
|
7
|
-
|
|
8
|
-
export interface Succeeded {
|
|
9
|
-
status: "succeeded"
|
|
10
|
-
type: "capture" | "cancel" | "refund"
|
|
11
|
-
account: string
|
|
12
|
-
card: { id: string; token: string; iin: string; last4: string }
|
|
13
|
-
authorization: string
|
|
14
|
-
transaction: { id: string; posted: isoly.DateTime; description: string }
|
|
15
|
-
amount: [isoly.Currency, number]
|
|
16
|
-
fee: [isoly.Currency, number]
|
|
17
|
-
merchant: Merchant
|
|
18
|
-
acquirer: Acquirer
|
|
19
|
-
}
|
|
20
|
-
export interface Failed {
|
|
21
|
-
status: "failed"
|
|
22
|
-
type?: "capture" | "cancel" | "refund"
|
|
23
|
-
account?: string
|
|
24
|
-
card?: { id: string; token: string; iin: string; last4: string }
|
|
25
|
-
authorization?: string
|
|
26
|
-
transaction?: { id: string; posted: isoly.DateTime; description: string }
|
|
27
|
-
amount?: [isoly.Currency, number]
|
|
28
|
-
fee?: [isoly.Currency, number]
|
|
29
|
-
reason?: string
|
|
30
|
-
data?: any
|
|
31
|
-
}
|
|
32
|
-
export namespace Entry {
|
|
33
|
-
export namespace Succeeded {
|
|
34
|
-
export const type = isly.object<Succeeded>({
|
|
35
|
-
status: isly.string("succeeded"),
|
|
36
|
-
type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")),
|
|
37
|
-
account: isly.string(),
|
|
38
|
-
card: isly.object<{ id: string; token: string; iin: string; last4: string }>({
|
|
39
|
-
id: isly.string(),
|
|
40
|
-
token: isly.string(),
|
|
41
|
-
iin: isly.string(),
|
|
42
|
-
last4: isly.string(),
|
|
43
|
-
}),
|
|
44
|
-
authorization: isly.string(),
|
|
45
|
-
transaction: isly.object<{ id: string; posted: string; description: string }>({
|
|
46
|
-
id: isly.string(),
|
|
47
|
-
posted: isly.fromIs("transaction.posted", isoly.DateTime.is),
|
|
48
|
-
description: isly.string(),
|
|
49
|
-
}),
|
|
50
|
-
amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()),
|
|
51
|
-
fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()),
|
|
52
|
-
merchant: Merchant.type,
|
|
53
|
-
acquirer: Acquirer.type,
|
|
54
|
-
})
|
|
55
|
-
export const is = type.is
|
|
56
|
-
}
|
|
57
|
-
export namespace Failed {
|
|
58
|
-
export const type = isly.object<Failed>({
|
|
59
|
-
status: isly.string("failed"),
|
|
60
|
-
type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")).optional(),
|
|
61
|
-
account: isly.string().optional(),
|
|
62
|
-
card: isly
|
|
63
|
-
.object<{ id: string; token: string; iin: string; last4: string }>({
|
|
64
|
-
id: isly.string(),
|
|
65
|
-
token: isly.string(),
|
|
66
|
-
iin: isly.string(),
|
|
67
|
-
last4: isly.string(),
|
|
68
|
-
})
|
|
69
|
-
.optional(),
|
|
70
|
-
authorization: isly.string().optional(),
|
|
71
|
-
transaction: isly
|
|
72
|
-
.object<{ id: string; posted: string; description: string }>({
|
|
73
|
-
id: isly.string(),
|
|
74
|
-
posted: isly.fromIs("transaction.posted", isoly.DateTime.is),
|
|
75
|
-
description: isly.string(),
|
|
76
|
-
})
|
|
77
|
-
.optional(),
|
|
78
|
-
amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()).optional(),
|
|
79
|
-
fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()).optional(),
|
|
80
|
-
reason: isly.string().optional(),
|
|
81
|
-
data: isly.any().optional(),
|
|
82
|
-
})
|
|
83
|
-
export const is = type.is
|
|
84
|
-
}
|
|
85
|
-
export const type = isly.union<Entry, Succeeded, Failed>(Succeeded.type, Failed.type)
|
|
86
|
-
export const is = type.is
|
|
87
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { isly } from "isly";
|
|
2
|
-
import { Transaction } from "../Transaction";
|
|
3
|
-
import { Base } from "./Base";
|
|
4
|
-
import { Creatable } from "./Creatable";
|
|
5
|
-
export interface Approved extends Base {
|
|
6
|
-
transaction: string;
|
|
7
|
-
status: "approved";
|
|
8
|
-
}
|
|
9
|
-
export declare namespace Approved {
|
|
10
|
-
const type: isly.object.ExtendableType<Approved>;
|
|
11
|
-
const is: isly.Type.IsFunction<Approved>;
|
|
12
|
-
const flaw: isly.Type.FlawFunction;
|
|
13
|
-
function fromCreatable(authorization: Creatable, transaction: Transaction): Approved;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isly } from "isly";
|
|
2
|
-
import { Base } from "./Base";
|
|
3
|
-
export var Approved;
|
|
4
|
-
(function (Approved) {
|
|
5
|
-
Approved.type = Base.type.extend({
|
|
6
|
-
transaction: isly.string(),
|
|
7
|
-
status: isly.string("approved"),
|
|
8
|
-
});
|
|
9
|
-
Approved.is = Approved.type.is;
|
|
10
|
-
Approved.flaw = Approved.type.flaw;
|
|
11
|
-
function fromCreatable(authorization, transaction) {
|
|
12
|
-
return { ...Base.fromCreatable(authorization), transaction: transaction.id, status: "approved" };
|
|
13
|
-
}
|
|
14
|
-
Approved.fromCreatable = fromCreatable;
|
|
15
|
-
})(Approved || (Approved = {}));
|
|
16
|
-
//# sourceMappingURL=Approved.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Approved.js","sourceRoot":"../","sources":["Authorization/Approved.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAQ7B,MAAM,KAAW,QAAQ,CAUxB;AAVD,WAAiB,QAAQ;IACX,aAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAW;QAC9C,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;KAC/B,CAAC,CAAA;IACW,WAAE,GAAG,SAAA,IAAI,CAAC,EAAE,CAAA;IACZ,aAAI,GAAG,SAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,aAAa,CAAC,aAAwB,EAAE,WAAwB;QAC/E,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;IACjG,CAAC;IAFe,sBAAa,gBAE5B,CAAA;AACF,CAAC,EAVgB,QAAQ,KAAR,QAAQ,QAUxB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { cryptly } from "cryptly";
|
|
2
|
-
import { isoly } from "isoly";
|
|
3
|
-
import { isly } from "isly";
|
|
4
|
-
import { Acquirer } from "../Acquirer";
|
|
5
|
-
import { Merchant } from "../Merchant";
|
|
6
|
-
import { Creatable } from "./Creatable";
|
|
7
|
-
export type Base = {
|
|
8
|
-
id: cryptly.Identifier;
|
|
9
|
-
card: string;
|
|
10
|
-
created: isoly.DateTime;
|
|
11
|
-
amount: [isoly.Currency, number];
|
|
12
|
-
merchant: Merchant;
|
|
13
|
-
acquirer: Acquirer;
|
|
14
|
-
reference: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
export declare namespace Base {
|
|
18
|
-
function fromCreatable(authorization: Creatable): Base;
|
|
19
|
-
const type: isly.object.ExtendableType<Base>;
|
|
20
|
-
const is: isly.Type.IsFunction<Base>;
|
|
21
|
-
const flaw: isly.Type.FlawFunction;
|
|
22
|
-
}
|