package cz.moneta.test.dsl.dmbsib;

import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.dmbsib.DmbsIbEndpoint;
import cz.moneta.test.harness.support.web.CustomAction;
import cz.moneta.test.harness.support.web.Page;
import cz.moneta.test.harness.support.web.WebFlow;

public interface DmbsIbWebTransitions extends WebFlow<DmbsIbWebTransitions>, StoreAccessor {
    String CONFIRM_PAYMENT_ORDER_GENERAL_PATH = "oauth2/#/payment?payment_id={transactionIdentification}&return_url=http%3A%2F%2Fdmbs.internetbanka.cz";

    @CustomAction
    @Page(LoginPage.class)
    default LoginPage openLoginPage(String transactionIdentification) {
        DmbsIbEndpoint endpoint = getEndpoint(DmbsIbEndpoint.class);
        endpoint.changePath(CONFIRM_PAYMENT_ORDER_GENERAL_PATH.replace("{transactionIdentification}", transactionIdentification));
        return null;
    }
}