lshane
asked on
PayPal Integration: Sending multiple dynamic items to PayPal
DWMX
WIN XP PRO
MS Access
Classic ASP VBScript
Hello. I have created a very small shopping cart that uses session variables and pulls the product information from an MS Access db. I'm at the "Checkout" page now and need to send these items to PayPal for purchase. I am not sure how to do that. I found code on the PayPal Integration site, but I am not sure how to make sense of it. Even the examples for the "Multiple Items" scenarios look like they are manually generated, but I need to send my current individual items from a session variable.
(To view currently, the website is <http://www.alholley.com/al2/music_details.asp?projID=igim>)
Just "Add to cart" to see how it's working.
I really need some help. Here is the PayPal Integration code I located for "Individual Items"
========================== ========== ========== ========== ========== ========== ==
<form action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="you@youremail.com">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="0.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
========================== ========== ========== ========== ========== ========== ==
========================== ========== ========== ========== ========== ========== ==
Here is the code that displays my product information on the "Checkout" page:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFCC">
<td><font size="2" face="Verdana"><strong>ID< /strong></ font></td>
<td><font size="2" face="Verdana"><strong>Pro duct</stro ng></font> </td>
<td align="center"><font size="2" face="Verdana"><strong>Pri ce</strong ></font></ td>
<td align="center"><font size="2" face="Verdana"><strong>Qua ntity</str ong></font ></td>
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="4"><hr></td>
</tr>
<%
FOR x = 0 TO UBOUND( localCart, 2 )
IF localCart( CARTPID, x ) <> "" THEN
orderTotal = orderTotal + ( localCart( CARTPPRICE, x ) * localCart( CARTPQUANTITY, x ) )
DIM chId,chProduct,chPrice,chQ uantity
chId=(localCart( CARTPID, x) )
chProduct=Server.HTMLEncod e( localCart( CARTPNAME, x ) )
chPrice=formatCurrency( localCart( CARTPPRICE, x ) )
chQuantity=localCart( CARTPQUANTITY, x )%>
<tr bgcolor="#FFFFCC">
<td><font size="2" face="Courier New, Courier, mono"><%=chId%></font></td >
<td><font size="2" face="Courier New, Courier, mono"><%=chProduct%></font ></td>
<td align="center"><font size="2" face="Courier New, Courier, mono"><%=chPrice%></font>< /td>
<td align="center"><font size="2" face="Courier New, Courier, mono"><%=chQuantity%></fon t></td>
</tr>
<%
END IF
NEXT
%>
</table>
========================== ========== ========== ========== ========== ========== ==
I need to pass the "chId,chProduct,chPrice,ch Quantity" information, but I'm not sure how to do it. I know on a "Single Item" button, I would use the "item_number" variable and give it a value of the recordset. However, I'm not sure how to do this when multiple items are in play.
Thank you so much in advance,
Shane
WIN XP PRO
MS Access
Classic ASP VBScript
Hello. I have created a very small shopping cart that uses session variables and pulls the product information from an MS Access db. I'm at the "Checkout" page now and need to send these items to PayPal for purchase. I am not sure how to do that. I found code on the PayPal Integration site, but I am not sure how to make sense of it. Even the examples for the "Multiple Items" scenarios look like they are manually generated, but I need to send my current individual items from a session variable.
(To view currently, the website is <http://www.alholley.com/al2/music_details.asp?projID=igim>)
Just "Add to cart" to see how it's working.
I really need some help. Here is the PayPal Integration code I located for "Individual Items"
==========================
<form action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="you@youremail.com">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="0.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
==========================
==========================
Here is the code that displays my product information on the "Checkout" page:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFCC">
<td><font size="2" face="Verdana"><strong>ID<
<td><font size="2" face="Verdana"><strong>Pro
<td align="center"><font size="2" face="Verdana"><strong>Pri
<td align="center"><font size="2" face="Verdana"><strong>Qua
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="4"><hr></td>
</tr>
<%
FOR x = 0 TO UBOUND( localCart, 2 )
IF localCart( CARTPID, x ) <> "" THEN
orderTotal = orderTotal + ( localCart( CARTPPRICE, x ) * localCart( CARTPQUANTITY, x ) )
DIM chId,chProduct,chPrice,chQ
chId=(localCart( CARTPID, x) )
chProduct=Server.HTMLEncod
chPrice=formatCurrency( localCart( CARTPPRICE, x ) )
chQuantity=localCart( CARTPQUANTITY, x )%>
<tr bgcolor="#FFFFCC">
<td><font size="2" face="Courier New, Courier, mono"><%=chId%></font></td
<td><font size="2" face="Courier New, Courier, mono"><%=chProduct%></font
<td align="center"><font size="2" face="Courier New, Courier, mono"><%=chPrice%></font><
<td align="center"><font size="2" face="Courier New, Courier, mono"><%=chQuantity%></fon
</tr>
<%
END IF
NEXT
%>
</table>
==========================
I need to pass the "chId,chProduct,chPrice,ch
Thank you so much in advance,
Shane
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, on line 25 the REM should be "CLOSE LOOP HERE"
ASKER
Thanks so much, R Harrison.