Jump to content

SecondCity

Members
  • Content Count

    45
  • Joined

  • Last visited

Everything posted by SecondCity

  1. I have been so busy defending myself against Jacques1 in another thread, I forgot all about this one! Am working on another problem now, but when I finish that I will try this out and get back to you. Thanks for the reminder!
  2. Is this why you hang around forums? To put people down and criticize? The places where I was getting hung up weren't that hard to understand if you read what I originally said. And I was thankfully able to figure things out. Ranting about how inferior my skills are doesn't add much to this website, and make me wonder why you feel the need to point out perceived shortcomings in others. Must be lonely being a forum guru...
  3. I do write secure code. I just don't know cURL, XML, or OOP - which this project requires. I did break down my code and look at things with a fresh head. The manual looks like most manuals written by developers - it is incoherent. (I even got an admin at the payment gateway to agree with me on that one!) Because the developers chose to write piss-poor documentation, and because the nuances of all of this is subtle, that matters I figured out the missing pieces that were not documented, AND I rewrote the code provided to me in several places to make it easier to underst
  4. I have it working. Looks like you are wrong again.
  5. Nothing. Will probably have a working website that accepts credit cards by end of the weekend. Just trying to better understand things so I don't make any mistakes and leave any holes in my code. You seem to flustered to help, and this thread has become too morphed. Clearly we aren't understanding each other. Sorry I asked.
  6. I guess the object created here... $xml = simplexml_load_string($xmlStr,'SimpleXMLElement', LIBXML_NOWARNING); Has no relation to this object... $response = new SimpleXMLElement($xml_response); ----------------- And I guess the XML string I send in the request have no relationship to the XML string that the payment gateway passes back to me. ----------------- If any of this was in the manual, I wouldn't be here bugging you!
  7. This thread has morphed... I understand what you said above. My latest posts were dealing with the objects created. Objects are not strings. public 'payment' => object(SimpleXMLElement)[4] public 'creditCard' => object(SimpleXMLElement)[6] public 'cardNumber' => string '5424000000000015' (length=16) public 'expirationDate' => string '0917' (length=4) public 'cardCode' => string '888' (length=3)
  8. I think the fact that 5 of my posts today got got truncated and you didn't see everything I said messed up a nice conversation. My confusion is around the quasi-object called SimpleXMLElement which the PHP manual says is not technically an object and you have to handle differently. I was concerned that there might be a collision using the same object for the request and response. I know PHP and procedural coding, but what has thrown me off in all of this is that the code I got is more OOP based' (I edited the post above.)
  9. Is there any relationship or conflict in my code between this SimpleXMLElement object which is used for the REQUEST... $xml = simplexml_load_string($xmlStr,'SimpleXMLElement', LIBXML_NOWARNING); ...and this SimpleXMLElement object which is used for the payment gateway RESPONSE... $response = new SimpleXMLElement($xml_response); I would have thought you would do this for $response... $response = simplexml_load_string($xml_response,'SimpleXMLElement', LIBXML_NOWARNING);
  10. I thought when I ran this code... $response = new SimpleXMLElement($xml_response); ...that it might use the same SimpleXMLElement object that I build above for the request? Or is $xml_response and entirely different XML document from the payment gateway? And so that would make $response a PHP object that is unrelated to my request SimpleXMLElement??
  11. If I have this... $xmlStr = <<<XML <?xml version="1.0" encoding="utf-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication></merchantAuthentication> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <payment> <creditCard> <cardNumber>$ccNumber</cardNumber> <expirationDate>$ccExpDate</expirationDate> <cardCode>$ccSecurityCode</cardCode> </creditCard>
  12. My concern is that the variables embedded in my XML template might get returned in the payment gateway's response to me when I use this code... $xml = simplexml_load_string($xmlStr,'SimpleXMLElement', LIBXML_NOWARNING); $xml_response = curl_exec($ch); $response = new SimpleXMLElement($xml_response);
  13. Every time I try and post responses here they get CHOPPED OFF
  14. I was concerned that all of those request values might somehow end up hanging around in the XML template that I get back from the payment gateway. So when I run this... $response = new SimpleXMLElement($xml_response);
  15. I don't know or understand OOP. If I take an XML template that has variables in it - and thus values in it - and I run it through... $xml_response = curl_exec($ch);
  16. Why does this website chop off 80% of my replies??
  17. I don't know or understand OOP. If I take an XML template that has variables in it - and thus values in it - and I run it through... $xml_response = curl_exec($ch);
  18. Originally I used embedded PHP variables like this... $xmlStr = <<<XML <?xml version="1.0" encoding="utf-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication></merchantAuthentication> <employeeId></employeeId> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <payment> <creditCard> <cardNumber>$ccNumber</cardNumber> <expirationDate>$ccExpDate</expirationDate> <cardCode>
  19. Well, what I posted above is the essence of things? (Since this is for an ecommerce site, I am leery to post too much.) Apparently my approach above isn't right. It says: invalid child element 'employeeId' in namespace
  20. I have an XML template that starts off like this... $xmlStr = <<<XML <?xml version="1.0" encoding="utf-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication></merchantAuthentication> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>$amount</amount> <payment> <creditCard> : : According to the API guide, <merchantAuthentication> has these two components: name, transactionID. In order to ad
  21. I thought CURLOPT_RETURNTRANSFER was more associated with a GET request. Now that you are saying for each request there is a response, then I guess I can see how CURLOPT_RETURNTRANSFER could relate to a POST as well. (I thought when I POSTed credit card data to the payment gateway that request was a one-way street, so you wouldn't care about formatting a response since there wouldn't be one. I now see the ways of errors.) I'm not inventing anything, just working with a crappy code example that is incomplete, along with an API manual that leaves a llot to be desired as well. (I have
  22. I did take your advice from an earlier thread and read up on HTTP, but like everything, it is a gradual learning curve. And I missed that that you *always* get a response when you send a request with HTTP. Either way, earlier I was talking about my payment gateway's use of the term "request" and "response" and didn't assume they meant the same thing as what you are referring to. In my op, I was confused by the sample cURL they provided, because this code seems to make a POST... curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_P
  23. The abbreviated code above is supposed to submit a request to the payment gateway. From RTFM, these lines of code should be doing that... curl_setopt($ch, CURLOPT_URL, $url); // Provide the URL to use in the Request. curl_setopt($ch, CURLOPT_POST, 1); // Peform a POST transaction. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml->asXML()); // Specify XML template/data to POST in the Request. However, when I run the sample code my payment gateway gave me, I am also getting a response back! I know this because of this code... $xml_response = curl_exec($ch); var_dump($xml_response); S
  24. I did RTFM and yet I still have questions. If you can't be civil then don't respond.
  25. Not sure I understood your response... I was asking if these 3 lines were together, would it be both a POST and then a GET? curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml->asXML()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
×
×
  • 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.