| | |
| | | package com.panzhihua.applets.unionpay; |
| | | |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.binary.Base64; |
| | |
| | | @Slf4j |
| | | @Component |
| | | public class UnifiedOrder { |
| | | |
| | | |
| | | // static String url = "https://test-api-open.chinaums.com/v1/netpay/wx/unified-order"; |
| | | static String url = "https://api-mop.chinaums.com/v1/netpay/wx/unified-order"; |
| | | |
| | | public static String sendOrder(String totalAmount,String orderDesc,String productId,String OpenId) |
| | | public static String sendOrder(String totalAmount,String orderDesc,String productId,String OpenId,LocalDateTime time,String merOrderId) |
| | | { |
| | | //1. 组建请求报文 |
| | | LocalDateTime time=DateUtils.getCurrentDate(); |
| | | UnifiedOrderBody reqBody = new UnifiedOrderBody(); |
| | | reqBody.requestTimestamp = time.format(DateUtils.format_ymdhms);// "2019-08-09 17:30:55"; |
| | | reqBody.merOrderId = UnionpayContent.TOP4+time.format(DateUtils.format_ymdhms_yyyyMMddmmHHssSSS)+makeUUID(7); |
| | | reqBody.merOrderId = merOrderId; |
| | | reqBody.mid = UnionpayContent.MID; |
| | | reqBody.tid = UnionpayContent.TID; |
| | | reqBody.instMid = UnionpayContent.INSTMID; |
| | |
| | | reqBody.secureTransaction = "false"; |
| | | reqBody.orderDesc = orderDesc; |
| | | reqBody.productId = productId; |
| | | reqBody.notifyUrl = "https://huacheng.psciio.com/api/huacheng-applets/wx/wxNotifyAllUnionpay"; |
| | | reqBody.notifyUrl = "https://huacheng.psciio.com/api/huacheng-applets/wx/wxNotifyAllUnionpay?merOrderId="+reqBody.merOrderId; |
| | | reqBody.tradeType = "MINI"; |
| | | reqBody.subOpenId = OpenId; |
| | | |