[EMSP] Fix callback url of remote stop session.
MODIFY
src/client/ocpi/EmspOCPIClient.ts
src/client/ocpi/EmspOCPIClient.ts
@@ -226,7 +226,7 @@ export default class EmspOCPIClient extends OCPIClient {
// Get sessions endpoint url
let sessionsUrl = this.getEndpointUrl('sessions', ServerAction.OCPI_PULL_SESSIONS);
const momentFrom = moment().utc().subtract(2, 'days').startOf('day');
- sessionsUrl = `${sessionsUrl}?date_from=${momentFrom.format()}&limit=20`;
+ sessionsUrl = `${sessionsUrl}?date_from=${momentFrom.format()}&limit=10`;
let nextResult = true;
while (nextResult) {
// Log
@@ -296,7 +296,7 @@ export default class EmspOCPIClient extends OCPIClient {
// Get cdrs endpoint url
let cdrsUrl = this.getEndpointUrl('cdrs', ServerAction.OCPI_PULL_CDRS);
const momentFrom = moment().utc().subtract(2, 'days').startOf('day');
- cdrsUrl = `${cdrsUrl}?date_from=${momentFrom.format()}&limit=20`;
+ cdrsUrl = `${cdrsUrl}?date_from=${momentFrom.format()}&limit=10`;
let nextResult = true;
while (nextResult) {
// Log
@@ -635,6 +635,7 @@ export default class EmspOCPIClient extends OCPIClient {
async remoteStopSession(transactionId: number): Promise<OCPICommandResponse> {
// Get command endpoint url
const commandUrl = this.getEndpointUrl('commands', ServerAction.OCPI_START_SESSION) + '/' + OCPICommandType.STOP_SESSION;
+ const callbackUrl = this.getLocalEndpointUrl('commands') + '/' + OCPICommandType.STOP_SESSION;
const transaction = await TransactionStorage.getTransaction(this.tenant.id, transactionId);
if (!transaction || !transaction.ocpiData || !transaction.ocpiData.session || transaction.issuer) {
throw new BackendError({
@@ -646,7 +647,7 @@ export default class EmspOCPIClient extends OCPIClient {
}
const payload: OCPIStopSession = {
// eslint-disable-next-line @typescript-eslint/camelcase
- response_url: commandUrl + '/' + uuid(),
+ response_url: callbackUrl + '/' + transaction.ocpiData.session.id,
// eslint-disable-next-line @typescript-eslint/camelcase
session_id: transaction.ocpiData.session.id
};

[EMSP] Fix callback url of remote stop session.