Jump to content

CaptainChainsaw

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by CaptainChainsaw

  1. That makes sense, thank you
  2. Hi, Just a quick question. Would I have to quote "False" when testing for the response condition here? if($SOAP_RESPONSE->DataName == False){ // do something } if($SOAP_RESPONSE->DataName == "False"){ // do something else } In the XML response: <DataName>False<DataName> I thought it should work without quotes. Cheers
  3. Fair enough, is there a way around this? I've tried creating another certificate using the common name "www.myserver.dev.com" and got this: [error] Init: Multiple RSA server certificates not allowed
  4. Hi all, I've been trying to figure out a problem I've got with SSL. I have installed a certificate with the common name "*.dev.com" and it works for https://www.myserver.dev.com and https://myserver.dev.com. Common Name (e.g. server FQDN or YOUR name) []:*.dev.com The problem is when I try to post to https://www.myserver...dir/script.php. If a point the browser to this URL I get served the page but if I post within an iframe I get this: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed I've tried posting to: https://www.myserver.../dir/script.php and script.php Each time I get this error message. I can't see why, as far as I can tell this should work. Anyone got any ideas? Cheers, CaptainChainsaw
  5. Problem solved, this fixed it: $r=$SOAP_RESPONSE->ProcessApplicationDataResult; $data = simplexml_load_string($r); echo "app date: ".$data->ApplicationDate; Cheers
  6. Hi all, I've got this SOAP response: [ProcessApplicationDataResult] => <Response> <ApplicationDate>2/7/2013 10:16:36 AM</ApplicationDate> <IsApproved>False</IsApproved> <RedirectURL></RedirectURL> <Offer> <Amount></Amount> </Offer> </Response> How do I access the values? I've tried: $SOAP_RESPONSE->ProcessApplicationDataResult->ApplicationDate; $SOAP_RESPONSE->ApplicationDate; $SOAP_RESPONSE['ProcessApplicationDataResult']->ApplicationDate; This should be extremely easy to do. Thanks in advance, CaptainChainsaw
  7. That might be an option but performance is high priority and another db hit might have an effect on that. These card types and other details currently aren't stored on the DB they're simply values on a form, adding the details to a DB and not updating the form dynamically using db values would mean changes in two places.
  8. Hi all, I'm looking to design a OO system that interacts with 3rd parties who use SOAP, GET AND POST. These 3rd parties each have their own way of more or less doing the same thing. For example. Say I want to pass them a credit card name, one 3rd party may expect "Mastercard" and another might expect "MSC" to be passed. At the moment I'm thinking I could, for example have a set method like so: $card->setMastercard("MASTERCARD"); Another method to find the correct mapping for it: $card->findMapped(); This may mean a scaleabilty problem if a new card is added in the future. I could create a method is some subclass that takes these details as params, perhaps something like: $thirdParty->('$URL_TO_POST_TO', 'SOAP' ,array(' "MSC" => "MASTERCARD, "VIS" => "VISA" '), // etc ); This would make it potentially a nightmare if a lot of params need passed in but would mean if another card was added, the code wouldn't need changed and it would just mean adding another element in the array. Anyone got any tips or suggestions on how best to tackle this? I'm thinking GET/POST/SOAP parent classes and a "3rd party" subclass. These are just rough ideas. Thanks in advance, CaptainChainsaw
  9. Those results seem to be correct - thanks for your help Barand - all sorted
  10. Thank you Barand, adding the brackets is now producing results. I'll need to check it further to see that the results are correct - looking good though! Cheers, CaptainChainsaw
  11. Hi, Unfortunately backticks isn't the issue, works fine with either. Think the problem is deeper. Cheers, CaptainChainsaw
  12. Hi all, The SQL I'm looking at calculates the the average age within the select and this works fine: (AVG((TO_DAYS(NOW())-TO_DAYS(pl.dob)))/365.242199) AS averageage The problem is when I want to count the ages that are within age groups. The example below should give the total number of ages within the 18-24 group. I can't get this to work, it displays zeros when the select statement is executed, there aren't any sql errors. SUM((case when (TO_DAYS(NOW())-TO_DAYS(pl.dob)/365.242199) BETWEEN 18 AND 24 then 1 else 0 end)) AS '18-24', Can anyone suggest a solution to this? CaptainChainsaw
  13. Got it sorted, I had to make some other elements absolute.
  14. Hi all, I'm trying to get the text "Borrow:", "+ Interest:" and "= You repay*:" to stay fixed while the values that displayed via javascript in the span tags change. The values in the span tags can have different lengths which means at the moment the text doesn't stay fixed. Anyone know how I can get the text to stay fixed while the values change? I've tried setting it to "absolute" but when the page is zoomed in on the text doesn't stay inline with the rest of the page. HTML: <div id="sliderToolResults_Borrow">Borrow: <span id="resultRequested" class="sliderResultBorrow"></span> </div> <div id="sliderToolResults_Interest"> + Interest: <span id="resultInterest" class="sliderResultInterest"></span> </div> <div id="sliderToolResults_Repay"> = You repay*: <span id="resultTotal" class="sliderResult"></span> </div> CSS: #sliderToolResults_Borrow { position:relative; left: 50px; top: -30px; font-style:italic; float: left; } #sliderToolResults_Interest { position:relative; left: 70px; top: -30px; font-weight: 100; float: left; } #sliderToolResults_Repay { position:relative; left: 140px; top: -30px; font-weight: 100; float: left; } #sliderrepay { position: absolute; } #sliderBorrowResult { color: #ff9900; position:relative; left: 45px; bottom: -5px; } #sliderInterestResult { color: #ff9900; position:relative; left: 45px; bottom: -5px; } #sliderRepayResult { color: #ff9900; position:relative; left: 450px; bottom: -5px; } Any ideas? Any help would as always be appreciated. Cheers, CaptainChainsaw
  15. Got this fixed. Adding in this code got it working: else if(is_safari) { return 'Leave page?'; }
  16. Hi all, I've got a problem with this piece of code. I believe this should work properly but when closing the Safari browser the alert box is properly displayed but when clicking "Ok" the browser closes. It should return to the page as it returns false. I've tried setting it to return false but with no luck. This works on FF and Chrome ok. var is_chrome = navigator.userAgent.indexOf('Chrome') > -1; var is_explorer = navigator.userAgent.indexOf('MSIE') > -1; var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; var is_safari = navigator.userAgent.indexOf("Safari") > -1; var is_Opera = navigator.userAgent.indexOf("Presto") > -1; if ((is_chrome)&&(is_safari)) {is_safari=false;} //within $(document).ready(function(){ jQuery(window).bind("beforeunload", function(){ // showDebug1("Exiting..."); $.ajax({ url: "<?=$exit_url?>"}); leave = confirm("Exit page?"); if (leave==true){ return ret; } else { if(is_chrome) { return 'Leave page?'; } else if(is_safari) { alert('Click OK to continue'); } else { return false; } } }); Anyone have any ideas? Cheers, CaptainChainsaw
  17. Ahhh yeah, that was glaringly obvious, couldn't see the wood for the trees. Thank you, makes perfect sense!
  18. Hi all, Would anyone be able to explain why I get a value in the variables "$redirecturl" and "$message" in the first example below but not in the second example? As soon as the condition to check for success has been evaluated the object disappears: if ($result->GetUnsecuredLenderResult->Success) { // object disapepars after this line Works in this example: try { $result = $client->GetUnsecuredLender( $params ); $continueurl = trim($result->GetUnsecuredLenderResult->ContinueUrl); $responsetext = trim($result->GetUnsecuredLenderResult->ResponseText); if ($result->GetUnsecuredLenderResult->Success) { $result = "A"; $redirecturl = $continueurl; $message = $responsetext; } else { // reject $result = "R"; $redirecturl = $continueurl; $message = $responsetext; } } catch (Exception $e) { // exception $result = "E"; $redirecturl = ""; $message = $e->getMessage(); } Doesn't work in this example: try { $result = $client->GetUnsecuredLender( $params ); if ($result->GetUnsecuredLenderResult->Success) { $result = "A"; $redirecturl = trim($result->GetUnsecuredLenderResult->ContinueUrl); $message = trim($result->GetUnsecuredLenderResult->ResponseText); } else { // reject $result = "R"; $redirecturl = trim($result->GetUnsecuredLenderResult->ContinueUrl); $message = trim($result->GetUnsecuredLenderResult->ResponseText); } } catch (Exception $e) { // exception $result = "E"; $redirecturl = ""; $message = $e->getMessage(); } Any advice on this would be appreciated as always. Cheers, CaptainChainsaw
  19. Hi all, I'm in need of some advice to help me decide whether I should be using nusoap or not. Various SOAP integrations have been done using code like this: ini_set('soap.wsdl_cache_enabled', '0'); ini_set('default_socket_timeout', $timeout); $oSoap = new SoapClient('www.myserver.com/test.php', array('connection_timeout' => 15)); $aReturn = $oSoap->SendRequest($sData); I've installed nusoap and got a client and server running successfully. require_once('nusoap-0.9.5/lib/nusoap.php'); $c = new nusoap_client('http://www.myserver.com/soap/server.php?wsdl'); $frequency = $c->call('getValue', array('id' => 123456)); Does anyone know if there will be an issues with upgrades to php which might cause problems in the future by using nusoap? What advantages are there for using nusoap? I just need to know if its worth using nusoap instead of "standard" soap in a live production environment. Cheers for any advice. CaptainChainsaw
  20. Hi Thorpe, I didn't want to post a pile of code without finding out exactly where the problem is as I didn't want to waste anyone's time. I've found it that it seems to be a javascript problem so nothing to do with the forking as far as I can tell. If I run into further problems with this I'll post something more specific. Thanks again, CaptainChainsaw
  21. Hi all, I'm looking at some code which has been rewritten so that the logic is forked. I've created a test system and run the new code on my local machine, the code works properly. I've been advised that the code was run live and it did work but the new code didn't perform as well as expected, there was nothing in the error log which would explain the issue. As far as I know there's no limit to the number of processes that can be running concurrently but it does seem possible that the processes are being killed prematurely. It's difficult to explain exactly what this code is doing. The current live code processes data and the failure rate for example is 10%, moving to the forking process the failure rate increases. Why it is increasing is what I'm trying to find out. Possibly this is due to timeouts, db connections, process limits being reached etc, network issues. The code seems to work but can't reproduce the increase in failure rate. Anyone got any other ideas as to why the failure rate would increase when moving to forked code? Cheers in advance, CaptainChainsaw
  22. That was it thanks. I thought the nusoap was something installed on the server, downloaded and installed - working fine now thank you.
  23. Hey all, I'm trying to get started with SOAP, I'm following this tutorial: http://www.codewalkers.com/c/a/Miscellaneous/Using-SOAP-with-PHP/3/ As far as I can tell I've got everything I need installed. When I try to run the following code I get the errors below <?php function getStockQuote($symbol) { mysql_connect("localhost", "captainc_blade42", "tr38KM00NI66uher56"); mysql_select_db('captainc_general'); $query = "SELECT stock_price FROM stockprices " . "WHERE stock_symbol = '$symbol'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); return $row['stock_price']; } require_once('nusoap.php'); //use the nusoap library $server = new soap_server(); $server->configureWSDL('stockserver', 'urn:stockquote'); $server->register("getStockQuote", array('symbol' => 'xsd:string'), array('return' => 'xsd:decimal'), 'urn:stockquote', 'urn:stockquote#getStockQuote'); $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server->service($HTTP_RAW_POST_DATA); ?> Anyone got any ideas what I need to do to sort this? Cheers, CaptainChainsaw
  24. Hi, I've also noticed in my backend of magento that the paypal payment options are definitely there but some of them can't be clicked on and the option expanded to show the form for that particular paypal option. Is this normal or is there a problem with my installation? It could be a problem with the installation as its was partially reinstalled. I hope that's clear. Thanks again, CaptainChainsaw
  25. Hi, I have a new magento installation and now I need to add products. The products are currently just t-shirts. I read a tutorial on adding products and it said that I would need to create attributes for size and colour etc then create simple products for each variation of that product and then create a configurable product and do this for each product. With multiple sizes and colours I'll be there forever adding products. Is there a quicker way to add products with sizes and colours? Also if I want to add/remove or change any of the attributes would that then propagate to the existing products? Thanks in advance for any help anyone can give me on this. Cheers, CaptainChainsaw
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.