Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeAuthorized Stop transaction #1388

Closed
LydiaBenaida opened this issue Feb 16, 2024 · 2 comments
Closed

DeAuthorized Stop transaction #1388

LydiaBenaida opened this issue Feb 16, 2024 · 2 comments

Comments

@LydiaBenaida
Copy link

Hello everyone,
I'm trying to attribuate a tx profile after the transaction start , but when the charge point takes time to respond to my request , the transaction stopped !!!!

    public StartTransactionResponse startTransaction(StartTransactionRequest parameters, String chargeBoxIdentity) {
        if (chargePointUserRepository.isAssociated(chargeBoxIdentity, parameters.getIdTag())) {
            // Get the authorization info of the user, before making tx changes (will affectAuthorizationStatus)
            IdTagInfo info = ocppTagService.getIdTagInfo(
                    parameters.getIdTag(),
                    true,
                    () -> new IdTagInfo().withStatus(AuthorizationStatus.INVALID), null // IdTagInfo is required
            );

            InsertTransactionParams params =
                    InsertTransactionParams.builder()
                            .chargeBoxId(chargeBoxIdentity)
                            .connectorId(parameters.getConnectorId())
                            .idTag(parameters.getIdTag())
                            .startTimestamp(parameters.getTimestamp())
                            .startMeterValue(Integer.toString(parameters.getMeterStart()))
                            .reservationId(parameters.getReservationId())
                            .eventTimestamp(DateTime.now())
                            .build();

            int transactionId = ocppServerRepository.insertTransaction(params);

            applicationEventPublisher.publishEvent(new OcppTransactionStarted(transactionId, params));
            StartTransactionResponse response = new StartTransactionResponse()
                    .withIdTagInfo(info)
                    .withTransactionId(transactionId);


            // Call startSetProfiles after the transaction has started
            startSetProfiles(chargeBoxIdentity,"Start");

            return response;
        }else {
            // If the association is not present, return an "user not allowed" response
            StartTransactionResponse response = new StartTransactionResponse()
                    .withTransactionId(-1) // Use a special value to indicate an error
                    .withIdTagInfo(new IdTagInfo().withStatus(AuthorizationStatus.INVALID));

            return response;
        }

    }
@lategoodbye
Copy link
Contributor

Hi,
there are several reason why you cannot expect a answer here:

  • you bypassed the bug report form :-(
  • you didn't provide any helpful information
  • you reported a problem here which is caused by a charging station
  • you attached code without providing any context

@goekay
Copy link
Member

goekay commented Feb 18, 2024

in addition to @lategoodbye 's response, this looks like a duplicate of #1376 and therefore, i am closing it.

@goekay goekay closed this as completed Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants