public UnifiedOrderResponse unifiedOrder(UnifiedOrderRequest unifiedOrderRequest) {
        UnifiedOrderRequestWrapper wrapper = new UnifiedOrderRequestWrapper();
        wrapper.setRequest(unifiedOrderRequest);
        setBaseSettings(wrapper);
        SortedMap<String, Object> unifiedOrderRequestMap = JsonMapper.nonEmptyMapper().getMapper().convertValue(wrapper, SortedMap.class);
        sign(wrapper, unifiedOrderRequestMap);

        String url = WxEndpoint.get("url.pay.payment.order.unified");
        try {
            String xml = XmlObjectMapper.nonEmptyMapper().toXml(wrapper);
            logger.info("支付 unified order request: {}", xml);
            String response = wxSslClient.post(url, xml);
            logger.info("支付 unified order response: {}", response);

            UnifiedOrderResponseWrapper responseWrapper = XmlObjectMapper.defaultMapper().fromXml(response, UnifiedOrderResponseWrapper.class);
            return responseWrapper.getResponse();
        } catch (Exception e) {
            throw new WxRuntimeException(999, "pre order failed:" + e.getMessage());
        }

    }
public UnifiedOrderResponse unifiedOrder ( UnifiedOrderRequest unifiedOrderRequest ) { UnifiedOrderRequestWrapper wrapper = new UnifiedOrderRequestWrapper ( ) ; wrapper . setRequest ( unifiedOrderRequest ) ; setBaseSettings ( wrapper ) ; SortedMap < String , Object > unifiedOrderRequestMap = JsonMapper . nonEmptyMapper ( ) . getMapper ( ) . convertValue ( wrapper , SortedMap . class ) ; sign ( wrapper , unifiedOrderRequestMap ) ; String url = WxEndpoint . get ( "url.pay.payment.order.unified" ) ; try { String xml = XmlObjectMapper . nonEmptyMapper ( ) . toXml ( wrapper ) ; logger . info ( "支付 unified order request: {}" , xml ) ; String response = wxSslClient . post ( url , xml ) ; logger . info ( "支付 unified order response: {}" , response ) ; UnifiedOrderResponseWrapper responseWrapper = XmlObjectMapper . defaultMapper ( ) . fromXml ( response , UnifiedOrderResponseWrapper . class ) ; return responseWrapper . getResponse ( ) ; } catch ( Exception e ) { throw new WxRuntimeException ( 999 , "pre order failed:" + e . getMessage ( ) ) ; } }
统一下单

@param unifiedOrderRequest
@return