package cn.pluss.platform.entity;

import cn.pluss.platform.util.RyxConfig;
import lombok.Data;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 瑞银信商户交易请求实体封装
 */
@Data
public class RyxPayRequest {

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

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

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

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

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

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

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


    public MultiValueMap<String, Object> toMap() {
        MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
        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;
    }
}
