You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.2 KiB
C#

using POSV.ShoppingCart;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace POSV.PayApi
{
public class SaobeiApi
{
public static Tuple<bool, string, Dictionary<string, string>> GetSaobeiParameter(AccountTypeEnum accountType)
{
if (accountType == AccountTypeEnum.)
{
var payMode = OrderUtils.GetPayMode("04");
if (payMode == null)
{
payMode = OrderUtils.GetPayMode("05");
}
if (payMode != null)
{
var parameter = payMode.Body;
string merchant_no = parameter.ContainsKey("merchant_no") ? parameter["merchant_no"].ToString() : "";
string terminal_id = parameter.ContainsKey("terminal_id") ? parameter["terminal_id"].ToString() : "";
string signKey = parameter.ContainsKey("signKey") ? parameter["signKey"].ToString() : "";
string gatewayUrl = parameter.ContainsKey("gatewayUrl") ? parameter["gatewayUrl"].ToString() : "";
if (string.IsNullOrEmpty(merchant_no) || string.IsNullOrEmpty(terminal_id) || string.IsNullOrEmpty(signKey) || string.IsNullOrEmpty(gatewayUrl))
{
return new Tuple<bool, string, Dictionary<string, string>>(false, "扫呗支付参数配置不完整", null);
}
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("merchant_no", merchant_no);
dic.Add("terminal_id", terminal_id);
dic.Add("signKey", signKey);
dic.Add("gatewayUrl", gatewayUrl);
return new Tuple<bool, string, Dictionary<string, string>>(true, "获取成功", dic);
}
else
{
return new Tuple<bool, string, Dictionary<string, string>>(false, "未启用扫码支付", null);
}
}
else
{
return new Tuple<bool, string, Dictionary<string, string>>(false, "暂不支持总部支付参数查询", null);
}
}
}
}