/**
* 新建模板
* appauthtoken如服务商代替商家调用接口,需将商户授权后获取的app_auth_token带上;如商家自己调用,则传null。
* bizcontent 因该接口业务参数复杂,请查看接口文档
*/
alipayclient alipayclient = new defaultalipayclient("https://openapi.alipay.com/gateway.do", app_id, app_private_key, "json", charset, alipay_public_key, "rsa2");
alipaypasstemplateaddrequest request = new alipaypasstemplateaddrequest();
request.putothertextparam("app_auth_token", appauthtoken); request.setbizcontent(bizcontent);
alipaypasstemplateaddresponse response=alipayclient.execute(request);
system.out.print(response.getbody());
//根据业务处理response