Skip to content

Interface: ReconcileContext ​

Defined in: src/errors/index.ts:78

The minimum facts reconcile needs to look a call up. The client attaches one to the error of every call that was made (error.context); an error that comes before there is a call, such as bad call options, has none. It never contains headers, signatures or the channel secret.

To reconcile a call whose error you never saw, because the process died before it got an answer, write one down before making the call and pass it to client.reconcile later. Every field it needs must be there, with the type shown, or reconcile answers indeterminate and says which one is wrong:

operationneedsalso uses
confirmtransactionId, amount, currency
capturetransactionId, amount, currency
voidtransactionId
refundtransactionIdrefundAmount
payPreapprovedorderId, amount, currency

channelId is on the context of every error: keep it on a context you save. When a context carries one, reconcile refuses to look it up with a client of another channel. Without one it never concludes not-applied from a payment that is not there: a client with the wrong credentials sees nothing, and "nothing" would read as "it did not happen".

Properties ​

amount? ​

ts
readonly amount?: number;

Defined in: src/errors/index.ts:94

What the call asked for; the payment must match it.


channelId? ​

ts
readonly channelId?: string;

Defined in: src/errors/index.ts:88

The channel of the client that made the call.


currency? ​

ts
readonly currency?: string;

Defined in: src/errors/index.ts:95


operation ​

ts
readonly operation: 
  | "request"
  | "confirm"
  | "capture"
  | "void"
  | "refund"
  | "paymentDetails"
  | "checkPaymentStatus"
  | "checkRegKey"
  | "payPreapproved"
  | "expireRegKey";

Defined in: src/errors/index.ts:79


orderId? ​

ts
readonly orderId?: string;

Defined in: src/errors/index.ts:92

As a string, the one of the call.


refundAmount? ​

ts
readonly refundAmount?: number;

Defined in: src/errors/index.ts:97

Leave it out for a full refund.


startedAt ​

ts
readonly startedAt: Date;

Defined in: src/errors/index.ts:86

When the call began. A refund, and a pre-approved payment, are looked for from this second on. A context that was saved comes back from JSON with a string or a number here, and reconcile accepts an ISO 8601 string with a time zone or milliseconds too.


transactionId? ​

ts
readonly transactionId?: string;

Defined in: src/errors/index.ts:90

1 to 19 digits, as a string.

Released under the MIT License. An independent library, not made or endorsed by LINE Pay.