Skip to content

Commit

Permalink
feat: add intermediate message response
Browse files Browse the repository at this point in the history
  • Loading branch information
Matiasnickolas committed Jul 30, 2024
1 parent e4ec3b1 commit e78fed7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions types/pos.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import type { Socket } from 'socket.io-client';
import { SaleResponse, LoadKeysResponse, TotalsResponse, RefundResponse, DetailsResponse, CloseResponse, PortStatusResponse } from './responses';
import { SaleResponse, LoadKeysResponse, TotalsResponse, RefundResponse, DetailsResponse, CloseResponse, PortStatusResponse, IntermediateMessageResponse } from './responses';

export class TransbankPOSWebSocket extends EventEmitter {
isConnected: boolean;
Expand Down Expand Up @@ -47,9 +47,9 @@ export class TransbankPOSWebSocket extends EventEmitter {

getPortStatus(): Promise<PortStatusResponse>;

doSale(amount: number, ticket: string, callback?: (status: any) => void): Promise<SaleResponse>;
doSale(amount: number, ticket: string, callback?: (status: IntermediateMessageResponse) => void): Promise<SaleResponse>;

doMulticodeSale(amount: number, ticket: string, commerceCode?: string, callback?: (status: any) => void): Promise<SaleResponse>;
doMulticodeSale(amount: number, ticket: string, commerceCode?: string, callback?: (status: IntermediateMessageResponse) => void): Promise<SaleResponse>;
}

export const POS: TransbankPOSWebSocket;
Expand Down
1 change: 1 addition & 0 deletions types/responses/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './refundResponse';
export * from './detailsResponse';
export * from './closeResponse';
export * from './portStatusResponse';
export * from './intermediateMessageResponse'
4 changes: 4 additions & 0 deletions types/responses/intermediateMessageResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type IntermediateMessageResponse = {
responseCode: number;
responseMessage: string;
}

0 comments on commit e78fed7

Please sign in to comment.