C#

Author: Semaka 50 views
				
					var client = new RestClient("https://gateway.switch.tj/api/v1/payment-key");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic V2hvb3NoRGVtb0FQSTpmZGZsa2RmZXVlbzM4Mzk4");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("Cookie", "PHPSESSID=abk57kqs42fjpdfvv8a78ckfd7");
request.AddParameter("merchant_reference", "12312312312");
request.AddParameter("amount", "5.00");
request.AddParameter("error_url", "https://url-to-your-success-page.co.za");
request.AddParameter("success_url", "https://url-to-your-success-page.co.za");
request.AddParameter("cancel_url", "https://url-to-your-success-page.co.za");
request.AddParameter("notify_url", "https://url-to-your-success-page.co.za");
request.AddParameter("payment_type", "credit_card");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);