Hi Folks, I have been using Micah Carrick's PAYPAL IPN class till now for
web_accept
but now one of the Client wants to integrate the Recurring method into it.I tried using the same stuff but unfortunately was not so successful this time. I am trying to connect to the Paypal recurring method.Following is the code by which I trying to get to it;
$paypalObj = new paypal_class();
$itemName = "My Product";
$itemNumber = $itemName . " - Premium ($amount$)";
$paypalObj->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';// testing paypal url
//$paypalObj->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';// Live paypal url
$paypalObj->add_field('cmd','_xclick-subscriptions');
$paypalObj->add_field('txn_type', "recurring_payment");
$paypalObj->add_field('product_name', "My Product Subscription - Monthly( $$amount )");
$paypalObj->add_field('desc', "My Product Subscription - Monthly( $$amount )");
$paypalObj->add_field('business', "[email protected]");
$paypalObj->add_field('return', "http://".$serverName . "/buy-now.php");
$paypalObj->add_field('cancel_return', "http://".$serverName. "/return.php?action=cancel");
$paypalObj->add_field('notify_url', "http://" . $serverName . "/return.php?action=ipn");
$paypalObj->add_field('src', "1");
$paypalObj->add_field('sra', "1");
$paypalObj->add_field('a3', "$amount");
$paypalObj->add_field('t3', "M");
$paypalObj->add_field('p3', "1");
//$paypalObj->add_field('no_note', "1");
$paypalObj->add_field('currency_code', "USD");
$paypalObj->add_field('first_name', $firstName);
$paypalObj->add_field('last_name', $lastName);
$paypalObj->submit_paypal_post();
Code lets me to redirect to the Paypal sandbox(As I am still testing),but when I login onto Paypal sandbox it throws me this Error :
The link you have used to enter the PayPal system is invalid. Please review the link and try again.