Jump to content

Do not allow payment if there is an active paypal subscription


consc198

Recommended Posts

not a module, but there is a possible solution in the thread below that would rename the subject of the invoice created emails for those with Paypal subscriptions... that, in addition to modifying the content of the email, might help to lessen the number of clients doing this.

 

http://forum.whmcs.com/showthread.php?108439-PayPal-Subscriptions

Link to comment
Share on other sites

not a module, but there is a possible solution in the thread below that would rename the subject of the invoice created emails for those with Paypal subscriptions... that, in addition to modifying the content of the email, might help to lessen the number of clients doing this.

 

http://forum.whmcs.com/showthread.php?108439-PayPal-Subscriptions

 

Hello!

 

I've already implemented a solution similar to that for 2 months, although it did reduce the amount of payments there were still a high number of cases which is why I want a solution on the actual page where a user goes to pay the invoice.

Link to comment
Share on other sites

Hi,

 

I've already implemented a solution similar to that for 2 months, although it did reduce the amount of payments there were still a high number of cases which is why I want a solution on the actual page where a user goes to pay the invoice.

it's possible that you might be able to achieve what you want just by a couple of changes to the six/viewinvoice.tpl template... something along these lines..

 

firstly, @ line ~ 56...

 

                    {if $status eq "Unpaid"}
                       <div class="small-text">
                           {$LANG.invoicesdatedue}: {$datedue}
                       </div>
                       <div class="payment-btn-container" align="center">
                           {$paymentbutton}
                       </div>
                   {/if}

with...

 

                    {if $status eq "Unpaid" and !$subscribid}
                       <div class="small-text">
                           {$LANG.invoicesdatedue}: {$datedue}
                       </div>
                       <div class="payment-btn-container" align="center">
                           {$paymentbutton}
                       </div>
                   {/if}

and then @ line ~109 replace...

 

                 {if $status eq "Unpaid" && $allowchangegateway}
                           <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}" class="form-inline">
                               {$gatewaydropdown}
                           </form>
                       {else}
                           {$paymentmethod}
                       {/if}

with...

 

                        {if !$subscribid}
                       {if $status eq "Unpaid" && $allowchangegateway}
                           <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}" class="form-inline">
                               {$gatewaydropdown}
                           </form>
                       {else}
                           {$paymentmethod}
                       {/if}
                       {else}You already have a Paypal subscription{/if}

untested as I haven't got a Paypal subscription setup in my v6 dev to try this with, but what should happen is when a client who has a subscription visits the viewinvoice page, the payment links at the top and the gateway dropdown should be removed and they'll see a message saying "You already have a Paypal subscription" - so they should be unable to make a payment.

 

if you have a client (who has a subscription) with unpaid invoices, you should be able to test this yourself to see if it works.

Link to comment
Share on other sites

Hi,

 

 

it's possible that you might be able to achieve what you want just by a couple of changes to the six/viewinvoice.tpl template... something along these lines..

 

firstly, @ line ~ 56...

 

                    {if $status eq "Unpaid"}
                       <div class="small-text">
                           {$LANG.invoicesdatedue}: {$datedue}
                       </div>
                       <div class="payment-btn-container" align="center">
                           {$paymentbutton}
                       </div>
                   {/if}

with...

 

                    {if $status eq "Unpaid" and !$subscribid}
                       <div class="small-text">
                           {$LANG.invoicesdatedue}: {$datedue}
                       </div>
                       <div class="payment-btn-container" align="center">
                           {$paymentbutton}
                       </div>
                   {/if}

and then @ line ~109 replace...

 

                 {if $status eq "Unpaid" && $allowchangegateway}
                           <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}" class="form-inline">
                               {$gatewaydropdown}
                           </form>
                       {else}
                           {$paymentmethod}
                       {/if}

with...

 

                        {if !$subscribid}
                       {if $status eq "Unpaid" && $allowchangegateway}
                           <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}" class="form-inline">
                               {$gatewaydropdown}
                           </form>
                       {else}
                           {$paymentmethod}
                       {/if}
                       {else}You already have a Paypal subscription{/if}

untested as I haven't got a Paypal subscription setup in my v6 dev to try this with, but what should happen is when a client who has a subscription visits the viewinvoice page, the payment links at the top and the gateway dropdown should be removed and they'll see a message saying "You already have a Paypal subscription" - so they should be unable to make a payment.

 

if you have a client (who has a subscription) with unpaid invoices, you should be able to test this yourself to see if it works.

 

Cool, much appreciated - I'll get this tested soon and update here.

Link to comment
Share on other sites

apologies, typo on my part... it should be $subscrid and not $subscribid - can you try again and see if a client with a subscription returns any value for that variable.

 

Ah no problems - that indeed did the trick! very useful and in my opinion WHMCS should incorporate this in their code asap as for me this will reduce the inconvenience of having to refund duplicate payments.

Link to comment
Share on other sites

Ah no problems - that indeed did the trick! very useful and in my opinion WHMCS should incorporate this in their code asap as for me this will reduce the inconvenience of having to refund duplicate payments.

 

This works if you are sure that all your customers paypal subscriptions are active, if the subscription is suspended the subscription ID is still in WHMCS but Paypal doesn't charge the amount and you lose money.

Link to comment
Share on other sites

This works if you are sure that all your customers paypal subscriptions are active, if the subscription is suspended the subscription ID is still in WHMCS but Paypal doesn't charge the amount and you lose money.

well if WHMCS doesn't store the subscription suspension in the database, there's little that can be done... although, I guess you could probably write an addon to use the paypal api and check the subscription status, but seems a lot of hassle to me.

 

as was suggested in the other thread, the better solution might be to switch to using Paypal billing agreements instead.

 

http://forum.whmcs.com/showthread.php?85106-MyWorks-WHMCS-PayPal-Billing-Agreements-Payment-Gateway

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.

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