Got stuck with this issue for last 2 days.
Scenario
We have a web based product where users can signup for free for 14 days and thereafter monthly subscription of say $60.00. Once users clicked "Pay with Paypal" button out page will taken users to Paypal and once they have done the payment it redirects back to our website. All the parameters were passed looks fine, since i tested with sandbox as merchant and user. we were using Return URL property on merchant profile setting under Website Payment Preferences.
Research
Most similar questions are Implementing a free trial period with PayPal and Paypal subscription free trial isn't working but my issue is bit different. And also the document pointed in the first question is not a valid link.
Issue
When user's being returned back to our website, we can not retrieve custom variable which we passed in during initial redirection to PayPal. Basically it was just a blank redirection without any query-string or post parameter. But then i try to charge an amount for first 14 days instead of free, then all query string returned. Our flow is depend on the custom parameter where we map pay pal id with actual customer data.
Our code looks like,
<form name='paypal' action='https://www.sandbox.paypal.com/cgi-bin/webscr' method='post'>
<input type='hidden' name='business' value='xxx@xxxxx.com'>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='cmd' value='_xclick-subscriptions'>
<input type='hidden' name='a3' value='60.00'>
<input type='hidden' name='item_name' value='Product A'>"
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='custom' value='parameter1|parameter2'>
<input type='hidden' name='item_number' value='PlanCode'>
<input type='hidden' name='p3' value='1'>"
<input type='hidden' name='t3' value='M'>"
<input type='hidden' name='a1' value='0'>"
<input type='hidden' name='p1' value='14'>"
<input type='hidden' name='t1' value='D'>
</form>
I tried by adding,
<input type='hidden' name='rm' value='1'>
But no luck.
Questions
- why i couldn't get callback parameters when "a1=0" for 14 days? But the same code works if i set "a1" bigger than 0?
- Am i missing any parameter? or i am using wrong approach on call back? (I am using Return URL)
- What about using IPN? I understood from PayPal site IPN is not real-time. Since our application relies on custom data for next signup flow, i wonder is it ok to use it? If so what would be the initial doc to be studied?