How to make an HTTP POST web request using C# - RestSharp (Airpay Payment Gateway)

   How to make an HTTP POST web request using  C# - RestSharp

 
 We have implemented the Airpay Payment Gateway Step-3 Webhook API Method to verify the payment.
 
 
var client = new RestClient("https://payments.airpay.co.in/order/verify.php");
                    client.Timeout = -1;
                    var request = new RestRequest(Method.POST);
                    ServicePointManager.Expect100Continue = true;
                    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                    request.AlwaysMultipartFormData = true;
                    request.AddParameter("mercid", "mercid");
                    request.AddParameter("merchant_txnId", "merchant_txnId");
                    request.AddParameter("privatekey", "privatekey");
                    IRestResponse response = client.Execute(request);
 
                    //XML Response in Variable
                    var XMLResponse = XElement.Parse(response.Content);
// Parse the response
// Node Store in Variable
                    var TransactionStatus = XMLResponse.Descendants().First(node => node.Name == "TRANSACTIONSTATUS").Value;
                    var TransactionID = XMLResponse.Descendants().First(node => node.Name == "TRANSACTIONID").Value;
                    var Amount = XMLResponse.Descendants().First(node => node.Name == "AMOUNT").Value;
                    var TransactionPaymentStatus = XMLResponse.Descendants().First(node => node.Name == "TRANSACTIONPAYMENTSTATUS").Value;
 
 
You can contact me for understanding of Payment Gateway Integrations.

Post a Comment

2 Comments

Thanks for Commenting on our blogs, we will revert back with answer of your query.
Thanks & Regards
Sonu Yadav

Emoji
(y)
:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
x-)
(k)

Translate

Close Menu