os_paypal_pro + Recurring Payment

  • rajeev
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #38470 by rajeev
os_paypal_pro + Recurring Payment was created by rajeev
How we enable Recurring Payment for os_paypal_pro.
The plugin os_paypal_pro working fine for Paypal-Pro method without Recurring enable.

My problem is that how we use Recurring system for this Plugin.


Please help me as soon as possible.

Thanks in advanced

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #38507 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: os_paypal_pro + Recurring Payment
Hi

Sorry. But at the moment, the Paypal Pro payment plugin only support onetime payment, not recurring. So if you want to have recurring subscription, you will need to customize the code yourself.

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • rajeev
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #38549 by rajeev
Replied by rajeev on topic Re: os_paypal_pro + Recurring Payment
Hello Friends,

Finally i have done Recurring Payment System for os_paypal_pro plugin.
Please follow following steps if you want this feature in your os_paypal_pro plugin :-

1) First go to your database ( phpmyadmin ) area and browse the prefix_osmembership_plugins table and click on edit button near to os_paypal_pro plugin and set the support_recurring_subscription value is 1 .

2) Add following function in os_paypal_pro.php file . ( components/com_osmembership/plugins/os_paypal_pro.php )

function processRecurringPayment($row, $data){

$mainframe = & JFactory::getApplication();
$Itemid = JRequest::getInt('Itemid');
$this->setParam('PAYMENTACTION', 'Sale');
$this->setParam('AMT', round($data, 2));
$this->setParam('CREDITCARDTYPE', $data);
$this->setParam('ACCT', $data);
$this->setParam('EXPDATE', $data.$data);
$this->setParam('CVV2', $data);
$this->setParam('FIRSTNAME', $data);
$this->setParam('LASTNAME', $data);
$this->setParam('STREET', $data);
$this->setParam('CITY', $data);
$this->setParam('STATE', $data);
$this->setParam('ZIP', $data) ;
$this->setParam('COUNTRYCODE', OSMembershipHelper::getCountryCode($data));
$this->setParam('CURRENCYCODE', 'USD');
$this->setParam('METHOD','CreateRecurringPaymentsProfile') ;

// Recurring Paremeter
$this->setParam('BILLINGPERIOD', urlencode('Month'));
$this->setParam('BILLINGFREQUENCY', 12);
$this->setParam('INITAMT', round($data, 2));
$this->setParam('FAILEDINITAMTACTION', urlencode("ContinueOnFailure"));
$this->setParam('DESC', urlencode("Recurring $".$data));
$this->setParam('AUTOBILLAMT', urlencode("AddToNextBilling"));
$this->setParam('PROFILEREFERENCE', urlencode("Anonymous"));
// End Recurring Paremeter
$this->setParam('VERSION', $this->VERSION);
$this->setParam('PWD', $this->API_PASSWORD);
$this->setParam('USER', $this->API_USERNAME);
$this->setParam('SIGNATURE', $this->API_SIGNATURE);
$fields = '' ;

foreach ($this->params as $key=>$value) {
$fields.= "$key=" . urlencode($value) . "&";
}

$fields.= "PROFILESTARTDATE=".urlencode(date('Y-m-d H:i:s'));

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$this->API_ENDPOINT);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, "& "));

$response = curl_exec($ch);
$nvpResArray = $this->deformatNVP($response);


if ($nvpResArray == 'Success') {
$config = OSMembershipHelper::getConfig() ;

$row->transaction_id = $nvpResArray ;

$row->payment_date = date('Y-m-d H:i:s');

$row->published = 1 ;

$row->store();

if($row->act == 'upgrade') {

OSMembershipHelper::processUpgradeMembership($row);

}

OSMembershipHelper::sendEmails($row, $config);

JPluginHelper::importPlugin( 'osmembership' );

$dispatcher =& JDispatcher::getInstance();

$dispatcher->trigger( 'onMembershipActive', array($row));

$mainframe->redirect(JRoute::_('index.php?option=com_osmembership&view=complete&act='.$row->act.'&subscription_code='.$row->subscription_code.'&Itemid='.$Itemid, false, false));



return true;

} else {

$_SESSION = $this->getResponseText() ;
$mainframe->redirect(JRoute::_('index.php?option=com_osmembership&view=failure&id='.$row->id.'&Itemid='.$Itemid, false, false));

return false;

}


}

3) $this->setParam('BILLINGPERIOD', urlencode('Month'));
$this->setParam('BILLINGFREQUENCY', 12);

This value is currently hard-code you need to manage this value from admin area using your logic.

4) If you get error like (DPRP is disabled for this merchant) so you need to contact paypal services enable this options
check following URL :-
www.paidmembershipspro.com/2012/03/paypa...led-for-this-client/
www.paypal-community.com/t5/About-Paymen...disabled/td-p/654451

This is only issue (4 no) i get, The code is running properly with sandbox mode.

Enjoy :)

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #38579 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: os_paypal_pro + Recurring Payment
Nice works :). Would you mind to share the work back to us ? In exchange, I will make your subscription lifetime means you can upgrade to latest version of Membership Pro whenever you want. Would that be OK ?

Tuan

Please Log in or Create an account to join the conversation.

  • rajeev
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #38586 by rajeev
Replied by rajeev on topic Re: os_paypal_pro + Recurring Payment
Thank you for your offer, but we purchased this plugin for one of our customer and delivered it to them, so this benefit will not be for us. :( We will be however happy to provide you with the code and help in adding up this feature, if you can add our company as a technology associate/partner to your company. You can visit our website at www.syscraftonline.com and if we can get associated at some development level we will be happy to think over and proceed further with it.



Thanks
Rajeev

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #38637 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: os_paypal_pro + Recurring Payment
Hi Rajeev

Thanks so much but we could not do that. In this case, I think we will do the development ourself !

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • rajeev
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #38672 by rajeev
Replied by rajeev on topic Re: os_paypal_pro + Recurring Payment
Hello,

Not an issue, I can share the code I have added, just in case if its of any help to you. And if you feel we to add our company reference for it somewhere on the website, we will be privileged.


Thanks
Rajeev

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #39033 by Patrick
Replied by Patrick on topic Re: os_paypal_pro + Recurring Payment
Rajeev,
Pardon my barging into this thread, but I may require help effectively implementing recurring payments in our project. It seems to me this should have been included in a $20 payment plugin, I was shocked when I realized it was not.

Please contact me if you are interested.
Thanks

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #47711 by pierre.plante
Replied by pierre.plante on topic Re: os_paypal_pro + Recurring Payment
Hi,

I'll buy your Paypal Pro plugin. Recurring Payment System code is it now included by default in the plugin or do I enter the code manually myself.

Thanks.

Pierre

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #47749 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: os_paypal_pro + Recurring Payment
Hi Pierre

It has not included in the payment plugin by default yet. I planed to work on it this week, so it will be available before the end of this week

Please be patient and wait for us

Regards,

Tuan

Please Log in or Create an account to join the conversation.