Jump to content

PayPal Subscription Unsubscribe Button


jclarke

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated