Last month used properly Alipay to obtain monthly bill of Java interfaces, suddenly beginning to return "to the Senate no legal" solution

Last month used properly Alipay to obtain monthly bill interfaces, suddenly returned early solution "to the Senate is not legal".

【Symptom】

Java code to obtain payment of treasure to obtain monthly bill interfaces are as follows:

AlipayClient alipayClient = new DefaultAlipayClient ( "https://openapi.alipay.com/gateway.do ", appid, appPrivateKey, "json", "UTF-8", alipayPublicKey, signType); // initialize obtained AlipayClient 
AlipayDataDataserviceBillDownloadurlQueryRequest Request = new AlipayDataDataserviceBillDownloadurlQueryRequest (); // Create request API classes corresponding 
request.setBizContent ( "{" + 
        "\" bill_type \ ": \" TRADE \ "," + 
        "\" bill_date \ ": \" 2019-05 \ " } "); // set the service parameters 
AlipayDataDataserviceBillDownloadurlQueryResponse response = null; // alipayClient by calling API, to obtain a corresponding response class 
the try { 
    response = alipayClient.execute (Request); 
} the catch (AlipayApiException E) { 
    e.printStackTrace ();
}
System.out.println(response.getBillDownloadUrl());

2019-06-01 May when acquiring the bill, return the following error message:

2019-06-01 07:51:50,698 [main] ERROR [sdk.biz.err] - ErrorScene^_^40004^_^isv.invalid_arguments^_^null^_^Windows 8.1^_^2019-06-01 07:51:50^_^ProtocalMustParams:sign=ISL0oAZbF0RZznh4/xH***=&timestamp=2019-06-01 07:51:48&sign_type=RSA&charset=UTF-8&app_id=2016***&method=alipay.data.dataservice.bill.downloadurl.query&version=1.0^_^ProtocalOptParams:alipay_sdk=alipay-sdk-java-dynamicVersionNo&format=json^_^ApplicationParams:biz_content={ ? ?"bill_type":"trade", ? ?"bill_date":"2019-06"}^_^Body:{"alipay_data_dataservice_bill_downloadurl_query_response":{"code":"40004","msg":"Business Failed","sub_code":"isv.invalid_arguments","sub_msg":"入参不合法"},"sign":"cewSD6P+xWuoxhJsM2XTBlT/***="}

Return results formatted as follows:

{
    "alipay_data_dataservice_bill_downloadurl_query_response": {
        "code": "40004",
        "msg": "Business Failed",
        "sub_code": "isv.invalid_arguments",
        "sub_msg": "入参不合法"
    }

【Solution】

June 1 to solve for a while, suddenly something happens, we put where. When come to solve the June 2 in the morning, suddenly good, to share my experience for everyone.

The reason: the need tian T + 1 bills, if the monthly bill last month, No. 1 query returns "to the Senate illegal";

Solution: a month and then check the bill last month after 2 in the morning, normal.

Guess you like

Origin blog.csdn.net/jlq_diligence/article/details/91350178