Jump to content

Payment Gateway selection by Currency


basic

Recommended Posts

Dear All:

 

The "group" solution that WHMCS provides to assign payment gateways results in a lot of unnecessry work -- as every product that s offered in two different (or more) currencies needs to be duplicated. It is further flawed, as this does not work at all for domain registrations!

 

Under version 5.3 of WHMCS we had the below edits working to take care of this, but it does not work anymore in version 6.3.1, and I can't figure out why not. Does anyone understand, and how to fix this?

 

We use "six" and the "modern" shopping card ... the code below is a simplified version with just two currencies and two payment gateways.

 

.../[whms]/templates/orderforms/modern/viewcart.tpl

 

 

------------

(...)
{/if}
<h2>{$LANG.orderpaymentmethod}</h2>
{if $currency.id == 1}
<p><input type="radio" name="paymentmethod" id="pgbtn1" value="paypalbilling" onclick="hideCCForm()"{if $selectedgateway eq "paypalbilling"} checked="checked"{/if} /> <label for="pgbtn1"><b>PayPal</b></label><br />
<input type="radio" name="paymentmethod" value="authorizecim" id="pgbtn2" onclick="showCCForm()"{if $selectedgateway eq "authorizecim"} checked="checked"{/if} /> <label for="pgbtn2"><b>Credit Card</b></label><br />
{if $currency.id == 2}
<input type="radio" name="paymentmethod" value="dwolla" id="pgbtn1" onclick="hideCCForm()"{if $selectedgateway eq "dwolla"} checked="checked"{/if} /> <label for="pgbtn1"><b>Bank Transfer</b></label><br />
<input type="radio" name="paymentmethod" value="coinify" id="pgbtn2" onclick="hideCCForm()"{if $selectedgateway eq "coinify"} checked="checked"{/if} /> <label for="pgbtn2"><b>Bitcoin</b></label>
{/if}</p>
(...)

------------

 

 

Any ideas?

 

Thanks!

John

Link to comment
Share on other sites

John,

 

you've got 2 opening {if} statements, but you only close one of them... perhaps v5 might have forgiven you for that.. v6 probably won't!

you either need to close both {if} statements or change the second one to use elseif instead - then you effectively only have one {if} statement... and that will be closed correctly.

 

(...) 
{/if} 
<h2>{$LANG.orderpaymentmethod}</h2> 
{if $currency.id == 1} 
<p><input type="radio" name="paymentmethod" id="pgbtn1" value="paypalbilling" onclick="hideCCForm()"{if $selectedgateway eq "paypalbilling"} checked="checked"{/if} /> <label for="pgbtn1"><b>PayPal</b></label><br /> 
<input type="radio" name="paymentmethod" value="authorizecim" id="pgbtn2" onclick="showCCForm()"{if $selectedgateway eq "authorizecim"} checked="checked"{/if} /> <label for="pgbtn2"><b>Credit Card</b></label><br /> 
{elseif $currency.id == 2} 
<input type="radio" name="paymentmethod" value="dwolla" id="pgbtn1" onclick="hideCCForm()"{if $selectedgateway eq "dwolla"} checked="checked"{/if} /> <label for="pgbtn1"><b>Bank Transfer</b></label><br /> 
<input type="radio" name="paymentmethod" value="coinify" id="pgbtn2" onclick="hideCCForm()"{if $selectedgateway eq "coinify"} checked="checked"{/if} /> <label for="pgbtn2"><b>Bitcoin</b></label> 
{/if}</p> 
(...)

Link to comment
Share on other sites

Hello Brian:

 

Yes -- sorry, actually that double "if" was an error that I only produed (not sure how it happened) in this sample code. In my actual code, which has 3 currencies and more than 2 payment gateways for each, I did use "elseif". Sorry.

 

Using "elseif" though, what happens is that I do see the correct payments gateways for each currency, *but* I see them five (5) times, in idential columns... please SEE the here attached image file.

 

Thanks.

John

vieward.jpg

Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • 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