【问题标题】:How to return to the main page after making a payment on PayBox, with VAADIN?使用 VAADIN 在 PayBox 上付款后如何返回主页?
【发布时间】:2018-11-05 14:30:18
【问题描述】:

我想在付款后返回我的主页。 我的 url 中有一个返回参数为零,直到我去支付网站并且我没有验证我的支付。 付款后,因此返回非零参数(例如:http://localhost:8080/app0/#!retour?retour=APP:337:2:/QSYS.LIB/CMT31.LIB/PAMWTRCL8.PGM&mt=3000&code=00000&key=krE0CVCuH%2FQ1fw2iOEIt6xYVqdmcUjiUNg2n9oSHcL2UkaE7N5WyzargWQS85u7IKNH6m38zuN3qXcx42KqEfXIiem1MHyfdQdamqzKfCP25Jwze7PPhGBjXSzO4JkKi2Pp2w573XKAwBFMkuaLcBeFb3Uq1qvWyRumYdk89Sro%3D), 我想回到我的主页。 我的问题是这个参数不为零,所以我不能回到主页。我的解决方案是使用片段,但我不知道该怎么做。你能帮帮我吗?

protected void init(VaadinRequest vaadinRequest) {
    String retour=(String) vaadinRequest.getParameter("retour");
    if(retour!=null) {
        String mt=(String) vaadinRequest.getParameter("mt");
        String code=(String) vaadinRequest.getParameter("code");
        String key=(String) vaadinRequest.getParameter("key");
        traiteRetourPaiement(retour, mt, code, key);
    } else {
        String nomApp = getNomApp(vaadinRequest);
        setContent(new DynamicView(nomApp));
    }
}

【问题讨论】:

    标签: vaadin


    【解决方案1】:

    在您的示例中,参数位于 URI 的片段部分中,即在 # 字符之后。这部分 URI 可通过 getPage().getLocation().getFragment() 获得,但只能作为一个长字符串,而不是拆分为单独的参数。

    或者,您可以更改 PayBox 返回 URI 的创建方式,以便那里没有任何 # 字符。在这种情况下,这些值将以您的示例代码尝试访问它们的方式作为常规请求参数提供。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-14
      • 2021-05-30
      • 2016-11-16
      • 2014-07-11
      • 2010-12-03
      • 1970-01-01
      • 2013-07-31
      • 1970-01-01
      相关资源
      最近更新 更多