Skip to content

Commit 75d587c

Browse files
committed
Changes made to SDK to fix callback issue in case of file download api.
1 parent 6ad5224 commit 75d587c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

generator/cybersource-javascript-template/ApiClient.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@
512512
var stream = fs.createWriteStream(this.downloadFilePath);
513513
request.send().pipe(stream);
514514
request._endCalled = false;
515+
// to create event for callback after write stream finishes
516+
stream.on('finish',function(error)
517+
{
518+
callback(error);
519+
});
515520
}
516521
}
517522

0 commit comments

Comments
 (0)