Strats Posted August 15, 2007 Share Posted August 15, 2007 Hi guys, I need some help configuring the "Recieve SMS when you get new Order". I have followed carefully all steps as described at http://forums.whmcs.com/viewtopic.php?t=5272 The problem is that on new orders now, after step4 when we go to the step=checkout, client sees a white page with just: 37902aedb827acb290cb7d574a0f5992208 The funny thing is that I received the SMSs with no prob and the order seems complete, also the emails are sent. Only that client can't see the checkout page. I have checked my checkoutscript.php for extra spaces but I don't find anythig. Any ideas what this can be? Thanks 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 16, 2007 Author Share Posted August 16, 2007 I've been advised by lainard (thanks a lot replying mate) I have added the following on my checkoutscript.php META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.domain.com/whmcs/viewinvoice.php?id=1"> Now, the page after step4 is completely blank and no sms receive My exact code on my checkoutscript.php was: <?php /* ************************************************** ************** WHMCS CheckOut Script ************* ************************************************** You may enter code here which will be run when a user checks out if you have enabled it in Configuration > General Configuration > Other of your WHMCS Admin Area. The following variables are available to you: ************************************************** Order ID: $orderid Order Number: $ordernumber Invoice ID: $invoiceid Product ID: $productid Domains Array: $domains Addons Array: $addons ************************************************** */ require_once ("sms_api.php"); $mysms = new sms(); echo $mysms->session; echo $mysms->getbalance(); // $mysms->token_pay("1234567890123456"); //spend voucher with SMS credits $mysms->send ("my phone", "Company", "Order: $domains Invoice ID: $invoiceid Product ID: $productid"); ?> where of course myphone and company is changed Any idea??? 0 Quote Link to comment Share on other sites More sharing options...
lainard Posted August 16, 2007 Share Posted August 16, 2007 You are welcome Starts 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted August 16, 2007 WHMCS CEO Share Posted August 16, 2007 The reason it's not redirected automatically is because you have it outputing data to the screen. The better solution is to fix that issue rather than use a workaround as you are doing with the above meta refresh redirect which won't work unless the users invoice id is 1. Matt 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 16, 2007 Author Share Posted August 16, 2007 The reason it's not redirected automatically is because you have it outputing data to the screen. Matt Can you translate this Matt? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted August 16, 2007 WHMCS CEO Share Posted August 16, 2007 The sms_api.php file is outputting 37902aedb827acb290cb7d574a0f5992208 which must be some kind of reference # for the SMS message that was sent. That needs to be stopped. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted August 16, 2007 Share Posted August 16, 2007 I think what Matt is saying is that normally the checkoutscript.php doesn't output anything back to the browser. The issue appears to be an order problem. All HTTP headers must be sent to the client before the body of the message. The redirection is via HTTP header that's set after the checkoutscript.php is called (if it was sent first, the client might break connection and PHP abort script processing). But because your code outputs to the client PHP can't add any more headers, so there's no redirection. The solution appears to be to stop outputting anything to the client -- like the echo statements. [Edit]-- What he said [/Edit] 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 16, 2007 Author Share Posted August 16, 2007 Hey guys, I feel like I speak no english at all Lol, how embarrassed I feel What I don't get (emm, actually I don't get anything) is how this code works for some of you and not in my whmcs. Also trying to translate the above, I think Matt is talking about the sms_api.php which outputs somthing while brianr is talking about checkoutscript.php that outputs... Anyway, if it's so complicated, let forget about it 0 Quote Link to comment Share on other sites More sharing options...
lainard Posted August 17, 2007 Share Posted August 17, 2007 remove/comment these two lines echo $mysms->session; echo $mysms->getbalance(); become //echo $mysms->session; //echo $mysms->getbalance(); and those session will not appear and do not forget to leave the meta http redirect META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.domain.com/whmcs/yoursuccessfullpage.html"> 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 18, 2007 Author Share Posted August 18, 2007 Thanks a lot lainard, it seems impossible. I have done exactly as you said but still bet a blank page. The redirection code, wher exactly do you place it? Does the position matter? 0 Quote Link to comment Share on other sites More sharing options...
lainard Posted August 18, 2007 Share Posted August 18, 2007 Thanks a lot lainard, it seems impossible. I have done exactly as you said but still bet a blank page. The redirection code, wher exactly do you place it? Does the position matter? Post here your checkoutscript.php 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 18, 2007 Author Share Posted August 18, 2007 Post here your checkoutscript.php <?php /* ************************************************** ************** WHMCS CheckOut Script ************* ************************************************** You may enter code here which will be run when a user checks out if you have enabled it in Configuration > General Configuration > Other of your WHMCS Admin Area. The following variables are available to you: ************************************************** Order ID: $orderid Order Number: $ordernumber Invoice ID: $invoiceid Product ID: $productid Domains Array: $domains Addons Array: $addons ************************************************** */ require_once ("sms_api.php"); $mysms = new sms(); //echo $mysms->session; //echo $mysms->getbalance(); //$mysms->token_pay("1234567890123456"); //spend voucher with SMS credits $mysms->send ("phone", "MyCompany", "Order: $domains Invoice ID: $invoiceid Product ID: $productid"); META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.mycomapny.com/transaction_complete.html"> ?> 0 Quote Link to comment Share on other sites More sharing options...
lainard Posted August 18, 2007 Share Posted August 18, 2007 here for you <?php /* ************************************************** ************** WHMCS CheckOut Script ************* ************************************************** You may enter code here which will be run when a user checks out if you have enabled it in Configuration > General Configuration > Other of your WHMCS Admin Area. The following variables are available to you: ************************************************** Order ID: $orderid Order Number: $ordernumber Invoice ID: $invoiceid Product ID: $productid Domains Array: $domains Addons Array: $addons ************************************************** */ require_once ("sms_api.php"); $mysms = new sms(); //echo $mysms->session; //echo $mysms->getbalance(); //$mysms->token_pay("1234567890123456"); //spend voucher with SMS credits $mysms->send ("Number of your heone", "SigmaWeb", "Order: $domains Invoice ID: $invoiceid Product ID: $productid"); ?> <html> <head> META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.yourweb.com/transaction_complete.html"> </head> <body> Please wait you are being redirected if you are not redirected in few second Please click [url="https://www.yourweb.com/transaction_complete.html"]here[/url] </body> </html> it should work now 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 18, 2007 Author Share Posted August 18, 2007 The code above gives me this error: META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.mydomain.com/transaction_complete.html"> Please wait you are being redirected if you are not redirected in few second Please click here 0 Quote Link to comment Share on other sites More sharing options...
lainard Posted August 18, 2007 Share Posted August 18, 2007 The code above gives me this error: META HTTP-EQUIV="Refresh" CONTENT="5; URL=https://www.mydomain.com/transaction_complete.html"> Please wait you are being redirected if you are not redirected in few second Please click here double check dude and copy paste those code above HINT!! </head> 0 Quote Link to comment Share on other sites More sharing options...
floyd Posted August 21, 2007 Share Posted August 21, 2007 <head>META HTTP-EQUIV="Refresh" CONTENT="5;URL=https://www.mydomain.com/transaction_complete.html"> Missing < before META 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 21, 2007 Author Share Posted August 21, 2007 <head>META HTTP-EQUIV="Refresh" CONTENT="5;URL=https://www.mydomain.com/transaction_complete.html"> Missing < before META AMEN!!!!! floyd, I would kiss you if I were there mate hahaha Last: what is the exact syntax of the last step where the client sees the invoice? This has to be my redirect link. Like viewinvoice.php?id=298 but is there a variable for the invoice ID? 0 Quote Link to comment Share on other sites More sharing options...
floyd Posted August 21, 2007 Share Posted August 21, 2007 I have never used the checkout script but from reading it: Order ID: $orderid Order Number: $ordernumber Invoice ID: $invoiceid Product ID: $productid Domains Array: $domains Addons Array: $addons Looks like $invoiceid is what you are looking for. 0 Quote Link to comment Share on other sites More sharing options...
floyd Posted August 21, 2007 Share Posted August 21, 2007 lainard you might want to edit your post so that it includes the missing < so that the next person reading this gets the correct code. 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 21, 2007 Author Share Posted August 21, 2007 I have never used the checkout script but from reading it: Order ID: $orderid Order Number: $ordernumber Invoice ID: $invoiceid Product ID: $productid Domains Array: $domains Addons Array: $addons Looks like $invoiceid is what you are looking for. Hmmm, the above don't work. There must be another way to redirect to clients order invoice. 0 Quote Link to comment Share on other sites More sharing options...
floyd Posted August 21, 2007 Share Posted August 21, 2007 Your meta refresh should look like: <META HTTP-EQUIV="Refresh" CONTENT="0; URL=https://www.domain.com/whmcs/viewinvoice.php?id=$invoiceid"> I use 0 because I want an immediate redirection not a 5 second delay. What is the result you get? Do you get the proper link when you also use: Please wait you are being redirected if you are not redirected in few second Please [url="https://www.domain.com/whmcs/viewinvoice.php?id=$invoiceid"]click here[/url] 0 Quote Link to comment Share on other sites More sharing options...
Strats Posted August 21, 2007 Author Share Posted August 21, 2007 Also with CONTENT="0 it redirects to the page "error - please try again later..." There must be something else on the syntax of viewinvoice.php?id=$invoiceid 0 Quote Link to comment Share on other sites More sharing options...
floyd Posted August 21, 2007 Share Posted August 21, 2007 I am wondering if they have to login first or is the process of signing up log them in? 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.