- await this.chargingStation.ocppRequestService.sendStartTransaction(transactionConnectorId, commandPayload.idTag);
- logger.debug(this.chargingStation.logPrefix() + ' Transaction remotely STARTED on ' + this.chargingStation.stationInfo.chargingStationId + '#' + transactionConnectorId.toString() + ' for idTag ' + commandPayload.idTag);
- return await this.setRemoteStartChargingProfile(transactionConnectorId, commandPayload.chargingProfile)
- ? Constants.OCPP_RESPONSE_ACCEPTED
- : await this.notifyRemoteStartTransactionRejected(transactionConnectorId, commandPayload.idTag);
+ if (this.setRemoteStartTransactionChargingProfile(transactionConnectorId, commandPayload.chargingProfile)) {
+ if ((await this.chargingStation.ocppRequestService.sendStartTransaction(transactionConnectorId, commandPayload.idTag)).idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
+ logger.debug(this.chargingStation.logPrefix() + ' Transaction remotely STARTED on ' + this.chargingStation.stationInfo.chargingStationId + '#' + transactionConnectorId.toString() + ' for idTag ' + commandPayload.idTag);
+ return Constants.OCPP_RESPONSE_ACCEPTED;
+ }
+ return await this.notifyRemoteStartTransactionRejected(transactionConnectorId, commandPayload.idTag);
+ }
+ return await this.notifyRemoteStartTransactionRejected(transactionConnectorId, commandPayload.idTag);