Jump to content

Paypal Autogenerate Subscription Form

Recommended Posts

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!">


Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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.

Link to comment
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.

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.


  • Create New...