package com.zbkj.service.huifu.v2;

import java.util.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huifu.bspay.sdk.opps.core.request.V2TradeAcctpaymentPayQueryRequest;
import com.zbkj.service.huifu.core.Identify;

/**
 * 余额支付查询 - 示例
 *
 * @author sdk-generator
 * @Description
 */
@Identify(requestClass = V2TradeAcctpaymentPayQueryRequest.class)
public class V2TradeAcctpaymentPayQuery {

    public static V2TradeAcctpaymentPayQueryRequest method(Map<String, Object> map) {

        // 2.组装请求参数
        V2TradeAcctpaymentPayQueryRequest request = JSONObject.parseObject(JSON.toJSONString(map), V2TradeAcctpaymentPayQueryRequest.class);

        // 商户号
//        request.setHuifuId("6666000018344461");
        // 原交易请求日期
//        request.setOrgReqDate("20211021");

        // 设置非必填字段
        Map<String, Object> extendInfoMap = getExtendInfos(map);
        request.setExtendInfo(extendInfoMap);
        return request;
    }

    /**
     * 非必填字段
     * @return
     */
    private static Map<String, Object> getExtendInfos(Map<String, Object> map) {
        // 设置非必填字段
        Map<String, Object> extendInfoMap = new HashMap<>();
        // 原交易请求流水号
//        extendInfoMap.put("org_req_seq_id", "202110210012100005");
        // 原交易全局流水号
        extendInfoMap.put("org_hf_seq_id", map.get("hfSeqId"));
        return extendInfoMap;
    }

}
