Exemplo n.º 1
0
    private void CreatePostParameters(CheckoutDetails checkout)
    {
        PayPalRedirectPaymentMethod paymentMethod = (PayPalRedirectPaymentMethod)checkout.PaymentMethod;

        uxLiteral.Text    = CreateParameterText(checkout, paymentMethod);
        uxUrlHidden.Value = paymentMethod.GetPostedUrl();
    }
Exemplo n.º 2
0
    private string CreateParameterText(CheckoutDetails checkoutDetails, PayPalRedirectPaymentMethod paymentMethod)
    {
        NameValueCollection collection = paymentMethod.CreatePostParameters(
            checkoutDetails,
            StoreContext.Culture,
            StoreContext.Currency,
            StoreContext.ShoppingCart,
            UrlPath.StorefrontUrl,
            OrderID,
            StoreContext.GetOrderAmount().Total,
            StoreContext.WholesaleStatus,
            WebUtilities.GetVisitorIP()
            );

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < collection.Count; i++)
        {
            string text;
            if (paymentMethod.IsHiddenFieldUsingID)
            {
                text = CreateTagHiddenWithID(collection.GetKey(i), collection.Get(i));
            }
            else
            {
                text = CreateTagHidden(collection.GetKey(i), collection.Get(i));
            }

            sb.Append(text);
        }

        return(sb.ToString());
    }