I have seen many related questions but didn\'t find any answer.
I have successfully implemented transactions through paypal but now I am asked to implement recurring pay
Try The following Codes :
$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', "Magic Niche Finder Subscription - Monthly( $$amount )"); $paypalObj->add_field('business', "test@yahoo.com"); $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();
In this list there are all the Docs you need. theese are not casual links taken from the net, theese are a set of links i have collected when i had to do exactly the same thing you are trying to do now. ;)
happy coding. ;)
You can get the solution from the following reference url's.....
http://www.techrepublic.com/article/handling-recurring-payments-with-paypal-subscriptions-and-ipn/5331883
http://help.wildapricot.com/display/DOC/Recurring+payments+with+PayPal+Standard
https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-recurring-billing-overview-outside
It seems like you need to start creating Recurring Payment Profiles for your users.
The documentation for that can be found here. I also came across a PHP Script that looks like it has all the code in it you'll need.
from what i understand from your question, i think paypal's Preapproval API definitely will be able to help you. I am currently working on this recurring payment as well and i manage to meet up with a paypal staff to discuss about their formula and this is what they have recommended.
You can read more about their API from my link below to understand how pre-approval works and how it can help you automatically deduct money from client's paypal account as long as they do not enter their paypal account to manually cancel the option after they opt for it.
https://www.x.com/docs/DOC-1419
Q> What to change in my already running paypal script to have recurring paypal payments?
A> It depends on your current script. For example, if you have used Paypal-hosted Buy Now button, you might want to do the same for the Subscribe button. After doing this, you will see the differences between HTML forms you need to submit. There are just a few differences, but you either need to make some Javascript hacks to ensure you're sending the right stuff, or create separate forms.
Recurring details will be asked at time of payment.
Not sure if this was a question, but if so, I don't understand what is being asked here :(
Q> What additional parameters to be sent now to have this?
A> As I answered in my previous question, it depends on how you are doing it currently. <INPUT type="hidden" name="hosted_button_id" ...
will likely be different if you use hosted buttons, you might also need to send recurring payment details, etc.
Q> How to test it on already running application?
A> The same way you would test any other IPN payment.
Q> What parameters paypal will send back to me as ipn?
A> I am getting one extra parameter, subscr_id
. But it's probably best to look at the manual.