<commit_before>package com.huipengpay.demo.web;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMap;
import com.huipengpay.demo.Order;
import com.huipengpay.demo.Repository;
import com.huipengpay.sdk.core.NetworkUtils;
import com.huipengpay.sdk.protocol.PayResponse;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.UUID;

/**
 * 支付请求
 */
@WebServlet(value = "/pay")
public class PayServlet extends BaseServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String orderNumber = UUID.randomUUID().toString();

        Order order = new Order();
        order.setAppId("CA_APP-ID-0001");
        order.setPayInterface(req.getParameter("pay_interface"));
        order.setOrderNumber(orderNumber);
        order.setOrderSubject("java-demo-1分钱支付体验");
        order.setOrderDescribe(req.getParameter("order_describe"));
        order.setAmount(new BigDecimal(req.getParameter("order_amount")));
        order.setCustomerIp(NetworkUtils.getRequestRealIp(req));
        order.setReturnUrl("http://127.0.0.1:8080/callback/return/" + orderNumber);

        LOGGER.warn("商户订单[{}]签名完成,开始使用proxy进行请求输出", orderNumber);
        PayResponse payResponse = getPayService().startPay(order.createPayRequest());
        order.setResponseData(payResponse);
        Repository.save(order);

        resp.setContentType("application/json; charset=UTF-8");
        resp.getWriter().write(JSON.toJSONString(ImmutableMap.of("orderNumber", orderNumber)));
    }
}<commit_msg>WEIXIN_APP 支付<commit_after>package com.huipengpay.demo.web;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMap;
import com.huipengpay.demo.Order;
import com.huipengpay.demo.Repository;
import com.huipengpay.sdk.core.NetworkUtils;
import com.huipengpay.sdk.protocol.PayResponse;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.UUID;

/**
 * 支付请求
 */
@WebServlet(value = "/pay")
public class PayServlet extends BaseServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String orderNumber = UUID.randomUUID().toString();

        Order order = new Order();
        order.setAppId("CA_APP-ID-0001");
        order.setPayInterface(req.getParameter("pay_interface"));
        order.setOrderNumber(orderNumber);
        order.setOrderSubject("java-demo-1分钱支付体验");
        order.setOrderDescribe(req.getParameter("order_describe"));
        order.setAmount(new BigDecimal(req.getParameter("order_amount")));
        order.setCustomerIp(NetworkUtils.getRequestRealIp(req));
        order.setReturnUrl("http://127.0.0.1:8080/callback/return/" + orderNumber);

        LOGGER.warn("商户订单[{}]签名完成,开始使用proxy进行请求输出", orderNumber);
        PayResponse payResponse = getPayService().startPay(order.createPayRequest());
        order.setResponseData(payResponse);
        Repository.save(order);

        resp.setContentType("application/json; charset=UTF-8");
        resp.getWriter().write(JSON.toJSONString(ImmutableMap.of("orderNumber", orderNumber,"extra",payResponse.getExtra())));
    }
}
{'fraction_non_alphanumeric': 0.12552418227565, 'fraction_numerical': 0.008946044171093095, 'mean_word_length': 4.634645669291339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4627484', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1092, 'n_words': 149}