jclarke Posted December 29, 2012 Share Posted December 29, 2012 Often times customers forget to cancel their PayPal subscription and it is not possible to automatically cancel a PayPal subscription from the API unless you have the Enhanced Recurring Payments service. To help with this, you can add a PayPal unsubscribe button on the cancellation confirmation page. To do this, edit the clientareacancelrequest.tpl template file and find the following: {elseif $requested} <div class="alert alert-success"> <p>{$LANG.clientareacancelconfirmation}</p> </div> Directly under the </div> add the following: {php} $results = select_query("tblhosting","subscriptionid", array("id" => $this->get_template_vars('id'), "paymentmethod" => "paypal")); $service_details = mysql_fetch_array($results); if ($service_details) { $this->assign('subscription_id',$service_details['subscriptionid']); } {/php} {if $subscription_id} <div class="alert"> <p>If you have not already cancelled your PayPal subscription, please do so now by clicking the unsubscribe button below:<br> <A HREF="https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=paypal%40yourdomain%2ecom"> <IMG SRC="https://www.paypalobjects.com/en_US/i/btn/btn_unsubscribe_LG.gif" BORDER="0"> </A> </p> </div> {/if} Next, edit the alias=paypal%40yourdomain%2ecom line in the unsubscribe button html code above and change this to your PayPal email address or your secure merchant account ID. Note, your email address needs to be encoded as shown above instead of using @ and . With this code added, after a customer cancels a service, if the service had a subscription id and was set to use the payment method of PayPal the unsubscribe button will be shown. 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted December 29, 2012 Share Posted December 29, 2012 just a question on the email sintax you write alias=paypal%40yourdomain%2ecom" is correct ? alias=admin%40myemail%2eit" thanks 0 Quote Link to comment Share on other sites More sharing options...
Bubka3 Posted December 30, 2012 Share Posted December 30, 2012 just a question on the email sintaxyou write alias=paypal%40yourdomain%2ecom" is correct ? alias=admin%40myemail%2eit" thanks That's correct. You should also add that link in your cancellation email. 0 Quote Link to comment Share on other sites More sharing options...
Dedigeeks-Sean Posted January 13, 2013 Share Posted January 13, 2013 When you say to "find", there is no DIV tags where you advise them to be, in fact there is no DIV tag at all. Would this work the same way if we actually inserted this under the {/if} tags at the end? 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted January 13, 2013 Author Share Posted January 13, 2013 If you don't see a div tag than you must be using an older portal based theme. Place the above code after this line: <p>{$LANG.clientareacancelconfirmation}</p> 0 Quote Link to comment Share on other sites More sharing options...
GoRhY Posted April 11, 2013 Share Posted April 11, 2013 Where do we have to put our merchant account ID? 0 Quote Link to comment Share on other sites More sharing options...
SergeyM Posted June 5, 2013 Share Posted June 5, 2013 Thanks! thats an great addon! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.