package com.jeequan.jeepay.thirdparty.channel.ryxpay.model;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 * 瑞银信支付公共参数封装
 * @author crystal
 * @date 2024/2/29 11:53
 */
@Setter
@Getter
public class PayReqEntity {


    /**
     *不知道是啥参数
     */
    private String cooperator;

    /**
     * 加密数据
     */
    private String encryptData;

    /**
     * 加密秘钥
     */
    private String encrtptKey;

    /**
     * 交易类型
     */
    private String tranCode;

    /**
     * 请求唯一表示，代表订单号 长度不能超过12
     */
    private String reqMsgId;

    /**
     * 请求回调地址
     */
    private String callBack;

    /**
     * 签名
     */
    private String signData;


    public Map<String, Object> toMap() {
        Map<String, Object> map = new HashMap<>();
        map.put("encryptData", Collections.singletonList(this.getEncryptData()));
        map.put("encryptKey",Collections.singletonList(this.getEncrtptKey()));
        map.put("cooperator",Collections.singletonList(this.getCooperator()));
        map.put("signData",Collections.singletonList(this.getSignData()));
        map.put("tranCode",Collections.singletonList(this.getTranCode()));
        map.put("callBack",Collections.singletonList(this.getCallBack()));
        map.put("reqMsgId",Collections.singletonList(this.getReqMsgId()));
        return map;
    }
}
