Skip to content

Commit 1798503

Browse files
SP-19783 - add TransactionInfo to the top level
1 parent fa41fc4 commit 1798503

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ext/process-response.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,27 @@ export class Response {
3030
status?: Status;
3131
text?: TextExt;
3232
images?: ImagesExt;
33+
TransactionInfo: TransactionInfo;
3334

3435
lowLvlResponse: LowLvlResponse;
3536
rawResponse: ProcessResponse | InlineResponse2001;
3637

3738
constructor(original: ProcessResponse | InlineResponse2001) {
3839
const lowLvlResponse = new LowLvlResponse(original);
40+
const statusResult = lowLvlResponse.statusResult()?.Status;
41+
const textResult = lowLvlResponse.textResult();
42+
const imagesResult = lowLvlResponse.imagesResult();
43+
3944
this.lowLvlResponse = lowLvlResponse;
4045
this.rawResponse = original;
46+
this.TransactionInfo = original.TransactionInfo || {};
4147

42-
this.status = lowLvlResponse.statusResult()?.Status;
43-
const textResult = lowLvlResponse.textResult();
48+
if (statusResult) {
49+
this.status = statusResult;
50+
}
4451
if (textResult) {
4552
this.text = new TextExt(textResult.Text);
4653
}
47-
const imagesResult = lowLvlResponse.imagesResult();
4854
if (imagesResult) {
4955
this.images = new ImagesExt(imagesResult.Images);
5056
}

0 commit comments

Comments
 (0)