Exemplo n.º 1
0
        public static string DoExpressCheckoutPayment(PaypalUserCredentials user, PaypalPaymentDetails paymentRequest, string token, string payerId)
        {
            int    version  = 93;
            string postData = "";

            postData += user.ToPostData();
            postData += HttpUtility.UrlEncode("METHOD") + "=DoExpressCheckoutPayment&";
            postData += HttpUtility.UrlEncode("VERSION") + "=" + Version.ToString() + "&";
            postData += HttpUtility.UrlEncode("TOKEN") + "=" + token + "&";
            postData += HttpUtility.UrlEncode("PAYERID") + "=" + payerId + "&";
            postData += paymentRequest.ToPostData();

            return(SendRequest(postData));
        }
Exemplo n.º 2
0
        public static string SetExpressCheckout(PaypalUserCredentials user, PaypalPaymentDetails paymentRequest, List <PaypalPaymentDetailsItem> items, PaypalSetExpressCheckoutParameters param)
        {
            string postData = "";

            postData += user.ToPostData();
            postData += HttpUtility.UrlEncode("METHOD") + "=SetExpressCheckout&";
            postData += HttpUtility.UrlEncode("VERSION") + "=" + Version.ToString() + "&";
            postData += paymentRequest.ToPostData();
            int index = 0;

            foreach (PaypalPaymentDetailsItem item in items)
            {
                postData += item.ToPostData(index);
                index++;
                if (index > 9)
                {
                    break;
                }
            }
            postData += param.ToPostData();

            return(SendRequest(postData));
        }