Beispiel #1
0
        public async Task <PaymentVerificationWithExtraResponse> VerificationWithExtra(string authority)
        {
            var k = await Client.Create().PaymentVerificationWithExtraAsync(this._merchantId, authority, this._amount);

            PaymentVerificationWithExtraResponse obj = new PaymentVerificationWithExtraResponse();

            obj.RefId       = k.Body.RefID;
            obj.Status      = k.Body.Status;
            obj.ExtraDetail = k.Body.ExtraDetail;
            return(obj);

            //using (HttpClient httpClient = new HttpClient())
            //{
            //    using (HttpResponseMessage httpResponseMessage = await httpClient.PostAsync("http://api3.zarinpal.dev/pg/rest/WebGate/PaymentVerificationWithExtra.json",
            //        new StringContent(JsonConvert.SerializeObject(new
            //        {
            //            MerchantID = this._merchantId,
            //            Amount = this._amount,
            //            Authority = authority
            //        }), Encoding.UTF8, "application/json")))
            //    {
            //        return JsonConvert.DeserializeObject<PaymentVerificationWithExtraResponse>(await httpResponseMessage.Content.ReadAsStringAsync());
            //    }
            //}
        }
Beispiel #2
0
        public int PaymentVerificationWithExtra(string MerchantID, string Authority, int Amount, out long RefID, out string ExtraDetail)
        {
            PaymentVerificationWithExtraRequest inValue = new PaymentVerificationWithExtraRequest();

            inValue.Body            = new PaymentVerificationWithExtraRequestBody();
            inValue.Body.MerchantID = MerchantID;
            inValue.Body.Authority  = Authority;
            inValue.Body.Amount     = Amount;
            PaymentVerificationWithExtraResponse retVal = ((PaymentGatewayImplementationServicePortType)(this)).PaymentVerificationWithExtra(inValue);

            RefID       = retVal.Body.RefID;
            ExtraDetail = retVal.Body.ExtraDetail;
            return(retVal.Body.Status);
        }