Skip to content

Commit

Permalink
Merge pull request #3 from hitmanpt/patch-1
Browse files Browse the repository at this point in the history
Fixed SSL/TLS Error
  • Loading branch information
daishisystems committed Aug 5, 2016
2 parents 65f7880 + 1c9f6e8 commit aecf356
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Daishi.PaySharp/PayPalAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string SetExpressCheckout(SetExpressCheckoutPayload payload,
payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var response = webClient.UploadValues(expressCheckoutURI,
setExpressCheckoutMetadata);
return encoding.GetString(response);
Expand Down Expand Up @@ -69,7 +69,7 @@ public async Task<string> SetExpressCheckoutAsync(
payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var response =
await webClient.UploadValuesTaskAsync(expressCheckoutURI,
setExpressCheckoutMetadata);
Expand Down Expand Up @@ -99,7 +99,7 @@ public string GetExpressCheckoutDetails(
.CreateGetExpressCheckoutDetailsQueryString(payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
return webClient.DownloadString(
new Uri(string.Concat(expressCheckoutUri, "?", queryString)));
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public async Task<string> GetExpressCheckoutDetailsAsync(
.CreateGetExpressCheckoutDetailsQueryString(payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
return await webClient.DownloadStringTaskAsync(
new Uri(string.Concat(expressCheckoutUri, "?",
queryString)));
Expand Down Expand Up @@ -158,7 +158,7 @@ public string DoExpressCheckoutPayment(
.CreateDoExpressCheckoutPaymentQueryString(payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
return webClient.DownloadString(
new Uri(string.Concat(expressCheckoutUri, "?", queryString)));
}
Expand Down Expand Up @@ -188,11 +188,11 @@ public async Task<string> DoExpressCheckoutPaymentAsync(
.CreateDoExpressCheckoutPaymentQueryString(payload);

using (var webClient = new WebClient()) {

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
return await webClient.DownloadStringTaskAsync(
new Uri(string.Concat(expressCheckoutUri, "?", queryString)));
}

}
}
}
}

0 comments on commit aecf356

Please sign in to comment.