class PaymentAspectService extends BaseAspectService<PaymentController> {

    public ResponseObject<PaymentInitiationResponse> createPaymentAspect(ResponseObject<PaymentInitiationResponse> result, PaymentInitiationParameters requestParameters) {
        if (!result.hasError()) {
            PaymentInitiationResponse body = result.getBody();
            boolean explicitPreferred = requestParameters.isTppExplicitAuthorisationPreferred();
            boolean explicitMethod = authorisationMethodDecider.isExplicitMethod(explicitPreferred, body.isMultilevelScaRequired());
            boolean signingBasketModeActive = authorisationMethodDecider.isSigningBasketModeActive(explicitPreferred);

            body.setLinks(new PaymentInitiationLinks(getHttpUrl(), scaApproachResolver, redirectLinkBuilder,
                                                     redirectIdService,
                                                     requestParameters, body, explicitMethod, signingBasketModeActive, getScaRedirectFlow(),
                                                     isAuthorisationConfirmationRequestMandated(), requestProviderService.getInstanceId()));
        }
        return result;
    }

    @Autowired public  PaymentAspectService(ScaApproachResolver scaApproachResolver,
                                AuthorisationMethodDecider authorisationMethodDecider, RedirectLinkBuilder redirectLinkBuilder,
                                AspspProfileServiceWrapper aspspProfileServiceWrapper, RedirectIdService redirectIdService,
                                RequestProviderService requestProviderService);

}