Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
another_noob

Paypal Integration Confusion

Recommended Posts

First, thank you Larry for your great books. I really appriciate your "no nonsense" approach to presenting this complex material. I have learned a lot. I have also learned a lot from this forum.

I have a general question about PayPal integration. I have built my site based mainly on the material in "PHP and MySQL for Dynamic Web Sites" with chapter 19 (E-Commerce example) helping me tie things together. I then bought the Effortless E-Commerce book hoping to integrate PayPal. I am stuck on how I send the values in my qty, sub-total, shipping, total etc.. variables to PayPal. The price of my goods vary immensly, so I can't use fixed price "buy it now" buttons. I just want a buyer to put the items in their cart, get a total with shipping (up to here it is all working great) click a PayPal button and have these values magically appear in PayPal and have the financial transaction completed at PayPal's site. I don't understand how I get that data to PayPal. I have a sandbox account to play in, but I can't find the answer at PayPal. Everywhere I look on-line I see the same advice, drop this PayPal HTML button code in and you are all set. Where does the transfer of data from my site to PayPal take place? I am missing something somewhere. I am not live and am running in localhost. I can't even get the sanbox to work with localhost, I never leave localhost when I click a PayPal button. Can someone explain to this noob how this works, i mean just in general? I hope this post makes sense. Thanks.

Share this post


Link to post
Share on other sites

Thanks for the reply and the link rob. I will study chapter 7 and the pdf. Maybe I am just overly complicating things in my head. I will step away for a day and re-attack the challenge with (hopefully) a clearer understanding. Thanks.

Share this post


Link to post
Share on other sites

After reading the PayPal manual chapter 7, I did get a better understanding, thanks for pointing me there. I am still a bit confused though. If I want to send my cart as an aggregate amount for example, I am supposed to use the following example HTML:

 

<form action="https://www.sandbox.paypal.com/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="seller@designerfotos.com">

<input type="hidden" name="item_name_1" value="Aggregated items">

<input type="hidden" name="amount_1" value="3.00">

<input type="submit" value="PayPal">

</form>

 

This HTML works except I always am billing the buyer $3.00. If I put my PHP variable $total (which holds lets say 63.99) as value="$total"

I get the following error returned from PayPal "The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

If I put literal dollar amount as value, like say 63.99, then everything works. How do I format a PHP variable to send the amount with this HTML? Thanks.

Share this post


Link to post
Share on other sites

Thank you MrJames! That corrected the issue. It is now working great. I searched the vast internet and couldn't find the answer anywhere. Thank You MrJames and Thank You Larry for supporting your books so well.

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...