Jump to content

Different paypal accounts based on value


Kr0nic

Recommended Posts

Hi,

 

I have two different paypal accounts, one with their micro-transaction rate, and one with the normal rate.

 

The micro-transaction rate is cheaper for values less than ~£10.

 

Is there a way within WHMCS I can force payments under a certain value to go with the one account and over this threshold the other account?

 

Seems like paypal should really have a system to apply the rates but there we go...

 

Any advice would be greatly appreciated.

 

Thanks!

Link to comment
Share on other sites

this is going to be a variation on the post below from yesterday...

 

http://forum.whmcs.com/showthread.php?89535-Disallow-ordering-domains-via-PayPal

 

in that case, it removed paypal if only a domain was registered - in your case, you will want to remove one of the paypal options based on the order total.

 

to make the modifications, you'll need to share three things - first, the names used by WHMCS for your two Paypal gateways; second, which order-form template you're using and finally, if you are using multiple currencies or only UK Sterling.

Link to comment
Share on other sites

Thanks for your reply - I did conduct a search however that post didn't show, it looks like it does direct me on the right path.

 

I'm using the vertical steps cart.

Paypal gateway for micro-payments: 'PayPal'.

Other: 'PayPal Payment'.

Just UK Sterling.

 

Thanks!

Link to comment
Share on other sites

it's going to be along the lines of the following... this is viewcart.tpl ~line #277

 

<h2>{$LANG.orderpaymentmethod}</h2>
<p align="center">{foreach key=num item=gateway from=$gateways}
{if ($gateway.name eq "PayPal" and $rawtotal gt 10) or ($gateway.name eq "PayPal Payment" and $rawtotal lte 10)}
{else}
<input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /><label for="pgbtn{$num}">{$gateway.name}</label> {/if}{/foreach}</p>

so, if the order value is greater than £10, it removes the micro-payment Paypal as a payment option; if the order is less than or equal to £10, it removes the normal Paypal account option.

 

btw, i've used the names that you've called the gateway accounts, WHMCS will call them something else - one will almost certainly be "paypal" (lowercase)... the point being that what WHMCS calls them is fixed; what you call them can be changed - so if you do ever change your gateway names, remember to change their values in the above code.

 

test the code in your cart and let me know if there are any issues.

Link to comment
Share on other sites

Will whmcs save the preference for the gateway for repeat payments or will this only work on first payment, when the cart it used?

if they're a new customer, then whmcs should save the chosen gateway as their default method for future invoices...

 

that said, there is nothing to stop you from making a similar modification to viewinvoice.tpl, whereby when customers (new or old) go to pay their invoices, they are given the same choice... less than £10 via micro paypal, over £10 by paypal and/or others... that way, you wouldn't have to worry about what their default payment method is - though you would have to enable "Clients Choose Gateway" (general settings -> invoices) for this to be a workable solution.

 

the one downside is that with the viewinvoice page, you can't directly access the invoice total as a number, it's actually a string - meaning that you can't calculate whether it is less or greater than another number - so you'd either have to do some php manipulation on it to obtain the amount, or get the total by querying the database... of the two, querying the db is probably the easier path as it is stored as a number...

 

while the solution for the cart was just one if statement, I suspect the equivalent solution for viewinvoice would be longer.

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