<commit_before>#region Includes

using System;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;

#endregion

namespace Daishi.PaySharp {
    public class PayPalAdapter {
        public async Task<string> SetExpressCheckout(SetExpressCheckoutPayload payload,
            Encoding encoding, string setExpressCheckoutURI) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", payload.Password},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"PAYMENTREQUEST_0_PAYMENTACTION", payload.Action},
                {"PAYMENTREQUEST_0_AMT", payload.Amount},
                {"PAYMENTREQUEST_0_CURRENCYCODE", payload.CurrencyCode},
                {"cancelUrl", payload.CancelUrl},
                {"returnUrl", payload.ReturnUrl}
            };

            using (var webClient = new WebClient()) {

                var response = await webClient.UploadValuesTaskAsync(setExpressCheckoutURI, nvc);
                return encoding.GetString(response);
            }
        }

        public async Task<string> GetExpressCheckoutDetailsAsync(
            GetExpressCheckoutDetailsPayload payload, string getExpressCheckoutUri) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", <PASSWORD>},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"TOKEN", payload.AccessToken}
            };

            var queryString = string.Join("&", nvc.AllKeys.Select(
                i => string.Concat(i, "=", HttpUtility.UrlEncode(nvc[i]))));

            using (var webClient = new WebClient()) {

                return await webClient.DownloadStringTaskAsync(
                    new Uri(string.Concat(getExpressCheckoutUri, "?", queryString)));
            }
        }
    }
}<commit_msg>Added both sync and async SetExpresscheckout and GetExpressCheckoutDetails methods<commit_after>#region Includes

using System;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;

#endregion

namespace Daishi.PaySharp {
    public class PayPalAdapter {

        public string SetExpressCheckout(SetExpressCheckoutPayload payload,
            Encoding encoding, string setExpressCheckoutURI) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", payload.Password},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"PAYMENTREQUEST_0_PAYMENTACTION", payload.Action},
                {"PAYMENTREQUEST_0_AMT", payload.Amount},
                {"PAYMENTREQUEST_0_CURRENCYCODE", payload.CurrencyCode},
                {"cancelUrl", payload.CancelUrl},
                {"returnUrl", payload.ReturnUrl}
            };

            using (var webClient = new WebClient()) {

                var response = webClient.UploadValues(setExpressCheckoutURI, nvc);
                return encoding.GetString(response);
            }
        }

        public async Task<string> SetExpressCheckoutAsync(SetExpressCheckoutPayload payload,
            Encoding encoding, string setExpressCheckoutURI) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", <PASSWORD>},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"PAYMENTREQUEST_0_PAYMENTACTION", payload.Action},
                {"PAYMENTREQUEST_0_AMT", payload.Amount},
                {"PAYMENTREQUEST_0_CURRENCYCODE", payload.CurrencyCode},
                {"cancelUrl", payload.CancelUrl},
                {"returnUrl", payload.ReturnUrl}
            };

            using (var webClient = new WebClient()) {

                var response = await webClient.UploadValuesTaskAsync(setExpressCheckoutURI, nvc);
                return encoding.GetString(response);
            }
        }

        public string GetExpressCheckoutDetails(
            GetExpressCheckoutDetailsPayload payload, string getExpressCheckoutUri) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", payload.Password},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"TOKEN", payload.AccessToken}
            };

            var queryString = string.Join("&", nvc.AllKeys.Select(
                i => string.Concat(i, "=", HttpUtility.UrlEncode(nvc[i]))));

            using (var webClient = new WebClient()) {

                return webClient.DownloadString(
                    new Uri(string.Concat(getExpressCheckoutUri, "?", queryString)));
            }
        }

        public async Task<string> GetExpressCheckoutDetailsAsync(
            GetExpressCheckoutDetailsPayload payload, string getExpressCheckoutUri) {

            var nvc = new NameValueCollection {
                {"USER", payload.User},
                {"PWD", payload.Password},
                {"SIGNATURE", payload.Signature},
                {"METHOD", payload.Method},
                {"VERSION", payload.Version},
                {"TOKEN", payload.AccessToken}
            };

            var queryString = string.Join("&", nvc.AllKeys.Select(
                i => string.Concat(i, "=", HttpUtility.UrlEncode(nvc[i]))));

            using (var webClient = new WebClient()) {

                return await webClient.DownloadStringTaskAsync(
                    new Uri(string.Concat(getExpressCheckoutUri, "?", queryString)));
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.10650594451783356, 'fraction_numerical': 0.001486129458388375, 'mean_word_length': 1.983743842364532, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6590457', 'n_tokens_mistral': 1550, 'n_tokens_neox': 1470, 'n_words': 309}