Jan 31st, 2011, 3:05 PM
Further to this endeavour:
I have starting looking at adding the fields and variables to pass to Paypal for a renewable subscription form. This has had some mixed results.
Here is what I added and where in the Code.
1. In my form code I added the subscription info I need for a 1yr renewable subscription at 100.00 /year.
2. I added the missing variables in the following files.
config.inc.php
Note I omitted some values as needed.
I am using the _xclick-subscriptions instead of the _xclick
As well I omitted the amount variable as this is now being replaced by the "a3" as required by the subscription model with Paypal.
3. In global_config.inc.php
I added the following lines as needed verifying that the variables I am using in my forms hidden values are used.
[/align]
Now the mixed results:
The good news is that the hidden data gets passed to Paypal and the form works and ends back at the success page.
The bad news is there is no processing step ( we go right to submit and paypal without any verification as before.
The transaction data is not logged with the formtools dbase. The success page does not pass any IPN data back at all- the fields are blank.
What am I missing?
The form is located at http://thecapc.ca/subscribe/join_capc_test.php For testing.
I have starting looking at adding the fields and variables to pass to Paypal for a renewable subscription form. This has had some mixed results.
Here is what I added and where in the Code.
1. In my form code I added the subscription info I need for a 1yr renewable subscription at 100.00 /year.
Code:
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<!--<input type="hidden" name="a1" value="0.00"> <!-- free trial=yes -->
<!--<input type="hidden" name="p1" value="1">--> <!-- length of trial period -->
<!--<input type="hidden" name="t1" value="M">--> <!-- period of trial=month -->
<input type="hidden" name="a3" value="100.00"> <!-- price of subscription -->
<input type="hidden" name="p3" value="1"> <!-- billing cycle length -->
<input type="hidden" name="t3" value="Y"> <!-- billing cycle unit=month -->
<input type="hidden" name="src" value="1"> <!-- recurring=yes -->
<input type="hidden" name="sra" value="1"> <!-- reattempt=yes -->
<!--<input type="hidden" name="srt" value="12">--> <!-- # of recurring payments -->
2. I added the missing variables in the following files.
config.inc.php
Code:
$paypal["currency_code"] = isset($_POST["currency_code"]) ? $_POST["currency_code"] : "";
$paypal["no_shipping"] = isset($_POST["no_shipping"]) ? $_POST["no_shipping"] : "";
$paypal["a3"] = isset($_POST["a3"]) ? $_POST["a3"] : ""; // amount
$paypal["p3"] = isset($_POST["p3"]) ? $_POST["p3"] : ""; //regualr billing cycle set at "1" per year
$paypal["t3"] = isset($_POST["t3"]) ? $_POST["t3"] : "";//values default "Y"(years)
$paypal["src"] = isset($_POST["src"]) ? $_POST["src"] : "";//values default 1
$paypal["sra"] = isset($_POST["sra"]) ? $_POST["sra"] : "";//values default 1
//$paypal["srt"] = isset($_POST["srt"]) ? $_POST["srt"] : ""; ----ommited no timelimit for payment reocurrance
$paypal["no_note"] = isset($_POST["no_note"]) ? $_POST["no_note"] : "";
Note I omitted some values as needed.
Code:
$paypal["cmd"] = "_xclick-subscriptions";
//$paypal["cmd"] = "_xclick"; // using subscription click
I am using the _xclick-subscriptions instead of the _xclick
As well I omitted the amount variable as this is now being replaced by the "a3" as required by the subscription model with Paypal.
3. In global_config.inc.php
I added the following lines as needed verifying that the variables I am using in my forms hidden values are used.
Code:
<input type="hidden" name="a3" value="<?php echo @$paypal[a3]?>" />
<input type="hidden" name="p3" value="<?php echo @$paypal[p3]?>" />
<input type="hidden" name="t3" value="<?php echo @$paypal[t3]?>" />
<input type="hidden" name="src" value="<?php echo @$paypal[src]?>" />
<input type="hidden" name="sra" value="<?php echo @$paypal[sra]?>" />
Now the mixed results:
The good news is that the hidden data gets passed to Paypal and the form works and ends back at the success page.
The bad news is there is no processing step ( we go right to submit and paypal without any verification as before.
The transaction data is not logged with the formtools dbase. The success page does not pass any IPN data back at all- the fields are blank.
What am I missing?
The form is located at http://thecapc.ca/subscribe/join_capc_test.php For testing.