gamingdoneright Posted August 20, 2007 Posted August 20, 2007 Hi guys first time poster but a fairly long customer. I have had no luck in finding out how to do this but I want to be able to create a form that will automatically generate a price for a paypal subscription. When selling game servers there is a lot of variables for customers to choose from giving almost every customer a different price, if I were to make every subscription separately there could literally be over a thousand. https://www.gameservers.com/order/step2.php?game=24&type=public&players=10 is a good example of what I would want to accomplish. I looked through the paypal documentation and found out how to create a custom button through code, but I am afraid I don't have enough knowledge of creating forms for it to input variables that the customer selects. Any help would be much appreciated. Below is an example of the code you use to create a button. <form action="http://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="lm_paypal_setbiz(this,'sales','gamingdoneright.com')"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="business" value=""> <input type="hidden" name="notify_url" value="http://gamingdoneright.com/main/?q=lm_paypal/ipn"> <input type="hidden" name="item_name" value="Counter Strike:Source 10 Slot Quarterly"> <input type="hidden" name="item_number" value="5"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://gamingdoneright.com/main/?q=/lm_paypal/subscriptions_inprogress">'>http://gamingdoneright.com/main/?q=/lm_paypal/subscriptions_inprogress"> <input type="hidden" name="cancel_return" value="http://gamingdoneright.com/main/?q=/lm_paypal/subscriptions_inprogress"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a3" value="57.00"> <input type="hidden" name="p3" value="3"> <input type="hidden" name="t3" value="M"> <input type="hidden" name="src" value="1"> <input type="hidden" name="sra" value="1"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="custom" value="1"> <input type="hidden" name="usr_manage" value="0"> <input type="image" src="http://images.paypal.com/images/x-click-butcc-subscribe.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> Quote
TCH-Andy Posted August 20, 2007 Posted August 20, 2007 welcome to the forums gamingdoneright I'd suggest the first step is you look at the source code to the page they link. That uses inline Java code to define the price. When then user has completed the form it then runs a short script which is passed the variables ( form name='signup' method='post' action='step2.php' ) which can send the price to paypal. Which part is it that you are struggling with ? All the changing of the price ( which they have done in Java), the passing of that variable to the step2.php script or passing the info to paypal ? Quote
TCH-Thomas Posted August 20, 2007 Posted August 20, 2007 Welcome to the forum, gamingdoneright. Quote
gamingdoneright Posted August 20, 2007 Author Posted August 20, 2007 thx guys, I would first of all need to know how to create that type of form that could successfully pass it's variables into creating a paypal subscription button (or passing directly to paypal) I am a noob at javascript as you can see, so if you could just give me a step in the right direction to learning how to create forms that can pass multiple variables on to paypal that would be great. Quote
TCH-Bruce Posted August 20, 2007 Posted August 20, 2007 Just like any web form. Take a look at w3schools for some form building information. Quote
gamingdoneright Posted August 21, 2007 Author Posted August 21, 2007 Thx for the link Bruce, after looking through a bit of those tuts and some on php.net I was able to create a php file that received those variables and input them into the paypal subscription form which was then automatically directed to paypal. Exactly what I wanted . Thanks for the help. Quote
TCH-Bruce Posted August 21, 2007 Posted August 21, 2007 Glad I could point you in the right direction. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.