| @@ -156,6 +156,15 @@ public class AlipayController extends BaseController { | |||||
| } | } | ||||
| try { | try { | ||||
| //不能超过10位 | |||||
| String carName = wxMall.getName(); | |||||
| if (carName.length()>7) { | |||||
| if (carName.length()>10) { | |||||
| carName = carName.substring(0, 10); | |||||
| } | |||||
| }else { | |||||
| carName = carName +"会员卡"; | |||||
| } | |||||
| String templateId = aliPayUtil.createSmartDistrictMemberCardModel(wxMall.getAlipayAppAuthToken(), wxMall.getName()+"会员卡", logoId, backgroundId); | String templateId = aliPayUtil.createSmartDistrictMemberCardModel(wxMall.getAlipayAppAuthToken(), wxMall.getName()+"会员卡", logoId, backgroundId); | ||||
| if (StringUtils.isBlank(templateId)) { | if (StringUtils.isBlank(templateId)) { | ||||
| return new ResultData(Result.ERROR,"模板创建失败,模板Id返回空[createSmartDistrictMemberCardModel]"); | return new ResultData(Result.ERROR,"模板创建失败,模板Id返回空[createSmartDistrictMemberCardModel]"); | ||||
| @@ -294,7 +294,7 @@ public class AliPayUtil { | |||||
| //商圈消息订阅 | //商圈消息订阅 | ||||
| public boolean smartDistrictTopicSubscribe(String appAuthToken) { | public boolean smartDistrictTopicSubscribe(String appAuthToken) { | ||||
| try { | try { | ||||
| AlipayOpenApiGenericResponse response = AliPayApi.topicSubscribe(getConfig(),appAuthToken, "app_auth", "alipay.open.auth.appauth.cancelled", "HTTP", "BIZ_TAG"); | |||||
| AlipayOpenApiGenericResponse response = AliPayApi.topicSubscribe(getConfig(),appAuthToken,appAuthToken, "app_auth", "alipay.open.auth.appauth.cancelled", "HTTP", "BIZ_TAG"); | |||||
| JSONObject result = getGenericResponse(response.getHttpBody(),"alipay_open_app_message_topic_subscribe_response"); | JSONObject result = getGenericResponse(response.getHttpBody(),"alipay_open_app_message_topic_subscribe_response"); | ||||
| if (null != result) { | if (null != result) { | ||||
| return true; | return true; | ||||
| @@ -295,7 +295,7 @@ public class AliPayApi { | |||||
| * @return | * @return | ||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| public static AlipayOpenApiGenericResponse topicSubscribe(Config config,String appAuthToken,String authType,String topic,String type,String tag) throws Exception { | |||||
| public static AlipayOpenApiGenericResponse topicSubscribe(Config config,String appAuthToken,String authToken,String authType,String topic,String type,String tag) throws Exception { | |||||
| Factory.setOptions(config); | Factory.setOptions(config); | ||||
| //设置系统参数(OpenAPI中非biz_content里的参数) | //设置系统参数(OpenAPI中非biz_content里的参数) | ||||
| Map<String, String> textParams = new HashMap<String, String>(); | Map<String, String> textParams = new HashMap<String, String>(); | ||||
| @@ -303,7 +303,7 @@ public class AliPayApi { | |||||
| //设置业务参数(OpenAPI中biz_content里的参数) | //设置业务参数(OpenAPI中biz_content里的参数) | ||||
| Map<String, Object> bizParams = new HashMap<String, Object>(); | Map<String, Object> bizParams = new HashMap<String, Object>(); | ||||
| bizParams.put("auth_token", appAuthToken); | |||||
| bizParams.put("auth_token", authToken); | |||||
| bizParams.put("auth_type", authType); | bizParams.put("auth_type", authType); | ||||
| bizParams.put("topic", topic); | bizParams.put("topic", topic); | ||||
| bizParams.put("comm_type", type); | bizParams.put("comm_type", type); | ||||