错误代码:Java和2CO中的PE104

时间:2016-09-19 11:55:43

标签: java 2checkout

我想与2CO支付网关实施快速结账链接;测试了以下代码:

public void testExpressCheckoutF()
    {
        Twocheckout.apiusername = "sonoratestw";
        Twocheckout.apipassword = "sonorasonora";
        Twocheckout.privatekey = "81DBF3R3-04B3-47DB-8068-ED3DAB20BC5A";
        Twocheckout.mode = "sandbox";

        HashMap<String, String> params = new HashMap<>();
        params.put("sid", "901328163");
        params.put("mode", "sandbox");
        params.put("currency_code", "USD");
        params.put("x_receipt_link_url", "http://www.test.com/summary_twocheckoutl_payment.xhtml");
        params.put("comment", "some description");


        params.put("li_0_product_id", "assdsdcas");
        params.put("li_0_type", "product");
        params.put("li_0_name", "test name");
        params.put("li_0_quantity", String.valueOf(1));
        params.put("li_0_price", String.valueOf(33));
        params.put("li_0_description", "some description");

        String expressCheckout = TwocheckoutCharge.url(params);

        System.out.println("\n " + expressCheckout);
    }

但是当我运行代码时,我总是得到ERROR CODE:PE104。我发现这篇文章是一个可能的解决方案http://help.2checkout.com/articles/Knowledge_Article/Error-Code-PE104/?l=en_US&fs=RelatedArticle

但仍然得到同样的错误。你能提出一些解决方案吗?

1 个答案:

答案 0 :(得分:0)

请尝试删除li_0_product_id参数并重试或将值更改为整数而不是字符串。您链接到的文章为您提供了一般要开始的区域(没有lineitems,无效的product_id等等),因此这只是消除过程。