@pax2pay/model-banking 0.1.454 → 0.1.456

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.
Files changed (80) hide show
  1. package/Card/Operation/index.ts +12 -4
  2. package/Client/Transactions/index.ts +4 -0
  3. package/Operation/Changes.ts +1 -1
  4. package/Operation/Creatable.ts +1 -1
  5. package/Settlement/Entry/{Legacy/Cancel.ts → Cancel.ts} +5 -5
  6. package/Settlement/Entry/{Legacy/Capture.ts → Capture.ts} +5 -5
  7. package/Settlement/Entry/Creatable.ts +11 -111
  8. package/Settlement/Entry/{Legacy/Refund.ts → Refund.ts} +8 -8
  9. package/Settlement/Entry/{Legacy/Unknown.ts → Unknown.ts} +3 -3
  10. package/Settlement/Entry/index.ts +50 -19
  11. package/Settlement/index.ts +1 -1
  12. package/Transaction/Incoming.ts +1 -1
  13. package/Transaction/index.ts +1 -1
  14. package/Warning/Settlement/UnknownEntry.ts +3 -6
  15. package/dist/Card/Operation/index.d.ts +2 -1
  16. package/dist/Card/Operation/index.js +12 -3
  17. package/dist/Card/Operation/index.js.map +1 -1
  18. package/dist/Client/Transactions/index.d.ts +2 -0
  19. package/dist/Client/Transactions/index.js +3 -0
  20. package/dist/Client/Transactions/index.js.map +1 -1
  21. package/dist/Operation/Changes.d.ts +1 -1
  22. package/dist/Operation/Creatable.d.ts +1 -1
  23. package/dist/Settlement/Entry/{Legacy/Cancel.d.ts → Cancel.d.ts} +5 -5
  24. package/dist/Settlement/Entry/{Legacy/Cancel.js → Cancel.js} +5 -5
  25. package/dist/Settlement/Entry/Cancel.js.map +1 -0
  26. package/dist/Settlement/Entry/{Legacy/Capture.d.ts → Capture.d.ts} +5 -5
  27. package/dist/Settlement/Entry/{Legacy/Capture.js → Capture.js} +5 -5
  28. package/dist/Settlement/Entry/Capture.js.map +1 -0
  29. package/dist/Settlement/Entry/Creatable.d.ts +6 -51
  30. package/dist/Settlement/Entry/Creatable.js +5 -88
  31. package/dist/Settlement/Entry/Creatable.js.map +1 -1
  32. package/dist/Settlement/Entry/{Legacy/Refund.d.ts → Refund.d.ts} +8 -8
  33. package/dist/Settlement/Entry/{Legacy/Refund.js → Refund.js} +7 -7
  34. package/dist/Settlement/Entry/Refund.js.map +1 -0
  35. package/dist/Settlement/Entry/{Legacy/Unknown.d.ts → Unknown.d.ts} +3 -3
  36. package/dist/Settlement/Entry/{Legacy/Unknown.js → Unknown.js} +3 -3
  37. package/dist/Settlement/Entry/Unknown.js.map +1 -0
  38. package/dist/Settlement/Entry/index.d.ts +16 -19
  39. package/dist/Settlement/Entry/index.js +45 -13
  40. package/dist/Settlement/Entry/index.js.map +1 -1
  41. package/dist/Settlement/index.d.ts +1 -1
  42. package/dist/Settlement/index.js.map +1 -1
  43. package/dist/Transaction/Incoming.d.ts +1 -1
  44. package/dist/Transaction/index.d.ts +1 -1
  45. package/dist/Warning/Settlement/UnknownEntry.d.ts +2 -6
  46. package/dist/Warning/Settlement/UnknownEntry.js +1 -2
  47. package/dist/Warning/Settlement/UnknownEntry.js.map +1 -1
  48. package/package.json +1 -1
  49. package/Settlement/Entry/Failed.ts +0 -27
  50. package/Settlement/Entry/Legacy/Creatable.ts +0 -15
  51. package/Settlement/Entry/Legacy/index.ts +0 -55
  52. package/Settlement/Entry/Succeeded.ts +0 -22
  53. package/Settlement/Entry/fromCreatable.ts +0 -38
  54. package/Settlement/Entry/fromLegacy.ts +0 -86
  55. package/Settlement/Entry/type.ts +0 -6
  56. package/dist/Settlement/Entry/Failed.d.ts +0 -11
  57. package/dist/Settlement/Entry/Failed.js +0 -12
  58. package/dist/Settlement/Entry/Failed.js.map +0 -1
  59. package/dist/Settlement/Entry/Legacy/Cancel.js.map +0 -1
  60. package/dist/Settlement/Entry/Legacy/Capture.js.map +0 -1
  61. package/dist/Settlement/Entry/Legacy/Creatable.d.ts +0 -9
  62. package/dist/Settlement/Entry/Legacy/Creatable.js +0 -10
  63. package/dist/Settlement/Entry/Legacy/Creatable.js.map +0 -1
  64. package/dist/Settlement/Entry/Legacy/Refund.js.map +0 -1
  65. package/dist/Settlement/Entry/Legacy/Unknown.js.map +0 -1
  66. package/dist/Settlement/Entry/Legacy/index.d.ts +0 -19
  67. package/dist/Settlement/Entry/Legacy/index.js +0 -50
  68. package/dist/Settlement/Entry/Legacy/index.js.map +0 -1
  69. package/dist/Settlement/Entry/Succeeded.d.ts +0 -14
  70. package/dist/Settlement/Entry/Succeeded.js +0 -17
  71. package/dist/Settlement/Entry/Succeeded.js.map +0 -1
  72. package/dist/Settlement/Entry/fromCreatable.d.ts +0 -6
  73. package/dist/Settlement/Entry/fromCreatable.js +0 -30
  74. package/dist/Settlement/Entry/fromCreatable.js.map +0 -1
  75. package/dist/Settlement/Entry/fromLegacy.d.ts +0 -3
  76. package/dist/Settlement/Entry/fromLegacy.js +0 -78
  77. package/dist/Settlement/Entry/fromLegacy.js.map +0 -1
  78. package/dist/Settlement/Entry/type.d.ts +0 -3
  79. package/dist/Settlement/Entry/type.js +0 -5
  80. package/dist/Settlement/Entry/type.js.map +0 -1
@@ -16,15 +16,23 @@ export namespace Operation {
16
16
  created: isoly.DateTime.now(),
17
17
  }
18
18
  }
19
- export function fromEntry(entry: Entry | Entry.Failed): Operation | undefined {
20
- return entry.status == "failed"
19
+ export function fromEntry(entry: Entry): Operation | undefined {
20
+ return entry.type == "unknown"
21
21
  ? undefined
22
22
  : {
23
23
  type: "authorization",
24
- id: entry.transaction ?? "unknown",
25
- status: entry.type == "capture" ? "captured" : "refunded",
24
+ id: (entry.type != "refund" ? entry.authorization?.id : entry.transaction?.id) ?? "unknown",
25
+ status: Operation.fromEntryStatus(entry.type),
26
26
  created: isoly.DateTime.now(),
27
27
  }
28
28
  }
29
+ export function fromEntryStatus(status: Exclude<Entry.Type, "unknown">): OperationAuthorization.Status {
30
+ const statusConverter: Record<Exclude<Entry.Type, "unknown">, OperationAuthorization.Status> = {
31
+ capture: "captured",
32
+ cancel: "cancelled",
33
+ refund: "refunded",
34
+ }
35
+ return statusConverter[status]
36
+ }
29
37
  export const type = isly.union(Card.type, OperationAuthorization.type)
30
38
  }
@@ -4,6 +4,7 @@ import { http } from "cloudly-http"
4
4
  import * as rest from "cloudly-rest"
5
5
  import { Card } from "../../Card"
6
6
  import { Operation } from "../../Operation"
7
+ import { Rule } from "../../Rule"
7
8
  import { Supplier } from "../../Supplier"
8
9
  import { Transaction } from "../../Transaction"
9
10
  import { Notes } from "./Notes"
@@ -44,6 +45,9 @@ export class Transactions extends rest.Collection<gracely.Error> {
44
45
  async getOperations(transactionId: string): Promise<Operation[] | gracely.Error> {
45
46
  return this.client.get<Operation[]>(`/transaction/${transactionId}/operation`)
46
47
  }
48
+ async getState(transactionId: string): Promise<Rule.State | gracely.Error> {
49
+ return this.client.get<Rule.State>(`/transaction/${transactionId}/state`)
50
+ }
47
51
  async statistics(
48
52
  range: isoly.DateRange,
49
53
  queries?: { cursor?: string; scheme?: Card.Scheme; supplier?: Supplier; limit?: number }
@@ -114,7 +114,7 @@ export namespace Changes {
114
114
  }
115
115
  export function fromRefund(
116
116
  settlement: string | undefined, // FIXME: remove | undefined when we're sure we send the id
117
- refund: Settlement.Entry.Creatable.Refund,
117
+ refund: Settlement.Entry.Refund.Creatable,
118
118
  charge: number | undefined,
119
119
  sum: Sum
120
120
  ): Changes {
@@ -36,7 +36,7 @@ export namespace Creatable {
36
36
  changes: Changes.type,
37
37
  type: isly.string(types),
38
38
  })
39
- export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Creatable.Refund): Creatable {
39
+ export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable): Creatable {
40
40
  // The Entry.Refund.Creatable has negative amount and fee
41
41
  // The operation amounts should always be positive
42
42
  const [currency, entryAmount] = entry.amount
@@ -1,10 +1,10 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { Amount } from "../../../Amount"
4
- import { Authorization } from "../../../Authorization"
5
- import { Batch } from "../../Batch"
6
- import { Fee } from "../../Fee"
7
- import { Identifier as SettlementIdentifier } from "../../Identifier"
3
+ import { Amount } from "../../Amount"
4
+ import { Authorization } from "../../Authorization"
5
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier"
6
+ import { Batch } from "../Batch"
7
+ import { Fee } from "../Fee"
8
8
 
9
9
  export interface Cancel extends Omit<Cancel.Creatable, "settlement"> {
10
10
  status: "succeeded" | "failed"
@@ -1,10 +1,10 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { Amount } from "../../../Amount"
4
- import { Authorization } from "../../../Authorization"
5
- import { Batch } from "../../Batch"
6
- import { Fee } from "../../Fee"
7
- import { Identifier as SettlementIdentifier } from "../../Identifier"
3
+ import { Amount } from "../../Amount"
4
+ import { Authorization } from "../../Authorization"
5
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier"
6
+ import { Batch } from "../Batch"
7
+ import { Fee } from "../Fee"
8
8
 
9
9
  export interface Capture extends Omit<Capture.Creatable, "settlement"> {
10
10
  status: "succeeded" | "failed"
@@ -1,115 +1,15 @@
1
1
  import { isly } from "isly"
2
- import { Acquirer } from "../../Acquirer"
3
- import { Amount } from "../../Amount"
4
- import { Merchant } from "../../Merchant"
5
- import { Batch } from "../Batch"
6
- import { Fee } from "../Fee"
7
- import { Identifier as SettlementIdentifier } from "../Identifier"
8
- import { Entry as LegacyEntry } from "./Legacy"
2
+ import { Cancel as EntryCancel } from "./Cancel"
3
+ import { Capture as EntryCapture } from "./Capture"
4
+ import { Refund as EntryRefund } from "./Refund"
5
+ import { Unknown as EntryUnknown } from "./Unknown"
9
6
 
10
- export type Creatable = Creatable.Known | Creatable.Unknown
7
+ export type Creatable = EntryCancel.Creatable | EntryCapture.Creatable | EntryRefund.Creatable | EntryUnknown.Creatable
11
8
  export namespace Creatable {
12
- export interface Base {
13
- card: string
14
- transaction?: string
15
- account: string
16
- approvalCode: string
17
- merchant: Merchant
18
- acquirer: Acquirer
19
- reference: string
20
- batch: Batch
21
- fee: Fee
22
- amount: Amount
23
- settlement: SettlementIdentifier
24
- }
25
- export namespace Base {
26
- export const type = isly.object<Base>({
27
- card: isly.string(),
28
- transaction: isly.string().optional(),
29
- account: isly.string(),
30
- approvalCode: isly.string(),
31
- merchant: Merchant.type,
32
- acquirer: Acquirer.type,
33
- reference: isly.string(),
34
- batch: Batch.type,
35
- fee: Fee.type,
36
- amount: Amount.type,
37
- settlement: SettlementIdentifier.type,
38
- })
39
- }
40
- export interface Capture extends Base {
41
- type: "capture"
42
- }
43
- export namespace Capture {
44
- export const type = Base.type.extend<Capture>({
45
- type: isly.string("capture"),
46
- })
47
- export function fromLegacy(maybeLegacy: Capture | LegacyEntry.Capture.Creatable): Capture {
48
- return type.is(maybeLegacy)
49
- ? maybeLegacy
50
- : {
51
- type: maybeLegacy.type,
52
- card: maybeLegacy.authorization.card.id,
53
- transaction: maybeLegacy.authorization.transaction?.id,
54
- account: maybeLegacy.authorization.account || "unknown",
55
- approvalCode: maybeLegacy.authorization.approvalCode ?? "unknown",
56
- merchant: maybeLegacy.authorization.merchant,
57
- acquirer: maybeLegacy.authorization.acquirer,
58
- reference: maybeLegacy.reference,
59
- batch: maybeLegacy.batch,
60
- fee: maybeLegacy.fee,
61
- amount: maybeLegacy.amount,
62
- settlement: maybeLegacy.settlement ?? "unknown",
63
- }
64
- }
65
- }
66
- export interface Refund extends Base {
67
- type: "refund"
68
- }
69
- export namespace Refund {
70
- export const type = Base.type.extend<Refund>({
71
- type: isly.string("refund"),
72
- })
73
- export function fromLegacy(maybeLegacy: Refund | LegacyEntry.Refund.Creatable): Refund {
74
- return type.is(maybeLegacy)
75
- ? maybeLegacy
76
- : {
77
- type: maybeLegacy.type,
78
- card: maybeLegacy.card,
79
- account: maybeLegacy.account ?? "unknown",
80
- approvalCode: maybeLegacy.authorization.approvalCode ?? "unknown",
81
- merchant: maybeLegacy.merchant,
82
- acquirer: maybeLegacy.acquirer,
83
- reference: maybeLegacy.reference,
84
- batch: maybeLegacy.batch,
85
- fee: maybeLegacy.fee,
86
- amount: maybeLegacy.amount,
87
- settlement: maybeLegacy.settlement ?? "unknown",
88
- }
89
- }
90
- }
91
- export type Known = Capture | Refund
92
-
93
- export namespace Known {
94
- export const type = isly.union(Capture.type, Refund.type)
95
- export function fromLegacy(
96
- maybeLegacy: Creatable.Known | LegacyEntry.Capture.Creatable | LegacyEntry.Refund.Creatable
97
- ): Creatable.Known {
98
- return maybeLegacy.type == "capture" ? Capture.fromLegacy(maybeLegacy) : Refund.fromLegacy(maybeLegacy)
99
- }
100
- }
101
- export interface Unknown extends Partial<Base> {
102
- type: "unknown"
103
- data: Record<string, unknown>
104
- }
105
- export namespace Unknown {
106
- export const type = isly.object<Unknown>({
107
- ...(Object.fromEntries(
108
- Object.entries(Base.type.getProperties()).map(([k, v]) => [k, v.optional()])
109
- ) as isly.object.Properties<Partial<Base>>), // TODO: Add "Partial" to isly
110
- type: isly.string("unknown"),
111
- data: isly.record<Record<string, unknown>>(isly.string(), isly.any()),
112
- })
113
- }
114
- export const type = isly.union(Known.type, Unknown.type)
9
+ export const type = isly.union(
10
+ EntryCancel.Creatable.type,
11
+ EntryCapture.Creatable.type,
12
+ EntryRefund.Creatable.type,
13
+ EntryUnknown.Creatable.type
14
+ )
115
15
  }
@@ -1,13 +1,13 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { Acquirer } from "../../../Acquirer"
4
- import { Amount } from "../../../Amount"
5
- import { Authorization } from "../../../Authorization"
6
- import { Merchant } from "../../../Merchant"
7
- import { Transaction } from "../../../Transaction"
8
- import { Batch } from "../../Batch"
9
- import { Fee } from "../../Fee"
10
- import { Identifier as SettlementIdentifier } from "../../Identifier"
3
+ import { Acquirer } from "../../Acquirer"
4
+ import { Amount } from "../../Amount"
5
+ import { Authorization } from "../../Authorization"
6
+ import { Merchant } from "../../Merchant"
7
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier"
8
+ import { Transaction } from "../../Transaction"
9
+ import { Batch } from "../Batch"
10
+ import { Fee } from "../Fee"
11
11
 
12
12
  export interface Refund extends Omit<Refund.Creatable, "settlement"> {
13
13
  status: "succeeded" | "failed"
@@ -1,8 +1,8 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { Authorization } from "../../../Authorization"
4
- import { Batch } from "../../Batch"
5
- import { Identifier as SettlementIdentifier } from "../../Identifier"
3
+ import { Authorization } from "../../Authorization"
4
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier"
5
+ import { Batch } from "../Batch"
6
6
 
7
7
  export interface Unknown extends Omit<Unknown.Creatable, "settlement"> {
8
8
  status: "succeeded" | "failed"
@@ -1,26 +1,57 @@
1
+ import { gracely } from "gracely"
2
+ import { isoly } from "isoly"
3
+ import { isly } from "isly"
4
+ import { Transaction } from "../../Transaction"
5
+ import { Cancel as EntryCancel } from "./Cancel"
6
+ import { Capture as EntryCapture } from "./Capture"
1
7
  import { Creatable as EntryCreatable } from "./Creatable"
2
- import { Failed as EntryFailed } from "./Failed"
3
- import { fromCreatable } from "./fromCreatable"
4
- import { fromLegacy as entryFromLegacy } from "./fromLegacy"
5
- import { Entry as LegacyEntry } from "./Legacy"
6
- import { Succeeded as EntrySucceeded } from "./Succeeded"
8
+ import { Refund as EntryRefund } from "./Refund"
7
9
  import { Summary as EntrySummary } from "./Summary"
8
- import { type as entryType } from "./type"
10
+ import { Unknown as EntryUnknown } from "./Unknown"
9
11
 
10
- export type Entry = EntrySucceeded | EntryFailed
12
+ export type Entry = Entry.Cancel | Entry.Capture | Entry.Refund | Entry.Unknown
11
13
  export namespace Entry {
12
- export interface Capture extends EntrySucceeded {
13
- type: "capture"
14
+ export import Cancel = EntryCancel
15
+ export import Capture = EntryCapture
16
+ export import Refund = EntryRefund
17
+ export import Unknown = EntryUnknown
18
+ export type Type = "unknown" | "refund" | "capture" | "cancel"
19
+ export import Summary = EntrySummary
20
+ export import Creatable = EntryCreatable
21
+ export function from(creatable: Entry.Creatable, transaction: Transaction | gracely.Error | string): Entry {
22
+ let result: Entry
23
+ const created = isoly.DateTime.now()
24
+ if (!Transaction.type.is(transaction) || transaction.status != "finalized")
25
+ result = { status: "failed", reason: reason(creatable, transaction), ...creatable, created }
26
+ else
27
+ switch (creatable.type) {
28
+ case "capture":
29
+ result = Capture.from(creatable)
30
+ break
31
+ case "refund":
32
+ result = Refund.from(creatable, transaction)
33
+ break
34
+ default:
35
+ result = { ...creatable, status: "failed", reason: "Entry type not implemented yet.", created }
36
+ break
37
+ }
38
+ return result
14
39
  }
15
- export interface Refund extends EntrySucceeded {
16
- type: "refund"
40
+ function reason(creatable: Entry.Creatable, transaction: Transaction | gracely.Error | string): string {
41
+ const result = []
42
+ !creatable.authorization && result.push("Missing authorization.")
43
+ if (gracely.Error.is(transaction))
44
+ result.push(`gracely error: ${JSON.stringify(transaction)}`)
45
+ else if (typeof transaction != "string")
46
+ result.push(`Transaction ${transaction.id} on account ${transaction.accountId} unable to be finalized.`)
47
+ else
48
+ result.push(transaction || "No reason provided")
49
+ return result.join("\n")
17
50
  }
18
- export import Creatable = EntryCreatable
19
- export import Failed = EntryFailed
20
- export import Succeeded = EntrySucceeded
21
- export import Summary = EntrySummary
22
- export import Legacy = LegacyEntry
23
- export const type = entryType
24
- export const fromLegacy = entryFromLegacy
25
- export const from = fromCreatable
51
+ export const type = isly.union<Entry, Entry.Cancel, Entry.Capture, Entry.Refund, Entry.Unknown>(
52
+ Entry.Cancel.type,
53
+ Entry.Capture.type,
54
+ Entry.Refund.type,
55
+ Entry.Unknown.type
56
+ )
26
57
  }
@@ -40,7 +40,7 @@ export namespace Settlement {
40
40
  entries: { count: 0 },
41
41
  }
42
42
  }
43
- export function compile(settlement: Settlement, entries: (Settlement.Entry | Settlement.Entry.Failed)[]): Settlement {
43
+ export function compile(settlement: Settlement, entries: Settlement.Entry[]): Settlement {
44
44
  const result = { ...settlement }
45
45
  for (const entry of entries) {
46
46
  switch (entry.status) {
@@ -26,7 +26,7 @@ export namespace Incoming {
26
26
  reference: TransactionReference.type.optional(),
27
27
  })
28
28
 
29
- export function fromRefund(entry: Settlement.Entry.Creatable.Refund, card: Rail.Address.Card): Incoming {
29
+ export function fromRefund(entry: Settlement.Entry.Refund.Creatable, card: Rail.Address.Card): Incoming {
30
30
  const [currency, amount] = entry.amount
31
31
  return {
32
32
  account: card,
@@ -335,7 +335,7 @@ export namespace Transaction {
335
335
  }
336
336
  }
337
337
  export function fromRefund(
338
- refund: Settlement.Entry.Creatable.Refund,
338
+ refund: Settlement.Entry.Refund.Creatable,
339
339
  id: string,
340
340
  account: { id: string; name: string; organization: string },
341
341
  card: Rail.Address.Card,
@@ -2,16 +2,14 @@ import { cryptly } from "cryptly"
2
2
  import { isoly } from "isoly"
3
3
  import { isly } from "isly"
4
4
  import { Authorization } from "../../Authorization"
5
- import { Entry } from "../../Settlement/Entry"
5
+ import { Unknown } from "../../Settlement/Entry/Unknown"
6
6
  import { Identifier } from "../../Settlement/Identifier"
7
- import { Transaction } from "../../Transaction"
8
7
  import { Base } from "../Base"
9
8
 
10
9
  export interface UnknownEntry extends Base {
11
10
  type: "unknown-entry"
12
11
  resource: Identifier
13
12
  authorization?: Authorization["id"]
14
- transaction?: Transaction["id"]
15
13
  }
16
14
 
17
15
  export namespace UnknownEntry {
@@ -19,13 +17,12 @@ export namespace UnknownEntry {
19
17
  type: isly.string("unknown-entry"),
20
18
  resource: Identifier.type,
21
19
  authorization: isly.fromIs("Authorization.id", cryptly.Identifier.is).optional(),
22
- transaction: isly.string().optional(),
23
20
  })
24
- export function create(entry: Extract<Entry.Failed, { type: "unknown" }>, resource: Identifier): UnknownEntry {
21
+ export function create(entry: Unknown, resource: Identifier): UnknownEntry {
25
22
  return {
26
23
  type: "unknown-entry",
27
24
  resource,
28
- transaction: entry.transaction,
25
+ authorization: entry.authorization?.id,
29
26
  date: isoly.Date.now(),
30
27
  }
31
28
  }
@@ -6,6 +6,7 @@ import { Card } from "./Card";
6
6
  export type Operation = Card | OperationAuthorization;
7
7
  export declare namespace Operation {
8
8
  function fromAuthorization(authorization: Authorization, status: OperationAuthorization.Status): Operation;
9
- function fromEntry(entry: Entry | Entry.Failed): Operation | undefined;
9
+ function fromEntry(entry: Entry): Operation | undefined;
10
+ function fromEntryStatus(status: Exclude<Entry.Type, "unknown">): OperationAuthorization.Status;
10
11
  const type: isly.Type<Card | OperationAuthorization>;
11
12
  }
@@ -14,16 +14,25 @@ export var Operation;
14
14
  }
15
15
  Operation.fromAuthorization = fromAuthorization;
16
16
  function fromEntry(entry) {
17
- return entry.status == "failed"
17
+ return entry.type == "unknown"
18
18
  ? undefined
19
19
  : {
20
20
  type: "authorization",
21
- id: entry.transaction ?? "unknown",
22
- status: entry.type == "capture" ? "captured" : "refunded",
21
+ id: (entry.type != "refund" ? entry.authorization?.id : entry.transaction?.id) ?? "unknown",
22
+ status: Operation.fromEntryStatus(entry.type),
23
23
  created: isoly.DateTime.now(),
24
24
  };
25
25
  }
26
26
  Operation.fromEntry = fromEntry;
27
+ function fromEntryStatus(status) {
28
+ const statusConverter = {
29
+ capture: "captured",
30
+ cancel: "cancelled",
31
+ refund: "refunded",
32
+ };
33
+ return statusConverter[status];
34
+ }
35
+ Operation.fromEntryStatus = fromEntryStatus;
27
36
  Operation.type = isly.union(Card.type, OperationAuthorization.type);
28
37
  })(Operation || (Operation = {}));
29
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAI7B,MAAM,KAAW,SAAS,CAoBzB;AApBD,WAAiB,SAAS;IACzB,SAAgB,iBAAiB,CAAC,aAA4B,EAA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,EAAE,IAAI,aAAa,CAAC,WAAW,EAAE,EAAE,IAAI,SAAS;YACnE,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;SAC7B,CAAA;IACF,CAAC;IAPe,2BAAiB,oBAOhC,CAAA;IACD,SAAgB,SAAS,CAAC,KAAY;QACrC,OAAO,KAAK,CAAC,IAAI,IAAI,SAAS;YAC7B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC;gBACA,IAAI,EAAE,eAAe;gBACrB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,SAAS;gBAC3F,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC7C,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;aAC5B,CAAA;IACL,CAAC;IATe,mBAAS,YASxB,CAAA;IACD,SAAgB,eAAe,CAAC,MAAsC;QACrE,MAAM,eAAe,GAA0E;YAC9F,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,UAAU;SAClB,CAAA;QACD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAPe,yBAAe,kBAO9B,CAAA;IACY,cAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAA;AACvE,CAAC,EA5BgB,SAAS,KAAT,SAAS,QA4BzB"}
@@ -4,6 +4,7 @@ import { http } from "cloudly-http";
4
4
  import * as rest from "cloudly-rest";
5
5
  import { Card } from "../../Card";
6
6
  import { Operation } from "../../Operation";
7
+ import { Rule } from "../../Rule";
7
8
  import { Supplier } from "../../Supplier";
8
9
  import { Transaction } from "../../Transaction";
9
10
  import { Notes } from "./Notes";
@@ -22,6 +23,7 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
22
23
  }) | gracely.Error>;
23
24
  fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
24
25
  getOperations(transactionId: string): Promise<Operation[] | gracely.Error>;
26
+ getState(transactionId: string): Promise<Rule.State | gracely.Error>;
25
27
  statistics(range: isoly.DateRange, queries?: {
26
28
  cursor?: string;
27
29
  scheme?: Card.Scheme;
@@ -26,6 +26,9 @@ export class Transactions extends rest.Collection {
26
26
  async getOperations(transactionId) {
27
27
  return this.client.get(`/transaction/${transactionId}/operation`);
28
28
  }
29
+ async getState(transactionId) {
30
+ return this.client.get(`/transaction/${transactionId}/state`);
31
+ }
29
32
  async statistics(range, queries) {
30
33
  const query = "?" + http.Search.stringify({ ...queries, ...range });
31
34
  return this.client.get(`/transaction/statistics${query}`);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAKpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,WAAkC;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,YAAY,OAAO,cAAc,EAAE,WAAW,CAAC,CAAA;IACrF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAMV;QACA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;YAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,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EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,0BAA0B,KAAK,EAAE,CAAC,CAAA;IAClF,CAAC;CACD"}
@@ -42,5 +42,5 @@ export declare namespace Changes {
42
42
  fee: number;
43
43
  charge?: number;
44
44
  }): Changes;
45
- function fromRefund(settlement: string | undefined, refund: Settlement.Entry.Creatable.Refund, charge: number | undefined, sum: Sum): Changes;
45
+ function fromRefund(settlement: string | undefined, refund: Settlement.Entry.Refund.Creatable, charge: number | undefined, sum: Sum): Changes;
46
46
  }
@@ -12,5 +12,5 @@ export declare namespace Creatable {
12
12
  const types: readonly ["incoming", "finalizeIncoming", "outgoing", "finalizeOutgoing", "authorization", "capture", "charge", "refund", "cancel", "remove", "collect", "manual", "fund", "legacy", "adjustBuffer"];
13
13
  type Type = typeof types[number];
14
14
  const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
15
- function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Creatable.Refund): Creatable;
15
+ function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable): Creatable;
16
16
  }
@@ -1,9 +1,9 @@
1
1
  import { isoly } from "isoly";
2
- import { Amount } from "../../../Amount";
3
- import { Authorization } from "../../../Authorization";
4
- import { Batch } from "../../Batch";
5
- import { Fee } from "../../Fee";
6
- import { Identifier as SettlementIdentifier } from "../../Identifier";
2
+ import { Amount } from "../../Amount";
3
+ import { Authorization } from "../../Authorization";
4
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier";
5
+ import { Batch } from "../Batch";
6
+ import { Fee } from "../Fee";
7
7
  export interface Cancel extends Omit<Cancel.Creatable, "settlement"> {
8
8
  status: "succeeded" | "failed";
9
9
  reason?: string;
@@ -1,10 +1,10 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
- import { Amount } from "../../../Amount";
4
- import { Authorization } from "../../../Authorization";
5
- import { Batch } from "../../Batch";
6
- import { Fee } from "../../Fee";
7
- import { Identifier as SettlementIdentifier } from "../../Identifier";
3
+ import { Amount } from "../../Amount";
4
+ import { Authorization } from "../../Authorization";
5
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier";
6
+ import { Batch } from "../Batch";
7
+ import { Fee } from "../Fee";
8
8
  export var Cancel;
9
9
  (function (Cancel) {
10
10
  let Creatable;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cancel.js","sourceRoot":"../","sources":["Settlement/Entry/Cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAQ5B,MAAM,KAAW,MAAM,CA2BtB;AA3BD,WAAiB,MAAM;IAUtB,IAAiB,SAAS,CAUzB;IAVD,WAAiB,SAAS;QACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;YAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC3B,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC5C,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACnC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC9B,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,UAAU,EAAE,oBAAoB,CAAC,IAAI;SACrC,CAAC,CAAA;IACH,CAAC,EAVgB,SAAS,GAAT,gBAAS,KAAT,gBAAS,QAUzB;IACY,WAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAS;QACtE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,UAAU,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAA;AACH,CAAC,EA3BgB,MAAM,KAAN,MAAM,QA2BtB"}
@@ -1,9 +1,9 @@
1
1
  import { isoly } from "isoly";
2
- import { Amount } from "../../../Amount";
3
- import { Authorization } from "../../../Authorization";
4
- import { Batch } from "../../Batch";
5
- import { Fee } from "../../Fee";
6
- import { Identifier as SettlementIdentifier } from "../../Identifier";
2
+ import { Amount } from "../../Amount";
3
+ import { Authorization } from "../../Authorization";
4
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier";
5
+ import { Batch } from "../Batch";
6
+ import { Fee } from "../Fee";
7
7
  export interface Capture extends Omit<Capture.Creatable, "settlement"> {
8
8
  status: "succeeded" | "failed";
9
9
  reason?: string;
@@ -1,10 +1,10 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
- import { Amount } from "../../../Amount";
4
- import { Authorization } from "../../../Authorization";
5
- import { Batch } from "../../Batch";
6
- import { Fee } from "../../Fee";
7
- import { Identifier as SettlementIdentifier } from "../../Identifier";
3
+ import { Amount } from "../../Amount";
4
+ import { Authorization } from "../../Authorization";
5
+ import { Identifier as SettlementIdentifier } from "../../Settlement/Identifier";
6
+ import { Batch } from "../Batch";
7
+ import { Fee } from "../Fee";
8
8
  export var Capture;
9
9
  (function (Capture) {
10
10
  function from(creatable) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Capture.js","sourceRoot":"../","sources":["Settlement/Entry/Capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAQ5B,MAAM,KAAW,OAAO,CAgCvB;AAhCD,WAAiB,OAAO;IACvB,SAAgB,IAAI,CAAC,SAAoB;QACxC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAA;IAC5E,CAAC;IAFe,YAAI,OAEnB,CAAA;IAWD,IAAiB,SAAS,CAWzB;IAXD,WAAiB,SAAS;QACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;YAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YAC5B,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACjC,aAAa,EAAE,aAAa,CAAC,IAAI;YACjC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;YACxB,GAAG,EAAE,GAAG,CAAC,IAAI;YACb,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,UAAU,EAAE,oBAAoB,CAAC,IAAI;SACrC,CAAC,CAAA;IACH,CAAC,EAXgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWzB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