Skip to main content
New Participant
January 17, 2007
Question

Paypal shopping cart and flash integration

  • January 17, 2007
  • 10 replies
  • 1008 views

I needed to add this as a button in my flash navigation, but I just can't seem to get it to work.

Please help.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com//en_US/i/btn/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="tetraskin@aol.com">
<input type="hidden" name="item_name" value="Aloe Cucumber Astringent">
<input type="hidden" name="item_number" value="IO-1002806">
<input type="hidden" name="amount" value="23.99">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value=" http://tetraskin.com/Thankyou.html">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>

Thanks
This topic has been closed for replies.

10 replies

kglad
Community Expert
Community Expert
January 30, 2007
and post should be "POST", in caps.
kglad
Community Expert
Community Expert
January 30, 2007
that send doesn't look right. what's supposed to be at the end of that url?
Inspiring
January 30, 2007
this is how I send them out.

checkout.onPress=function(){
lv.send(" http://www.sandbox.paypal.com/cart/add=", "_blank", "post");}
Inspiring
January 30, 2007
Here's my code now:
var grand=_root.total

lv=new LoadVars();
lv.cmd="_cart";
choice=[lv.item_name_1,lv.item_name_2,lv.item_name_3,lv.item_name_4,lv.item_name_5,lv.item_name_6,lv.item_name_7,lv.item_name_8,lv.item_name_9,lv.item_name_10]
choicepay=[lv.amount_1,lv.amount_2,lv.amount_3,lv.amount_4,lv.amount_5,lv.amount_6,lv.amount_7,lv.amount_8,lv.amount_9,lv.amount_10]
//choicenum=[lv.quantity_1,lv.quantity_2,lv.quantity_3,lv.quantity_4,lv.quantity_5,lv.quantity_6,lv.quantity_7,lv.quantity_8,lv.quantity_9,lv.quantity_10]

lv.business="molly@dogz.com"
lv.ship="$4.50"
lv.currency_code="USD"
lv.amount=grand;

for(i=0;i<_root.paypal.length;i++){
choice = _root.paypal;
choicepay =_root.payprice;
choicenum =i+1//(i+1).toString();

} Before I got into the big arrays it was working, but it put a complicated order as just one item- it's a bunch of beads on a chain, that are personalized, and people tend to order more than one.

I'm using the Paypal sandbox, which is cool. The flash variables trace out correctly.

kglad
Community Expert
Community Expert
January 29, 2007
what variable/values do you need to send to paypal? if you're in a similar situation to the op, you need to send a variable named "add" with a value of 1. if that's true, your code won't and shouldn't work.
Inspiring
January 28, 2007
forgot to add this:
checkout.onPress=function(){
lv.sendAndLoad("https://www.paypal.com/cgi-bin/webscr",lv,"_POST");
Inspiring
January 28, 2007
I'm trying to get something like this working too, for someone else's site, but am testing it on my own. I've used loadVars in other situations. Couldn't find info on Paypal or by phone to Paypal. The site involves customized items, and all that info is in the variable ordero, and the value of various items is in variable grand. So if I put:
lv=new LoadVars();
lv.cmd="_cart";
lv.business="mytesting address@earthlink.net"
lv.item_name=ordero
lv.currency_code="USD"
lv.amount=grand;

Shouldn't that work? It hangs at paypal and goes no farther.
kglad
Community Expert
Community Expert
January 19, 2007
you're welcome.
kglad
Community Expert
Community Expert
January 18, 2007
you're welcome.

what is it that you want to look up?
ZelyahAuthor
New Participant
January 18, 2007
If I wanted to put a paypal shopping cart button in my flash navigation menu, how would I go about doing it?

The html code is :

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="tetraskin@aol.com">
<input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
<input type="hidden" name="page_style" value="Primary">
</form>

at the moment the button I created has this actionscript on it

on (rollOver) {
gotoAndPlay("over");
}
on (releaseOutside, rollOut) {
gotoAndPlay("out");
}
on (release) {
getURL("index-3.html");
}

How do I change it so that when the button is pressed it shows the shopping cart?

I'm new to actionscript and I wondered if you could recommend a book or a site that I could use to learn a bit more?

Thanks again.

kglad
Community Expert
Community Expert
January 18, 2007
that's in the code in my above message. but instead of attaching the yourSubmitBtn.onPress code to a frame, you wanted to attach it to a true (non-movieclip) button and you wanted to use an on(release) handler, you would use:

kglad
Community Expert
Community Expert
January 17, 2007
try:

ZelyahAuthor
New Participant
January 18, 2007
Thank you so much, it worked.

I also have the shopping cart which I created a view cart button for.

Is there a place where I can look this up. I would like to understand the concept also.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="tetraskin@aol.com">
<input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
<input type="hidden" name="page_style" value="Primary">
</form>