So, initially it was responding me "Could not create SSL/TLS secure channel" error so then I followed this https://github.com/AuthorizeNet/sdk-dotnet/issues/203 and after adding the suggested 3 lines of code right before calling post method of httpClient and then its responding "Unsupported Input Received" with 415 status code.
// Code sample
public class MollieHelper
{
private readonly HttpClient httpClient = new HttpClient();
public MollieHelper(string accessToken)
{
this.httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", accessToken);
this.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}
public async Task<object> PostAsync(string url, object obj)
{
// Suggested code from https://github.com/AuthorizeNet/sdk-dotnet/issues/203
const SslProtocols sslProtocols = (SslProtocols)0x00000C00;
const SecurityProtocolType securityProtocolType = (SecurityProtocolType)sslProtocols;
ServicePointManager.SecurityProtocol = securityProtocolType;
var response = await this.httpClient.PostAsync(new Uri(url), new StringContent(JsonConvert.SerializeObject(obj)));
if (!response.IsSuccessStatusCode)
{
return null;
}
var result = await response.Content.ReadAsStringAsync();
var data = JsonConvert.DeserializeObject(result);
return data;
}
}
and I am sending data like
{
"amount": {
"currency": "EUR",
"value": "30"
},
"description": "Please select the payment method",
"redirectUrl": "https://mydomain.com"
}
Hi, I am trying to calling https://api.mollie.com/v2/payments url from my backend by using httpClient.PostAsync.
So, initially it was responding me "Could not create SSL/TLS secure channel" error so then I followed this https://github.com/AuthorizeNet/sdk-dotnet/issues/203 and after adding the suggested 3 lines of code right before calling post method of httpClient and then its responding "Unsupported Input Received" with 415 status code.
// Code sample
and I am sending data like { "amount": { "currency": "EUR", "value": "30" }, "description": "Please select the payment method", "redirectUrl": "https://mydomain.com" }