WikiSoftBlog
After extensive searching on this topic I have uncovered the easiest way to send customizable invoices through email generated with PHP variables.
If you are trying to do something similar to this you may have thought it would be easier than it actually was. Paypal will have you think that you need to add an item through their interface for every item you want a button for.
In actuality you can simply past this code
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value=youremail@youremail.com>
<input type="hidden" name="item_name" value="DryCleaning">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="<?php echo $current; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.yoursite.com/returnpage.php">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but02.gif" border="0" name="submit" alt="Make your payments with PayPal. It is free, secure, effective.">
<img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
Notice how I did the php echo of the price variable? That's the trick...
Now you may also be asking how do you put this in an email?
Well you don't put this in an email because emails first off vary and there is no platform between gmail, yahoo mail, outlook, thunderbird, etc.. etc.. etc.... not to mention some browsers or users refuse to view email using html for spam reasons.
So we need them to go back to their browser. So simply take the price that you wanted them to pay that was sent to the email and create and echo the variables you want into a link in their email.
Then use GET commands to pull that information and create the button from the code we made above.
if you are unfamilar with get variables there is a good tutorial on them here : http://www.w3schools.com/PHP/php_get.asp
Let me know if you have any questions.
Thanks,
Matt


































Leave a comment