private void ChangeType(GatewayType type) { PropertyChangedAction action = new PropertyChangedAction(this, Type, type, nameof(Type)); NotifyActionPerformed(action); Type = type; }
public Merchant(string userName, string key, Uri notifyUrl, GatewayType gatewayType) { this.userName = userName; this.key = key; this.notifyUrl = notifyUrl; GatewayType = gatewayType; }
public Merchant(string userName, string key, Uri notifyUrl, GatewayType gatewayType) { this.userName = userName; this.key = key; this.notifyUrl = notifyUrl; GatewayType = gatewayType; }
public MCHelper(GatewayType bridge, Gateway proxy, Gateway source, ApiUtilLib.HttpMethod httpMethod) { this._bridge = bridge; this._proxy = proxy; this._source = source; this._httpMethod = httpMethod; }
private GatewayBase CreateGateway(GatewayType gatewayType) { switch (gatewayType) { case GatewayType.Alipay: { return(new AlipayGateway()); } case GatewayType.WeChatPay: { return(new WeChatPayGataway()); } case GatewayType.Tenpay: { return(new TenpayGateway()); } case GatewayType.Yeepay: { return(new YeepayGateway()); } default: { return(new NullGateway()); } } }
/// <summary> /// Return IRemoteObject /// </summary> public static IRemoteObject GetSender(GatewayType gatewayType) { return(GetSender(gatewayType.ToString())); //return new GameObject("WWWObject_" + _objectscount++).AddComponent<WwwObject>(); /*switch (gatewayType) * { * /*case GatewayType.File: * return new GameObject("FileObject_" + _objectscount++).AddComponent<FileObject>();*/ /*case GatewayType.Socket: * if (_socket == null) * _socket = new SocketObject(IpAddress, port); * iRemoteObject = _socket; * break;*/ /*case GatewayType.Web: * iRemoteObject = new WebObject(); * break;*/ /*default: * return new GameObject("WWWObject_" + _objectscount++).AddComponent<WwwObject>(); * /*if (!string.IsNullOrEmpty(AppName)) * wwwObject.AddField(AppParameter, AppName);*/ /*if (!string.IsNullOrEmpty(Key)) * wwwObject.AddCookie(KeyName, Key);*/ /*wwwObject.key = _irokey++; * RemoteObjects.Add(wwwObject.key, wwwObject);*/ //} }
public Merchant(string userName, string key, Uri notifyUrl, GatewayType gatewayType) { UserName = userName; Key = key; NotifyUrl = notifyUrl; GatewayType = gatewayType; }
private static void Init(GatewayType gatewayType) { _defaultGateway = gatewayType; /*if (_defaultGateway == GatewayType.Web) * cookie = new CookieContainer();*/ }
private GatewayBase CreateGateway(GatewayType gatewayType) { switch (gatewayType) { case GatewayType.Alipay: { return(new AlipayGateway()); } case GatewayType.WeChatPayment: { return(new WeChatPaymentGataway()); } case GatewayType.UnionPay: { return(new UnionPayGateway()); } default: { return(new NullGateway()); } } }
/// <summary> /// 通过网关类型,交易类型获取网关 /// </summary> /// <param name="gatewayType">网关类型</param> /// <param name="gatewayTradeType">网关交易类型</param> /// <returns></returns> public GatewayBase Get(GatewayType gatewayType, GatewayTradeType gatewayTradeType) { var gatewayBase = list.FirstOrDefault(a => a.GatewayType == gatewayType); gatewayBase.GatewayTradeType = gatewayTradeType; return(gatewayBase); }
/// <summary> /// 删除商户数据 /// </summary> /// <param name="gatewayType">网关类型</param> public void RemoveMerchant(GatewayType gatewayType) { Merchant removeMerchant = merchantList.FirstOrDefault(m => m.GatewayType == gatewayType); if (removeMerchant != null) { merchantList.Remove(removeMerchant); } }
public void CreateRefund(GatewayType gatewayType) { var gateway = gateways.Get(gatewayType); var paymentSetting = new PaymentSetting(gateway); var refund = new Refund(); refund.OutRefundNo = "000000000000000"; paymentSetting.BuildRefund(refund); paymentSetting.BuildRefundQuery(refund); }
/// <summary> /// 通过网关类型获取网关 /// </summary> /// <param name="gatewayType">网关类型</param> /// <returns></returns> public GatewayBase Get(GatewayType gatewayType) { var gatewayList = _list .Where(a => a.GatewayType == gatewayType) .ToList(); var gateway = gatewayList.Count > 0 ? gatewayList[0] : throw new GatewayException("找不到指定网关"); return(gateway); }
public GatewayGetOperationStatusResponse CreateGateway(string vnetName, GatewayType gatewayType, GatewaySKU gatewaySKU) { GatewayCreateParameters parameters = new GatewayCreateParameters() { GatewayType = gatewayType, GatewaySKU = gatewaySKU, }; return(client.Gateways.Create(vnetName, parameters)); }
public GatewayTypeFormalizer(GatewayType gatewayType) { this.id = gatewayType.Id; this.gatewayTypeName = gatewayType.GatewayTypeName; this.remark = gatewayType.Remark; this.createTime = gatewayType.CreateTime .ToString(ConstantService.DateTimeFormat); this.updateTime = gatewayType.UpdateTime .ToString(ConstantService.DateTimeFormat); }
/// <summary> /// /// </summary> public static void Init(string host, string path, string gateFile, GatewayType type) { Host = host; Path = path; File = gateFile; //cookie = new CookieContainer(); //cookie.Add(new Cookie(SessionName, SessionId, "/", WebUrl)); //Init(Application.isWebPlayer ? GatewayType.Www : GatewayType.Web); Init(type); }
public async Task <Core.Entities.Transaction> GetByGatewayIdAsync(GatewayType gatewayType, string gatewayId) { using (var scope = ServiceScopeFactory.CreateScope()) { var dbContext = GetDatabaseContext(scope); var results = await dbContext.Transactions .FirstOrDefaultAsync(t => (t.GatewayId == gatewayId && t.Gateway == gatewayType)); return(Mapper.Map <Core.Entities.Transaction>(results)); } }
/// <summary> /// 通过网关类型,交易类型获取网关 /// </summary> /// <param name="gatewayType">网关类型</param> /// <param name="gatewayTradeType">交易类型</param> /// <returns></returns> public GatewayBase Get(GatewayType gatewayType, GatewayTradeType gatewayTradeType) { var gatewayList = _list .Where(a => a.GatewayType == gatewayType && a.GatewayTradeType == gatewayTradeType) .ToList(); var gateway = gatewayList.Count > 0 ? gatewayList[0] : Get(gatewayType); gateway.GatewayTradeType = gatewayTradeType; return(gateway); }
public async Task <Transaction> GetByGatewayIdAsync(GatewayType gatewayType, string gatewayId) { using (var connection = new SqlConnection(ConnectionString)) { var results = await connection.QueryAsync <Transaction>( $"[{Schema}].[Transaction_ReadByGatewayId]", new { Gateway = gatewayType, GatewayId = gatewayId }, commandType : CommandType.StoredProcedure); return(results.SingleOrDefault()); } }
public Gateway(System.Collections.Specialized.NameValueCollection _settings, GatewayType type, string auth, string signingUrlPath, string targetUrlPath) { this._type = type; this._auth = auth; this._signingUrlPath = signingUrlPath; this._targetUrlPath = targetUrlPath; this._appId = (_type == GatewayType.PROXY ? _settings["proxy.app_id"] : _settings["source.app_id"]) ?? "Not found"; this._appSecret = (_type == GatewayType.PROXY ? _settings["proxy.app_secret"] : _settings["source.app_secret"]) ?? "Not found"; this._certFileName = (_type == GatewayType.PROXY ? _settings["proxy.cert_file_name"] : _settings["source.cert_file_name"]) ?? "Not found"; this._certPassPhrase = (_type == GatewayType.PROXY ? _settings["proxy.cert_pass_phrase"] : _settings["source.cert_pass_phrase"]) ?? "Not found"; this._realm = _settings["realm"] ?? "Not found"; }
/// <summary> /// Start logout.You can set additional info for send to server. You can set gateway /// </summary> /// <param name="userId"></param> /// <param name="data"></param> /// <param name="gateway"></param> public static void Logout(int userId, Dictionary <string, object> data, GatewayType gateway) { SendedRequest = true; var ht = new Hashtable { { KeyId, userId }, { KeyData, data } }; if (_www == null) { _www = Gateway.GetSender(gateway); } _www.Call(ServerClass, LogoutMethod, ht, OnOut); }
// GET: QueryPayment public void QueryOrder(GatewayType gatewayType) { var gateway = gateways.Get(gatewayType); var querySetting = new PaymentSetting(gateway); // 查询时需要设置订单的Id与金额,在查询结果中将会核对订单的Id与金额,如果不相符会返回查询失败。 querySetting.Order.OrderNo = "20"; querySetting.Order.OrderAmount = 0.01; if (querySetting.QueryNow()) { // 订单已支付 } }
public void CreateOrder(GatewayType gatewayType) { var gateway = gateways.Get(gatewayType, GatewayTradeType.Wap); var paymentSetting = new PaymentSetting(gateway); paymentSetting.Order = new Order() { OrderAmount = 0.01, OrderNo = DateTime.Now.ToString("yyyyMMddhhmmss"), Subject = "WapPayment", PaymentDate = DateTime.Now }; paymentSetting.Payment(); }
public JsonResult CreateOrder(GatewayType gatewayType) { var gateway = gateways.Get(gatewayType, GatewayTradeType.APP); var paymentSetting = new PaymentSetting(gateway); paymentSetting.Order = new Order() { OrderAmount = 0.01, OrderNo = DateTime.Now.ToString("yyyyMMddhhmmss"), Subject = "AppPayment", PaymentDate = DateTime.Now }; return(Json(paymentSetting.Payment())); }
/// <summary> /// Start login/captcha verification. You can send additional parameters and gateway. /// </summary> /// <param name="login"></param> /// <param name="password"></param> /// <param name="captcha"></param> /// <param name="data"></param> /// <param name="gateway"></param> public static void Login(string login, string password, string captcha, Dictionary <string, object> data, GatewayType gateway) { SendedRequest = true; var ht = new Hashtable { { KeyLogin, login }, { KeyPassword, password }, { KeyCaptcha, captcha }, { KeyData, data } }; if (_www == null) { _www = Gateway.GetSender(gateway); } _www.Call(ServerClass, LoginMethod, ht, OnLog); }
/// <summary> /// Initializes a new instance of the <see cref="Gateway"/> class /// </summary> /// <param name="type">See <see cref="Type"/></param> /// <param name="id">See <see cref="Id"/></param> /// <param name="removeCountryCode">See <see cref="RemoveCountryCode"/></param> /// <param name="numberModificationGroup">See <see cref="NumberModificationGroup"/> Id</param> /// <param name="concurrentLinesLimit">See <see cref="ConcurrentLinesLimit"/></param> /// <param name="prefix">See <see cref="Prefix"/></param> /// <param name="format">See <see cref="Format"/></param> /// <param name="formats">See <see cref="Formats"/></param> /// <param name="outgoingConnectionId">See <see cref="OutgoingConnectionId"/></param> /// <param name="qosGroupId">See <see cref="QoSGroupId"/></param> /// <param name="companyId">See <see cref="CompanyId"/></param> internal Gateway(GatewayType type, int id, bool removeCountryCode, int?numberModificationGroup, int?concurrentLinesLimit, string prefix, string format, string formats, string outgoingConnectionId, int qosGroupId, int companyId) { this.Type = type; this.IdAsString = id.ToString(Engine.Formats.CultureInfo); this.Id = id; this.RemoveCountryCode = removeCountryCode; this.NumberModificationGroup = numberModificationGroup; this.ConcurrentLinesLimit = concurrentLinesLimit; this.Prefix = prefix; this.Format = format; this.Formats = formats; this.OutgoingConnectionId = outgoingConnectionId; this.QoSGroupId = qosGroupId; this.CompanyId = companyId; }
public void CreateOrder(GatewayType gatewayType) { PaymentSetting paymentSetting = new PaymentSetting(gatewayType); paymentSetting.Merchant.AppId = "appid000000000000000"; paymentSetting.Merchant.Email = "*****@*****.**"; paymentSetting.Merchant.Partner = "000000000000000"; paymentSetting.Merchant.Key = "000000000000000000000000000000000000000000"; paymentSetting.Merchant.NotifyUrl = new Uri("http://yourwebsite.com/Notify.aspx"); paymentSetting.Merchant.ReturnUrl = new Uri("http://yourwebsite.com/Return.aspx"); paymentSetting.Order.OrderAmount = 0.01; paymentSetting.Order.OrderNo = "35"; paymentSetting.Order.Subject = "WebPayment"; paymentSetting.Payment(); }
/// <summary> /// 创建二维码订单 /// </summary> /// <param name="gatewayType">支付网关类型</param> public void CreateOrder(GatewayType gatewayType) { //通过网关类型,交易类型获取网关 var gateway = gateways.Get(gatewayType, GatewayTradeType.QRCode); //设置需要支付的订单的数据,创建支付订单URL地址或HTML表单 var paymentSetting = new PaymentSetting(gateway); paymentSetting.Order = new Order() { OrderAmount = 0.01, //订单总金额 OrderNo = DateTime.Now.ToString("yyyyMMddhhmmss"), //订单编号 Subject = "QRCodePayment", //订单主题 PaymentDate = DateTime.Now //订单支付时间 }; paymentSetting.Payment(); }
public JsonResult CreateOrder(GatewayType gatewayType) { PaymentSetting paymentSetting = new PaymentSetting(gatewayType); paymentSetting.Merchant.AppId = "appid000000000000000"; paymentSetting.Merchant.Email = "*****@*****.**"; paymentSetting.Merchant.Partner = "000000000000000"; paymentSetting.Merchant.Key = "000000000000000000000000000000000000000000"; paymentSetting.Merchant.PrivateKeyPem = "yourrsa_private_key.pem"; paymentSetting.Merchant.PublicKeyPem = "yourrsa_public_key.pem"; paymentSetting.Merchant.NotifyUrl = new Uri("http://yourwebsite.com/Notify.aspx"); paymentSetting.Order.OrderAmount = 0.01; paymentSetting.Order.OrderNo = "35"; paymentSetting.Order.Subject = "AppPayment"; return(Json(paymentSetting.BuildPayParams())); }
public static GatewayType ChainableType(GatewayType type) { switch (type) { case GatewayType.North: return(GatewayType.South); case GatewayType.South: return(GatewayType.North); case GatewayType.East: return(GatewayType.West); default: return(GatewayType.East); } }
/// <summary> /// サブステージを配置するオフセット値を取得する /// </summary> /// <param name="type"></param> /// <returns></returns> private Vector3 SubStageOffset(GatewayType type) { switch (type) { case GatewayType.North: return(new Vector3(0, 0, SubStageUnit)); case GatewayType.South: return(new Vector3(0, 0, -SubStageUnit)); case GatewayType.East: return(new Vector3(SubStageUnit, 0, 0)); default: return(new Vector3(-SubStageUnit, 0, 0)); } }
/// <summary> /// ɾ���̻����� /// </summary> /// <param name="gatewayType">��������</param> public void RemoveMerchant(GatewayType gatewayType) { Merchant removeMerchant = merchantList.FirstOrDefault(m => m.GatewayType == gatewayType); if (removeMerchant != null) { merchantList.Remove(removeMerchant); } }
/// <summary> /// ����̻����ݡ����ش��ڶ���̻�����ʱ���ص�һ�������ҵ�����null /// </summary> /// <param name="gatewayType">��������</param> /// <returns>���ش��ڶ���̻�����ʱ���ص�һ�������ҵ�����null</returns> public Merchant GetMerchant(GatewayType gatewayType) { return merchantList.FirstOrDefault(m => m.GatewayType == gatewayType); }
public PaymentSetting(GatewayType gatewayType) { gateway = CreateGateway(gatewayType); }
public PaymentSetting(GatewayType gatewayType, Merchant merchant, Order order) : this(gatewayType) { gateway.Merchant = merchant; gateway.Order = order; }
/// <summary> /// Instantiates CreateVpnGatewayRequest with the parameterized properties /// </summary> /// <param name="type">The type of VPN connection this virtual private gateway supports.</param> public CreateVpnGatewayRequest(GatewayType type) { _type = type; }
/// <summary> /// Instantiates CreateCustomerGatewayRequest with the parameterized properties /// </summary> /// <param name="type">The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</param> /// <param name="publicIp">The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</param> /// <param name="bgpAsn">For devices that support BGP, the customer gateway's BGP ASN. Default: 65000</param> public CreateCustomerGatewayRequest(GatewayType type, string publicIp, int bgpAsn) { _type = type; _publicIp = publicIp; _bgpAsn = bgpAsn; }
private GatewayBase CreateGateway(GatewayType gatewayType) { switch (gatewayType) { case GatewayType.Alipay: { return new AlipayGateway(); } case GatewayType.WeChatPayment: { return new WeChatPaymentGataway(); } case GatewayType.Tenpay: { return new TenpayGateway(); } case GatewayType.Yeepay: { return new YeepayGateway(); } default: { return new NullGateway(); } } }