Jump to content

Quick Mod - Disable Paypal Subscription for first invoice.


Recommended Posts

For those of you who accept Paypal and have "Require Shipping Address" and "Client Address Matching" selected, you might notice that these 2 things are not enforced when somebody pays with a Paypal Subscription, this has allowed quite a few stolen Paypal issues with us because if they click the Subscription button, it doesn't check or ask for any address info so they can pay with a stolen verified US account and still pass the Maxmind check by using their country for the order. For a few weeks we just forced one time payments but some clients wanted to setup subscriptions so here we are.


Just edit the viewinvoice.tpl file in /templates/YOURTEMPLATE/ with the following:



Replace with:

global $allowsub;
$userid = $this->_tpl_vars['clientsdetails']['userid'];
$result = mysql_query("SELECT id FROM tblinvoices WHERE userid=$userid AND status='Paid'");
if (mysql_num_rows($result) > 0) {
{if $allowsub eq "1"}
{$paymentbutton|replace:'<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Subscribe with PayPal for Automatic Payments">':' '}

That's it, it's very basic but it meets my needs for now. I tested this with a few accounts and new orders and it worked properly (although it's probably not 100% foolproof since clients can see the Paypal Subscription info in the page source).


Don't forget to delete the viewinvoice file from the template cache folder (templates_c is the default name I think).

Link to comment
Share on other sites

Join the conversation

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

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