NKV Posted February 27, 2017 Share Posted February 27, 2017 (edited) Greetings, we started to get since morning errors with Stripe. Everything goes fine on Stripe side, but on our side, we are getting "Incomplete" status, instead of "Paid". We have two currencies USD and RUB. After this incomplete order users get odd balance amount, but still unpaid. I did already opened a ticket, but I know it's going to take at least two days. Maybe someone had the same issue and know how to fix it? We are using latest WHMCS version. Nothing special happened last days and everything worked fine. I am going to attach some screenshots. In payments gateway, it shows everything is "fine". P.S Last payment was 11 USD, but we are getting probably 11 RUB for some reason. - - - Updated - - - Is it possible just to hide currency choosing then you register for first time? Because we are using RUB only for one payment gateway and it could be much better, if everyone had only one option. We need it just for converting, nothing else Edited February 27, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 12, 2017 Author Share Posted March 12, 2017 WHMCS team made case #CORE-10912. Still no updates on this issue 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 12, 2017 Share Posted March 12, 2017 you could modify the template (or use a hook) to hide gateway(s) based on the chosen cart currency - so if they've selected RUB, they see 1 gateway; if USD, they see the other gateways... in the checkout template, it'd just be one IF statement. there's even 3rd-party addon, Gateway Limiter, where you can assign gateways to countries - but it sounds like you don't need to go that far. 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 12, 2017 Author Share Posted March 12, 2017 you could modify the template (or use a hook) to hide gateway(s) based on the chosen cart currency - so if they've selected RUB, they see 1 gateway; if USD, they see the other gateways... in the checkout template, it'd just be one IF statement. there's even 3rd-party addon, Gateway Limiter, where you can assign gateways to countries - but it sounds like you don't need to go that far. Thanks. Actually, I am looking for the way to switch off RUB currency then new clients are registering. We need only RUB for converting then clients are using on Russian payment gateway. Its going to be totally fine if they use USD but we need to enable RUB in settings. Now we have one more issue, because of this. Now every time someone pays with Stripe it does break email also. We wanted to start selling VPS tomorrow, but now it's impossible since people will not get our emails with root passwords and more information. Some clients already missed payment notifications and we are getting pretty negative feedback this week. 3 most important features of every billing system are now broken in WHMCS. Payment gateway (Stripe), multi-currencies & email. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 12, 2017 Share Posted March 12, 2017 Thanks. Actually, I am looking for the way to switch off RUB currency then new clients are registering. We need only RUB for converting then clients are using on Russian payment gateway. Its going to be totally fine if they use USD but we need to enable RUB in settings. step 1 - use an action hook to remove the currency sidebar... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { $secondarySidebar->removeChild('Choose Currency'); }); that means new users can't change currency (unless they know WHMCS well enough to do it in the URL!) - this won't affect existing customers as they can't change their currency anyway. step 2 - in your VPS Product Group page, change the links to pass the currency, e.g... cart.php?a=add&pid=10¤cy=1 that way, you'll be linking to the product, selecting USD and not giving them an option to change to RUB (unless they figure out that RUB is '4', but they won't know that!). http://docs.whmcs.com/Linking_to_WHMCS#Specifying_Currency_in_a_link if your default currency is USD, you might not even have to do step 2. step 3 - optional, and perhaps unnecessary, but you could remove the RUB pricing for these products... the downside would be that existing logged in users with RUB as their currency wouldn't see these products. Now we have one more issue, because of this. Now every time someone pays with Stripe it does break email also. We wanted to start selling VPS tomorrow, but now it's impossible since people will not get our emails with root passwords and more information. Some clients already missed payment notifications and we are getting pretty negative feedback this week. have you modified the email templates in anyway ? anything in the activity log ?? 3 most important features of every billing system are now broken in WHMCS. Payment gateway (Stripe), multi-currencies & email. welcome to WHMCS! 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 12, 2017 Author Share Posted March 12, 2017 step 1 - use an action hook to remove the currency sidebar... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { $secondarySidebar->removeChild('Choose Currency'); }); that means new users can't change currency (unless they know WHMCS well enough to do it in the URL!) - this won't affect existing customers as they can't change their currency anyway. step 2 - in your VPS Product Group page, change the links to pass the currency, e.g... cart.php?a=add&pid=10¤cy=1 that way, you'll be linking to the product, selecting USD and not giving them an option to change to RUB (unless they figure out that RUB is '4', but they won't know that!). http://docs.whmcs.com/Linking_to_WHMCS#Specifying_Currency_in_a_link if your default currency is USD, you might not even have to do step 2. step 3 - optional, and perhaps unnecessary, but you could remove the RUB pricing for these products... the downside would be that existing logged in users with RUB as their currency wouldn't see these products. have you modified the email templates in anyway ? anything in the activity log ?? welcome to WHMCS! Man you rock. Going to try today remove currency forever. Do i need to check this hook just in case every update? We had to switch to SMTP to fix this email issue. I hope it was not related to Stripe. Is there any way to change currency for each user manually? I am ready to correct manually everyone's RUB balance and all databases. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 13, 2017 Share Posted March 13, 2017 Do i need to check this hook just in case every update? not unless WHMCS do something about how sidebars are modified - tbh, I wouldn't worry about this hook until at least v8 (and probably not even then!). We had to switch to SMTP to fix this email issue. I hope it was not related to Stripe. in passing, it's probably worth mentioning that the Stripe documentation says that it's not compatible with "Modern" or "Boxes" templates - the implication being that it's compatible only with standard_cart... so I don't know if it would be compatible with your custom template... possibly one to ask the developer or WHMCS support. Is there any way to change currency for each user manually? I am ready to correct manually everyone's RUB balance and all databases. two answers to that. 1. if the client hasn't made any orders, then you can simply change their currency from the admin area. 2. if they have made orders, then you shouldn't change their currency... the problem is that WHMCS stores orders with no currency attached (the currency is assigned to the client, not the order) - an order for 1000RUB will be stored in the database as 1000, so if you later change the client's currency to USD, it will appear the order was for $1000 USD - which I imagine are two totally different amounts! technically, there's nothing to stop you from doing it, it's just that it will mess with your accounting trail and potentially tax returns too. 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 13, 2017 Author Share Posted March 13, 2017 (edited) Sad I don't have another WHMCS version for just testing this. the problem is that WHMCS stores orders with no currency attached (the currency is assigned to the client, not the order) - an order for 1000RUB will be stored in the database as 1000, so if you later change the client's currency to USD, it will appear the order was for $1000 USD - which I imagine are two totally different amounts! I see, i have around 16 active clients with RUB. Can't I just change their currencies, balance and fix transactions? Let's say I see this 1000$ instead of 6$ and just simply fix it in panel? Also what would happen with automatic payment gateway like Stripe? I am just afraid, if its going to take 1000$ every month, after I change currencies. (or i can just remove all RUB transactions) Edited March 13, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 13, 2017 Share Posted March 13, 2017 Sad I don't have another WHMCS version for just testing this. if you got your license direct from WHMCS, you should be able to get a free developers license from them for testing purposes. I see, I have around 16 active clients with RUB. Can't I just change their currencies, balance and fix transactions? Let's say I see this 1000$ instead of 6$ and just simply fix it in panel? the advice from Support has always been never to do it, and that's probably good advice. I suppose you could setup a new client (with USD) for each of these RUB clients; move their services & domains across... http://docs.whmcs.com/Products_Management#Moving_a_Product.2FService_to_another_Client Also what would happen with automatic payment gateway like Stripe? I am just afraid, if its going to take 1000$ every month, after I change currencies.(or i can just remove all RUB transactions) personally, i'd be tempted to leave things as they are - once you have gateways involved, then that's a recipe for issues - and issues involving clients money are not good. you could open a ticket with Support, but I would expect them to say something similar. 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 13, 2017 Author Share Posted March 13, 2017 (edited) step 1 - use an action hook to remove the currency sidebar... Stupid questions, but there I am suppose to put this hook? Edit: I found /includes/hooks what next? After creating new .php file and putting this hook is not enough. What, else do I need to do? Followed this guide https://developers.whmcs.com/hooks/getting-started/ Do we need different hook, since we have different template? https://my.xeovo.com/register.php Edited March 13, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 13, 2017 Share Posted March 13, 2017 hasn't it removed the currency selector sidebar from the cart ? there was a currency dropdown sidebar there yesterday - it's not there now. 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 13, 2017 Author Share Posted March 13, 2017 (edited) I am trying to hide this one CSS didn't help that much, I can hide dropdown menu, but it's going to look ugly http://nkv.name/screenshots/2017-03-13_184429.png P.S Didn't even noticed you can choose currency in sidebar then you are choosing product. Thanks. Edited March 13, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 13, 2017 Share Posted March 13, 2017 ok, if you're talking about clientregister.tpl, then you have two options - either a quick template change from... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/foreach} </select> </div> {/if} to... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} {if $curr.code eq "USD"}<option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option>{/if} {/foreach} </select> </div> {/if} or if you want to use another hook... <?php # Remove Currencies From Client Register Page # Written by brian! use Illuminate\Database\Capsule\Manager as Capsule; function hook_currency_removal($vars) { $currency = Capsule::table('tblcurrencies') ->where('code', 'USD') ->get(); $encodedata = json_encode($currency); $decodedata = json_decode($encodedata, true); return array("currencies" => $decodedata); } add_hook("ClientAreaPageRegister", 1, "hook_currency_removal"); ?> either solution will remove non-USD currencies from the dropdown - in your case, it will remove RUB as an option. 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted March 13, 2017 Author Share Posted March 13, 2017 (edited) That's awesome! I am going to use hooks now more often. Than you very much! Now I don't need to worry about RUB and Stripe payments for a while. Hope WHMCS will push soon update. Edited March 13, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.