Beispiel #1
0
        /// <summary>
        /// 初始化辅助接口的参数
        /// </summary>
        /// <param name="gatewayAuxiliaryType">辅助类型</param>
        /// <param name="auxiliary">辅助参数</param>
        private void InitAuxiliaryParameter(GatewayAuxiliaryType gatewayAuxiliaryType, IAuxiliary auxiliary)
        {
            auxiliary.Validate(gatewayAuxiliaryType);
            switch (gatewayAuxiliaryType)
            {
            case GatewayAuxiliaryType.Query:
                Merchant.Method = Constant.QUERY;
                break;

            case GatewayAuxiliaryType.Close:
                Merchant.Method = Constant.CLOSE;
                break;

            case GatewayAuxiliaryType.Cancel:
                Merchant.Method = Constant.CANCEL;
                break;

            case GatewayAuxiliaryType.Refund:
                Merchant.Method = Constant.REFUND;
                break;

            case GatewayAuxiliaryType.RefundQuery:
                Merchant.Method = Constant.REFUNDQUERY;
                break;

            default:
                break;
            }
            Merchant.BizContent = Util.SerializeObject((Auxiliary)auxiliary);
            GatewayData.Add(Merchant);
            BuildSign();
        }
Beispiel #2
0
 /// <summary>
 /// 初始化辅助参数
 /// </summary>
 /// <param name="gatewayAuxiliaryType">辅助类型</param>
 /// <param name="auxiliary">辅助参数</param>
 private void InitAuxiliaryParameter(GatewayAuxiliaryType gatewayAuxiliaryType, IAuxiliary auxiliary)
 {
     auxiliary.Validate(gatewayAuxiliaryType);
     Merchant.NonceStr = Util.GenerateNonceStr();
     GatewayData.Add(Merchant);
     GatewayData.Add(auxiliary);
     Merchant.Sign = BuildSign();
     GatewayData.Add(Constant.SIGN, Merchant.Sign);
 }