@test
public void buildbytemplate() {
map<string, object> extfields = new hashmap<string, object>();
extfields.put("extenable", true);
map<string, string> ext = new hashmap<string, string>();
ext.put("shopid", "2019xxxxxx019291");
ext.put("userslogan", "这是商家自定义的标语");
extfields.put("ext", ext);
alipayopenminiversionuploadrequest request = new alipayopenminiversionuploadrequest();
map<string, string> content = new hashmap<string, string>();
content.put("ext", jsonobject.tojsonstring(extfields));
content.put("template_id", "2019xxxxxx217771");
content.put("app_version", "0.0.3");
request.setbizcontent(jsonobject.tojsonstring(content));
request.putothertextparam("app_auth_token", app_auth_token);
try {
alipayopenminiversionuploadresponse response = alipayclient.execute(request);
printresponse(response);
} catch (alipayapiexception e) {
e.printstacktrace();
}
}