Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #685

How to dynamically post a variable number of products to Paypal?

From macoln <mr.gaolin@gmail.com>
Newsgroups comp.lang.java.help
Subject How to dynamically post a variable number of products to Paypal?
Date 2011-05-18 01:20 -0700
Organization http://groups.google.com
Message-ID <e679518b-2df7-4432-9e20-d2b668e50c39@glegroupsg2000goo.googlegroups.com> (permalink)

Show all headers | View raw


I have some shopping cart code that I took over when I started with a company, but unfortunately I'm weak on Java and integrating with Paypal. Here is the form that sends data to Paypal when a customer checks out of the shopping cart. I can get it to send one product, but I would like it to include data on all the products purchased from the cart. I am thinking logic:iterate will help me? But then how do I increment the "on#" and "os#" when presented with a variable amount of products?

<form name="paypal" id="paypal" style="float:left;" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="business" value="shop@myshop.com">
    <input type="hidden" name="item_name" value="Order Detail Information">
    <input type="hidden" name="amount" id="amount" value="${tdollarTotal}">
    <input type="hidden" name="currency_code" id="currency" value="USD">
    <input type="hidden" name="on0" value="buyMethod">
    <input type="hidden" name="os0" id="buyMethod" value="Shopping Cart">
    <input type="hidden" name="on1" value="orderId">
    <input type="hidden" name="os1" id="orderId" value="">
    <input type="hidden" name="on2" value="Address">
    <input type="hidden" name="os2" value="Kunming Yunnan China">
    <input type="hidden" name="on3" value="Purchased at">
    <input type="hidden" name="os3" value="www.danyunfairtrade.com">
    <logic:present name="shopclass" property="cart">
        <logic:iterate id="cartinfo" name="shopclass" property="cart" indexId="index">  
        <bean:define id="product" name="cartinfo" property="product"></bean:define>
            <input type="hidden" name="on4" value="productNo">
            <input type="hidden" name="os4" id="productNo" value="${product.productNo }">
            <input type="hidden" name="on5" value="productName">
            <input type="hidden" name="os5" id="productName" value="${product.name }">
        </logic:iterate>
    </logic:present>

    <input type="hidden" name="notify_url" value="http://www.danyunfairtrade.com/cart.html">
    <img name="Paypal" src="/images/qujiesuan.gif" class="jiesuan" border=0 style="cursor: pointer;" onclick="javascript:goPayPal();" />
</form>

Back to comp.lang.java.help | Previous | NextNext in thread | Find similar


Thread

How to dynamically post a variable number of products to Paypal? macoln <mr.gaolin@gmail.com> - 2011-05-18 01:20 -0700
  Re: How to dynamically post a variable number of products to Paypal? markspace <-@.> - 2011-05-18 11:51 -0700
    Re: How to dynamically post a variable number of products to Paypal? Lew <noone@lewscanon.com> - 2011-05-18 15:44 -0400
  Re: How to dynamically post a variable number of products to Paypal? Ian Shef <invalid@avoiding.spam> - 2011-05-18 19:23 +0000
  Re: How to dynamically post a variable number of products to Paypal? Roedy Green <see_website@mindprod.com.invalid> - 2011-05-19 10:27 -0700

csiph-web