- Impact
- 44
Hello everyone :wave:
I am not much of a PHP coder but I know some, so I decided to put toghether a small script for people selling items who are tired of making a subscription page for each item! This way you create the url, put it on your site and the payment is sent to you! Nifty, huh?
Here it goes,
Now this is what you do,
1) Put all this code into paypal.php (or what ever page you want, make sure your website supports PHP and you have it ending in a .php extention)
2) Here is the tricky part, making the url.
Here is a example of what the url will look like,
Ok so,
Item - Shows what's the items name, for example: Hosting Plan Basic
Price - This is pretty explanitory, do not include the $, this comes in on the currency part
Currency - Put the Currency you want to accept
Shipping- Leave to 0 if no shipping, or put too 1 if there is shipping included
Time - This is the recuring payment part, put M for montly, Y for yearly, etc
PaypalEmail - This is your paypal email
CompanyName - Self Explanitory
WebsiteURL - Self Explanitory
The whole script is basically self explanitory, but I made it as simple as I could for the new end user to paypal subscriptions.
If you like the script, rep is appreciated
Thanks,
Camron
I am not much of a PHP coder but I know some, so I decided to put toghether a small script for people selling items who are tired of making a subscription page for each item! This way you create the url, put it on your site and the payment is sent to you! Nifty, huh?
Here it goes,
Code:
<?php
// Time for item information
$Item=$_GET['Item'];
$Price=$_GET['Price'];
$Currency=$_GET['Currency'];
$Shipping=$_GET['Shipping'];
$Time=$_GET['Time'];
// Time for the sellers information
$PaypalEmail=$_GET['PaypalEmail'];
$CompanyName=$_GET['CompanyName'];
$WebsiteURL=$_GET['WebsiteURL'];
?>
Thank you for choosing to purchase from <a href="<?php echo "$WebsiteURL"; ?>"><?php echo "$CompanyName"; ?></a>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="<?php echo "$PaypalEmail"; ?>">
<input type="hidden" name="currency_code" value="<?php echo "$Currency"; ?>">
<input type="hidden" name="no_shipping" value="<?php echo "$Shipping"; ?>">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="<?php echo "$Price"; ?>">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="<?php echo "$Time"; ?>">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
Now this is what you do,
1) Put all this code into paypal.php (or what ever page you want, make sure your website supports PHP and you have it ending in a .php extention)
2) Here is the tricky part, making the url.
Here is a example of what the url will look like,
http://www.mydomain.com/paypal.php?Item=Hosting&Price=5.00&Currency=USD&Shipping=0&Time=M&PaypalEmail=[email protected]&CompanyName=YourCompany&WebsiteURL=http://www.yourdomain.com
Ok so,
Item - Shows what's the items name, for example: Hosting Plan Basic
Price - This is pretty explanitory, do not include the $, this comes in on the currency part
Currency - Put the Currency you want to accept
Shipping- Leave to 0 if no shipping, or put too 1 if there is shipping included
Time - This is the recuring payment part, put M for montly, Y for yearly, etc
PaypalEmail - This is your paypal email
CompanyName - Self Explanitory
WebsiteURL - Self Explanitory
The whole script is basically self explanitory, but I made it as simple as I could for the new end user to paypal subscriptions.
If you like the script, rep is appreciated
Thanks,
Camron





