Пример #1
0
        public int RefreshAuthority(string MerchantID, string Authority, int ExpireIn)
        {
            RefreshAuthorityRequest inValue = new RefreshAuthorityRequest();

            inValue.Body            = new RefreshAuthorityRequestBody();
            inValue.Body.MerchantID = MerchantID;
            inValue.Body.Authority  = Authority;
            inValue.Body.ExpireIn   = ExpireIn;
            RefreshAuthorityResponse retVal = ((PaymentGatewayImplementationServicePortType)(this)).RefreshAuthority(inValue);

            return(retVal.Body.Status);
        }
Пример #2
0
        public async Task <RefreshAuthorityResponse> Authority(string authority, int expireIn)
        {
            var k = await Client.Create().RefreshAuthorityAsync(this._merchantId, authority, expireIn);

            RefreshAuthorityResponse obj = new RefreshAuthorityResponse();

            obj.Status = k.Body.Status;
            return(obj);

            //using (HttpClient httpClient = new HttpClient())
            //{
            //    using (HttpResponseMessage httpResponseMessage = await httpClient.PostAsync("https://www.zarinpal.com/pg/rest/WebGate/RefreshAuthority.json",
            //        new StringContent(JsonConvert.SerializeObject(new
            //        {
            //            MerchantID = this._merchantId,
            //            ExpireIn = expireIn,
            //            Authority = authority
            //        }), Encoding.UTF8, "application/json")))
            //    {
            //        return JsonConvert.DeserializeObject<RefreshAuthorityResponse>(await httpResponseMessage.Content.ReadAsStringAsync());
            //    }
            //}
        }