|
|
@ -26,9 +26,7 @@ import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.BufferedOutputStream; |
|
|
|
import java.io.BufferedOutputStream; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.SortedMap; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@Controller |
|
|
|
@RequestMapping(value = "/wechatpay") |
|
|
|
@RequestMapping(value = "/wechatpay") |
|
|
@ -169,13 +167,19 @@ public class WechatPayController { |
|
|
|
wxSharingOrderRequest.setAppid("wx637bd6f7314daa46"); |
|
|
|
wxSharingOrderRequest.setAppid("wx637bd6f7314daa46"); |
|
|
|
wxSharingOrderRequest.setNonce_str(WxUtils.makeNonStr()); |
|
|
|
wxSharingOrderRequest.setNonce_str(WxUtils.makeNonStr()); |
|
|
|
|
|
|
|
|
|
|
|
List<WxSharingReceiversVO> list = new ArrayList<>(); |
|
|
|
/* List<WxSharingReceiversVO> list = new ArrayList<>(); |
|
|
|
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO(); |
|
|
|
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO(); |
|
|
|
receiversVO.setAccount(wxSharingOrderRequest.getSub_mch_id()); |
|
|
|
receiversVO.setAccount(wxSharingOrderRequest.getSub_mch_id()); |
|
|
|
receiversVO.setType("MERCHANT_ID"); |
|
|
|
receiversVO.setType("MERCHANT_ID"); |
|
|
|
receiversVO.setRelation_type("SERVICE_PROVIDER"); |
|
|
|
receiversVO.setRelation_type("SERVICE_PROVIDER"); |
|
|
|
list.add(receiversVO); |
|
|
|
list.add(receiversVO);*/ |
|
|
|
wxSharingOrderRequest.setReceivers(JSONObject.toJSONString(list)); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> receiversVO = new HashMap<>(); |
|
|
|
|
|
|
|
receiversVO.put("type", "MERCHANT_ID"); |
|
|
|
|
|
|
|
receiversVO.put("relation_type", "SERVICE_PROVIDER"); |
|
|
|
|
|
|
|
receiversVO.put("account", wxSharingOrderRequest.getSub_mch_id()); |
|
|
|
|
|
|
|
receiversVO.put("name", "个体户"); |
|
|
|
|
|
|
|
wxSharingOrderRequest.setReceiver(JSONObject.toJSONString(receiversVO)); |
|
|
|
|
|
|
|
|
|
|
|
BeanMap beanMap = BeanMap.create(wxSharingOrderRequest); |
|
|
|
BeanMap beanMap = BeanMap.create(wxSharingOrderRequest); |
|
|
|
wxSharingOrderRequest.setSign(WxUtils.makeSign(beanMap, "SHA256" ,"SHA256")); |
|
|
|
wxSharingOrderRequest.setSign(WxUtils.makeSign(beanMap, "SHA256" ,"SHA256")); |
|
|
|