New to the community? Welcome! Please read our Community Rules and Guidelines
If you want to report illegal content under the EU Digital Services Act, please do so here
Hi,
I am integrating Paypal API using ASP.Net C#,
I am able get Access Token using API URI
using (var client = new HttpClient())
{
var byteArray = Encoding.UTF8.GetBytes(ClientId + ":" + ClientSecret);
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
var url = new Uri("https://api.sandbox.paypal.com/v1/oauth2/token", UriKind.Absolute);
client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
var requestParams = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("grant_type", "client_credentials")
};
var content = new FormUrlEncodedContent(requestParams);
var webresponse = await client.PostAsync(url, content);
var resp = await webresponse.Content.ReadAsStringAsync();
AuthResult acc = JsonConvert.DeserializeObject<AuthResult>(resp);
but Same thing I want to create Payment URI
like
string strURL = "https://api.sandbox.paypal.com/v1/payments/payment/";
Payment payment = new Payment();
payment.transactions = translist; //Translist is Transaction all details I have done
using (var client = new HttpClient())
{
//I am unable to call here please help me
}