Question

I am having a peculiar problem implementing recurring payment for a webapp that I am developing. I could not use a hosted paypal subscription button, because the payment sum would be variable. So, I used a non hosted solution something like this :

<form action="https://www.sandbox.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="business@email.com">
<input type="hidden" name="item_name" value="Some item"/>
<input type="hidden" name="return" value="return_url">
<input type="hidden" name="cancel_return" value="cancel_url">
<input type="hidden" name="notify_url" value="notification_url">

<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="variable_amount">
<input type="hidden" name="p3" value="1"> 
<input type="hidden" name="t3" value="M">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="custom" value="planid1,planid2"/>
</form>

Now, I need to check every month using a cron that who has paid, and generate content according to that.

From the discussions all over the internet, it is clear that paypal doesn't send txn_id for the subscription. So, how am I supposed to check if user has paid in the next month or not? One thing that comes to my mind is an IPN listener, but will that work with a non-hosted button? Totally confused with this. Could someone point me to the right direction?

Was it helpful?

Solution

IPN would be the way to go. With IPN, your system would be notified when the profile is created, when the profile bills the user again, when the profile is canceld, or when it fails to bill. You would also get the transaction id back in the IPN each thim the profile is charged.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top