DJPRMF Posted April 17, 2020 Share Posted April 17, 2020 Hello, Quick question: there is any way of redirect the users to a specific payment gateway in a direct link to the "view invoice" page? This despite the "default payment" method selected by the user. For instance: https://whmcs.domain/viewinvoice.php?id=1234&gateway=SOMETHING Thank you 0 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted May 24, 2020 Author Share Posted May 24, 2020 Some help about this? Thanks 0 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted July 14, 2020 Author Share Posted July 14, 2020 A little bump to see if anyone knows 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 14, 2020 Share Posted July 14, 2020 On 17/04/2020 at 14:12, DJPRMF said: Quick question: there is any way of redirect the users to a specific payment gateway in a direct link to the "view invoice" page? This despite the "default payment" method selected by the user. you'd have to use a hook to modify the gateway dropdown and payment method details... and I don't know whether it would still work if the user wasn't logged in and so needed to login first... in any event, the user could change the gateway to their default method if they choose to (assuming they have the choice). 1 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted August 5, 2020 Author Share Posted August 5, 2020 Thank you for the info. But what i am looking is direct them to a specific payment depending on the link access. For instance: https://whmcs.domain/viewinvoice.php?id=1234&gateway=paypal The tag "gateway" (or something else, doesn't matter) redirect to the gateway "PayPal". 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 5, 2020 Share Posted August 5, 2020 4 hours ago, DJPRMF said: But what i am looking is direct them to a specific payment depending on the link access. a link from where - the client area when they're already logged in or in an email ? 4 hours ago, DJPRMF said: https://whmcs.domain/viewinvoice.php?id=1234&gateway=paypal The tag "gateway" (or something else, doesn't matter) redirect to the gateway "PayPal". what does the link do - just take them to the viewinvoice page and preselect a specific gateway - or do you actually want to forward them to PayPal from that link ?? also, do you have Clients Choose Gateway enabled ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 5, 2020 Share Posted August 5, 2020 6 hours ago, DJPRMF said: But what i am looking is direct them to a specific payment depending on the link access. a link from where - the client area when they're already logged in or in an email ? 6 hours ago, DJPRMF said: https://whmcs.domain/viewinvoice.php?id=1234&gateway=paypal The tag "gateway" (or something else, doesn't matter) redirect to the gateway "PayPal". what does the link do - just take them to the viewinvoice page and preselect a specific gateway - or do you actually want to forward them to PayPal from that link ?? also, do you have Clients Choose Gateway enabled ? 1 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted August 5, 2020 Author Share Posted August 5, 2020 Basically, is a link that i can provide to the client and will preselect a specific gateway. doesn't need to enter in any gateway system. Just pre-select them for the client when visiting the link... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 6, 2020 Share Posted August 6, 2020 12 hours ago, DJPRMF said: Basically, is a link that i can provide to the client and will preselect a specific gateway. I get that - but you still haven't said whether CCG is enabled... e.g is there a dropdown on the viewinvoice page or do the invoices only have one option - because the answer to that will decide how to do this. 0 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted August 6, 2020 Author Share Posted August 6, 2020 There is a dropdown with multiple gateways. I think that is the default way of the page "viewinvoice" in the WHMCS. 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 7, 2020 Share Posted August 7, 2020 15 hours ago, DJPRMF said: There is a dropdown with multiple gateways. I think that is the default way of the page "viewinvoice" in the WHMCS. 🙂 it's an option you can enable/disable in the settings - and I can't remember if its on by default. let me have a ponder on this, because I think the simpler solution would be to use jQuery to change the dropdown and then that should change the payment method details too (which in the case of PayPal includes a form generated by WHMCS internally)... but the invoice page doesn't have a header or footer, so injecting code via a hook is a little more involved... and I don't particularly just want to do it in the template if that can be avoided. 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 10, 2020 Share Posted August 10, 2020 well I quickly wrote a hook for this (no jQuery involved) and it works perfectly... except for some reason, you couldn't use gateway in the URL as you wanted to. 😕 that intrigued me as to why not and I then found that under certain circumstances, you can already do what you want by default with WHMCS - but you would have to pass the token value in the link.... which if the client is already logged in, you should have access to... i've never seen any documentation on this hidden feature or that it was even possible. <a href="viewinvoice.php?id={$invoiceid}&gateway=banktransfer&token={$token}">bank transfer</a><br /> <a href="viewinvoice.php?id={$invoiceid}&gateway=mailin&token={$token}">cheque</a> now depending on where you're linking from, $invoiceid might not exist as a variable - but you surely will know which invoice you're wanting to link to, and therefore that value (hardcoded or other existing variable) can be used in your link(s). if using a token is not practical in your circumstances, then I can let you have the hook I wrote - links work as per above except you don't need to pass the token - I just wish that i'd found that out about the feature before writing the damn hook! 😠1 Quote Link to comment Share on other sites More sharing options...
DJPRMF Posted August 12, 2020 Author Share Posted August 12, 2020 WoW, this is awesome. I also didn't know that. I have tried the "gateway" variable in the link, but it didn't work. Adding the token work just fine. Thank you so much! 😄 If you have the hook to share, i appreciate that also 😄 0 Quote Link to comment Share on other sites More sharing options...
tiagocaus Posted November 30, 2021 Share Posted November 30, 2021 @Brian  Hi Brian, how can I generate the Token when the email is sent to the customer? &token={$token}  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.