Build OCPI Token with the method
MODIFY
src/server/ocpi/service/emsp/v2.1.1/EMSPCommandsService.ts
src/server/ocpi/service/emsp/v2.1.1/EMSPCommandsService.ts
@@ -42,7 +42,7 @@ export default class EMSPCommandsService {
await Logging.logError({
tenantID: tenant.id,
action: EMSPCommandsService.getAction(command),
- message: `OCPI Response '${req.body?.result as string}' received for '${command}' with ID '${commandId}'`,
+ message: `OCPI Callback '${req.body?.result as string}' received for Command '${command}' with ID '${commandId}'`,
module: MODULE_NAME, method: 'process',
detailedMessages: { response: req.body }
});
@@ -50,7 +50,7 @@ export default class EMSPCommandsService {
await Logging.logInfo({
tenantID: tenant.id,
action: EMSPCommandsService.getAction(command),
- message: `OCPI Response '${req.body?.result as string}' received for '${command}' with ID '${commandId}'`,
+ message: `OCPI Callback '${req.body?.result as string}' received for Command '${command}' with ID '${commandId}'`,
module: MODULE_NAME, method: 'process',
detailedMessages: { response: req.body }
});

MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -891,16 +891,9 @@ export default class TagService {
const ocpiClient: EmspOCPIClient = await OCPIClientFactory.getAvailableOcpiClient(
tenant, OCPIRole.EMSP) as EmspOCPIClient;
if (ocpiClient) {
- await ocpiClient.pushToken({
- uid: tag.id,
- type: OCPIUtils.getOcpiTokenTypeFromID(tag.id),
- auth_id: tag.userID,
- visual_number: tag.visualID,
- issuer: tenant.name,
- valid: true,
- whitelist: OCPITokenWhitelist.ALLOWED_OFFLINE,
- last_updated: new Date()
- });
+ await ocpiClient.pushToken(
+ OCPIUtils.buildEmspTokenFromTag(tenant, tag)
+ );
}
} catch (error) {
await Logging.logError({

Build OCPI Token with the method