Jump to content

redirect to invoice


Waqas Saeed

Recommended Posts

WHMCS redirect to login page instead of invoice page after payment process. 

URL :   ... /viewinvoice.php?id=1962&paymentpending=true&paymentToken=421896182

How do it works actually, after redirecting to the 3rd party payment gateway,  the gateway redirects user to the above URL mentioned, the process involved generating a payment voucher to pay at shop, the token is generated if the WHMCS successfully redirects the users to the above URL (it works sometime without any issue) and 3rd party payment plugin redirects to the url; A hook involved in this process send the email to the customer to pay the amount through Token, thus. as soon as customer is redirected to this URL the Hook send the email to the customer,

Where is the problem ?
the url contains the parameters URL : ?d=1962&paymentpending=true&paymentToken=421896182, the problem occurs if the user is redirected to login page instead of the invoice page. and if the user does not enter the username and password again, it wont send the token to the user,  else on invoice page the hook will send token to the user if successfully landed at the invoice page am using the javascript redirect. (in many cases it works and few times it returns to the login page) am not able to understand the situation in which case it redirects to the login page and in which it does not.

Solution : How to keep the user logged in for long period of time, or what can be the issue it is NOT always but redirecting the user to the login page. 

Link to comment
Share on other sites

Better version of my english :-) 



Work Flow : Through Pay Now button, the user is redirected to the 3rd party payment method, after the successful payment the 3rd party method send back the user to the invoice page, it is the simple flow that works as other 3rd party gateways. 

the callback redirects the user to the e.g. URL :   ... /viewinvoice.php?id=1962&paymentpending=true&paymentToken=421896182

Where is the problem ?
 the problem occurs if the user is redirected to login page instead of the invoice page, after the successful or not successful payment they are landed to the login page, and the user has to re-login to see either the payment is successful or not. 

When it is not created: if the user set the Remember Me, it does not create issues for the customer for the above problem. 

Please help with Solution : How to keep the user logged in for long period of time. or keeping the remember me always open for customer who are paying for invoice. or what is the issue. 

Please also let me know if the javascript redirection is causing the issue ?

php session is 24min at this moment. 

Link to comment
Share on other sites

Is it the right method to redirect from 3rd payment back to clientarea or view invoice > 

 

  else  if($ResponseCode == '124'||$ResponseCode == '210') {
              
               logTransaction($gatewayParams['name'], $_POST, "Payment Pending."); ?>
               
               <script>
            location.replace("<?php echo $CONFIG['SystemURL'].'/viewinvoice.php?id='.$invoiceId.'&paymentpending=true'; ?>")
            </script>

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