Re: paypal cart

2008-07-29 Thread Eric Haskins
Look at PayPal IPN code.  I have done some hacks (in php) where I serialized
and Array of data then base64 encoded and passed it in the the string to get
around limitations but I think your problem is the buttons do not post any
data back to your cart that is why you should use PayPal IPN

Eric

On Tue, Jul 29, 2008 at 10:19 AM, Chad Gray [EMAIL PROTECTED] wrote:

 Hello,

 I have run into a situation where PayPals add to cart buttons are not
 going to work for me.  So I am looking for ideas on how to accomplish this.

 The item I am trying to sell is a business card.  So I want the user to
 fill out Name, Email, Phone etc then add the item to their cart.

 PayPal buttons can only take 3 options I will have about 10 things I want
 to track about the item added to the cart.

 So I thought I would store the info to be printed on the business cart in a
 database and assign it a UID that I would pass to PayPal so I could look up
 what the user typed in.

 Well, I have it so they fill out the form and enter their info then submit
 it to a CF page that enters the info into the database.  On this page I
 would like for the UID of the item to be added to the PayPal cart.

 I have tried submitting the PayPal add to cart form with javascript with
 OnLoad in the Body tag, but I get pop-up warnings and don't want the user to
 have to worry about pop-ups.  I have tried using cfhttp to post the data,
 but the cart does not function right.  It is like the cart gets a new
 session and does not track the items in the cart right.  Must be a cookie
 thing or something.

 Anyone have ideas on how to accomplish this?

 Here is my cfhttp code.  Maybe I need to change something in this to keep
 the cart data?

 !--- display page to link to action page ---
 a href=PayPalTest.cfm?item_name=Business Card1item_number=12345card
 1/a
 a href=PayPalTest.cfm?item_name=Business Card2item_number=12346card
 2/a


 !--- action page that needs to submit to paypal ---
 cfhttp method=post url=https://www.paypal.com/cgi-bin/webscr;
cfhttpparam name=add type=formfield value=1
cfhttpparam name=cmd type=formfield value=_cart
cfhttpparam name=business type=formfield
 value=#yourPayPalEmail#
cfhttpparam name=item_name type=formfield
 value=#URL.item_name#
cfhttpparam name=item_number type=formfield
 value=#URL.item_number#
cfhttpparam name=amount type=formfield value=25.00
cfhttpparam name=shipping type=formfield value=10.00
cfhttpparam name=no_shipping type=formfield value=2
cfhttpparam name=currency_code type=formfield value=USD
cfhttpparam name=weight type=formfield value=1
cfhttpparam name=weight_unit type=formfield value=lbs
cfhttpparam name=lc type=formfield value=US
cfhttpparam name=bn type=formfield value=PP-ShopCartBF
 /cfhttp

 cfoutput
#cfhttp.fileContent#
 /cfoutput


 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309864
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: paypal cart

2008-07-29 Thread Chad Gray
IPN seems to just pass back the final order info so you can see what they 
ordered.  By base64 encoding your array are you making it smaller (as in less 
characters)?  I don't see how I can encode the data before it is submitted to 
paypal.

I need to find a way of writing to a database then adding the item to the 
paypal cart and do it on one page.

If I use their form the data is submitted to them and they cannot store all of 
it.  If I submit the form to an action page I write then I cannot submit the 
paypal cart form to add the item to the paypal cart.

Can a form be submitted to two places at one?  :)


 -Original Message-
 From: Eric Haskins [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 10:35 AM
 To: CF-Talk
 Subject: Re: paypal cart
 
 Look at PayPal IPN code.  I have done some hacks (in php) where I
 serialized
 and Array of data then base64 encoded and passed it in the the string to
 get
 around limitations but I think your problem is the buttons do not post any
 data back to your cart that is why you should use PayPal IPN
 
 Eric
 
 On Tue, Jul 29, 2008 at 10:19 AM, Chad Gray [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I have run into a situation where PayPals add to cart buttons are not
  going to work for me.  So I am looking for ideas on how to accomplish
 this.
 
  The item I am trying to sell is a business card.  So I want the user to
  fill out Name, Email, Phone etc then add the item to their cart.
 
  PayPal buttons can only take 3 options I will have about 10 things I
 want
  to track about the item added to the cart.
 
  So I thought I would store the info to be printed on the business cart
 in a
  database and assign it a UID that I would pass to PayPal so I could look
 up
  what the user typed in.
 
  Well, I have it so they fill out the form and enter their info then
 submit
  it to a CF page that enters the info into the database.  On this page I
  would like for the UID of the item to be added to the PayPal cart.
 
  I have tried submitting the PayPal add to cart form with javascript
 with
  OnLoad in the Body tag, but I get pop-up warnings and don't want the
 user to
  have to worry about pop-ups.  I have tried using cfhttp to post the
 data,
  but the cart does not function right.  It is like the cart gets a new
  session and does not track the items in the cart right.  Must be a
 cookie
  thing or something.
 
  Anyone have ideas on how to accomplish this?
 
  Here is my cfhttp code.  Maybe I need to change something in this to
 keep
  the cart data?
 
  !--- display page to link to action page ---
  a href=PayPalTest.cfm?item_name=Business Card1item_number=12345card
  1/a
  a href=PayPalTest.cfm?item_name=Business Card2item_number=12346card
  2/a
 
 
  !--- action page that needs to submit to paypal ---
  cfhttp method=post url=https://www.paypal.com/cgi-bin/webscr;
 cfhttpparam name=add type=formfield value=1
 cfhttpparam name=cmd type=formfield value=_cart
 cfhttpparam name=business type=formfield
  value=#yourPayPalEmail#
 cfhttpparam name=item_name type=formfield
  value=#URL.item_name#
 cfhttpparam name=item_number type=formfield
  value=#URL.item_number#
 cfhttpparam name=amount type=formfield value=25.00
 cfhttpparam name=shipping type=formfield value=10.00
 cfhttpparam name=no_shipping type=formfield value=2
 cfhttpparam name=currency_code type=formfield value=USD
 cfhttpparam name=weight type=formfield value=1
 cfhttpparam name=weight_unit type=formfield value=lbs
 cfhttpparam name=lc type=formfield value=US
 cfhttpparam name=bn type=formfield value=PP-ShopCartBF
  /cfhttp
 
  cfoutput
 #cfhttp.fileContent#
  /cfoutput
 
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309870
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: paypal cart

2008-07-29 Thread Chad Gray
OH my... You can submit to two different action pages.  The index.cfm page is 
what is displayed because it was the last function run.


script languagescript language=javascript
function loginHandler1()
{
document.form1.action = PayPalTest.cfm;
document.form1.submit();
}

function loginHandler2()
{
document.form1.action = index.cfm;
document.form1.submit();
}
/script

form name=form1 action= method=post 
pUsername: input type=text name=usercode value=/p
pPassword: input type=password name=password value=/p
pinput type=button value=login 
onclick=loginHandler1();loginHandler2();/p
/form

 -Original Message-
 From: Chad Gray [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 12:02 PM
 To: CF-Talk
 Subject: RE: paypal cart
 
 IPN seems to just pass back the final order info so you can see what they
 ordered.  By base64 encoding your array are you making it smaller (as in
 less characters)?  I don't see how I can encode the data before it is
 submitted to paypal.
 
 I need to find a way of writing to a database then adding the item to the
 paypal cart and do it on one page.
 
 If I use their form the data is submitted to them and they cannot store
 all of it.  If I submit the form to an action page I write then I cannot
 submit the paypal cart form to add the item to the paypal cart.
 
 Can a form be submitted to two places at one?  :)


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309872
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: paypal cart

2008-07-29 Thread Chad Gray
Well it works in IE at least.  In firefox I get an error

missing } in XML expression
[Break on this error] document.form1.action = PayPalTest.cfm;\n




 -Original Message-
 From: Chad Gray [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 12:27 PM
 To: CF-Talk
 Subject: RE: paypal cart
 
 OH my... You can submit to two different action pages.  The index.cfm page
 is what is displayed because it was the last function run.
 
 
 script languagescript language=javascript
 function loginHandler1()
 {
 document.form1.action = PayPalTest.cfm;
 document.form1.submit();
 }
 
 function loginHandler2()
 {
 document.form1.action = index.cfm;
 document.form1.submit();
 }
 /script
 
 form name=form1 action= method=post 
 pUsername: input type=text name=usercode value=/p
 pPassword: input type=password name=password value=/p
 pinput type=button value=login
 onclick=loginHandler1();loginHandler2();/p
 /form
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309874
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: paypal cart

2008-07-29 Thread Chad Gray
Ok last post, it does work in Firefox and IE.  I just had a big typo on my 
script declaration.



 -Original Message-
 From: Chad Gray [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 12:39 PM
 To: CF-Talk
 Subject: RE: paypal cart
 
 Well it works in IE at least.  In firefox I get an error
 
 missing } in XML expression
 [Break on this error] document.form1.action = PayPalTest.cfm;\n
 
 
 
 
  -Original Message-
  From: Chad Gray [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 29, 2008 12:27 PM
  To: CF-Talk
  Subject: RE: paypal cart
 
  OH my... You can submit to two different action pages.  The index.cfm
 page
  is what is displayed because it was the last function run.
 
 
  script languagescript language=javascript
  function loginHandler1()
  {
  document.form1.action = PayPalTest.cfm;
  document.form1.submit();
  }
 
  function loginHandler2()
  {
  document.form1.action = index.cfm;
  document.form1.submit();
  }
  /script
 
  form name=form1 action= method=post 
  pUsername: input type=text name=usercode value=/p
  pPassword: input type=password name=password value=/p
  pinput type=button value=login
  onclick=loginHandler1();loginHandler2();/p
  /form
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309875
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: paypal cart

2008-07-29 Thread William Seiter
Simple hack might be to have a 'hidden field' on your form that concats the 4 
fields into 1 field with a specified delimeter.  This way you are passing one 
var with all 4 lines.  When it returns from the paypal side, you can 'parse' 
the data into four lines again using the specified delimeter.

Just a thought,
William

 Hello,
 
 I have run into a situation where PayPals add to cart buttons are 
 not going to work for me.  So I am looking for ideas on how to 
 accomplish this.
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309877
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: paypal cart

2008-07-29 Thread Chad Gray
I thought of that, but they also only allow like 80 characters per option.  So 
there is a chance that information could get truncated.

I think the form submitting to two action pages is going to work.  I have not 
found a problem with it yet.  Of course if one action page fails then I loose 
the link between the purchase and the details on the item purchased.  So they 
would have to pick up the phone and find out what they wanted printed on the 
cards.




 -Original Message-
 From: William Seiter [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 1:39 PM
 To: CF-Talk
 Subject: Re: paypal cart
 
 Simple hack might be to have a 'hidden field' on your form that concats
 the 4 fields into 1 field with a specified delimeter.  This way you are
 passing one var with all 4 lines.  When it returns from the paypal side,
 you can 'parse' the data into four lines again using the specified
 delimeter.
 
 Just a thought,
 William
 
  Hello,
 
  I have run into a situation where PayPals add to cart buttons are
  not going to work for me.  So I am looking for ideas on how to
  accomplish this.
 
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309879
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: paypal cart

2008-07-29 Thread Claude Schneegans
 Simple hack might be to have a 'hidden field' on your form that 
concats the 4 fields into 1 field with a specified delimeter.  This way 
you are passing one var with all 4 lines.  When it returns from the 
paypal side, you can 'parse' the data into four lines again using the 
specified delimeter.

This is also what I'm doing.
However, the paypal IPN will nor return any field you provide in the form
(I wonder why) But there is one called CUSTOM that can be used for that 
purpose.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309880
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: paypal cart

2008-07-29 Thread Eric Haskins
Chad,

I guess I am kind of lost as to what the problem or what your trying to do
then. I have used paypal in many apps and have had no problem storing the
customers order in a db sending the data to paypal with the itemid being
their cart/orderid. Then paypal IPN notifing my cart the txn was successful.

All the data is in the db that they typed without it being truncated.

Eric




On Tue, Jul 29, 2008 at 2:13 PM, Chad Gray [EMAIL PROTECTED] wrote:

 I thought of that, but they also only allow like 80 characters per option.
  So there is a chance that information could get truncated.

 I think the form submitting to two action pages is going to work.  I have
 not found a problem with it yet.  Of course if one action page fails then I
 loose the link between the purchase and the details on the item purchased.
  So they would have to pick up the phone and find out what they wanted
 printed on the cards.




  -Original Message-
  From: William Seiter [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 29, 2008 1:39 PM
  To: CF-Talk
  Subject: Re: paypal cart
 
  Simple hack might be to have a 'hidden field' on your form that concats
  the 4 fields into 1 field with a specified delimeter.  This way you are
  passing one var with all 4 lines.  When it returns from the paypal side,
  you can 'parse' the data into four lines again using the specified
  delimeter.
 
  Just a thought,
  William
 
   Hello,
  
   I have run into a situation where PayPals add to cart buttons are
   not going to work for me.  So I am looking for ideas on how to
   accomplish this.
  
  


 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309900
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: paypal cart

2008-07-29 Thread Chad Gray
When they customize the business card with text like Name, Address, Cell phone 
etc, I am collecting that data on the page where the Add To Cart button is.  So 
when they submit the form it goes to PayPal and I loose what they have typed in 
because paypal ignores inputs that it does not use.

I could submit to a page that does the database insert then have them click the 
PayPal Cart button to add it to the shopping cart, but why make them submit 
twice?

The Custom field in the IPN is 200 characters and I will probably will use it 
for a backup, but 200 characters is not a lot and I don't want to take a chance 
of truncating data.






 -Original Message-
 From: Eric Haskins [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 29, 2008 4:08 PM
 To: CF-Talk
 Subject: Re: paypal cart
 
 Chad,
 
 I guess I am kind of lost as to what the problem or what your trying to do
 then. I have used paypal in many apps and have had no problem storing the
 customers order in a db sending the data to paypal with the itemid being
 their cart/orderid. Then paypal IPN notifing my cart the txn was
 successful.
 
 All the data is in the db that they typed without it being truncated.
 
 Eric
 
 
 
 
 On Tue, Jul 29, 2008 at 2:13 PM, Chad Gray [EMAIL PROTECTED] wrote:
 
  I thought of that, but they also only allow like 80 characters per
 option.
   So there is a chance that information could get truncated.
 
  I think the form submitting to two action pages is going to work.  I
 have
  not found a problem with it yet.  Of course if one action page fails
 then I
  loose the link between the purchase and the details on the item
 purchased.
   So they would have to pick up the phone and find out what they wanted
  printed on the cards.
 
 
 
 
   -Original Message-
   From: William Seiter [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, July 29, 2008 1:39 PM
   To: CF-Talk
   Subject: Re: paypal cart
  
   Simple hack might be to have a 'hidden field' on your form that
 concats
   the 4 fields into 1 field with a specified delimeter.  This way you
 are
   passing one var with all 4 lines.  When it returns from the paypal
 side,
   you can 'parse' the data into four lines again using the specified
   delimeter.
  
   Just a thought,
   William
  
Hello,
   
I have run into a situation where PayPals add to cart buttons are
not going to work for me.  So I am looking for ideas on how to
accomplish this.
   
   
 
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309901
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4