doubledee Posted March 30, 2011 Share Posted March 30, 2011 How does the way you would work with an XML string compare to other languages like ASP? I have some sample code from a Payment Gateway that was written in ASP, and I am trying to convert it to PHP. Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/ Share on other sites More sharing options...
trq Posted March 30, 2011 Share Posted March 30, 2011 Strings are strings. Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194043 Share on other sites More sharing options...
trq Posted March 30, 2011 Share Posted March 30, 2011 I should add that PHP does have functions for parsing and manipulating data though, depending on what version of ASP your looking at it might not. Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194044 Share on other sites More sharing options...
doubledee Posted March 30, 2011 Author Share Posted March 30, 2011 I should add that PHP does have functions for parsing and manipulating data though, depending on what version of ASP your looking at it might not. How hard is it to work with XML? How hard would it be for me to convert the sample code they gave me from ASP to PHP? The code looks like gibberish, but I am hoping that is more ASP and bad coding than this being an insurmountable goal?! :-\ Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194049 Share on other sites More sharing options...
trq Posted March 30, 2011 Share Posted March 30, 2011 How hard would it be for me to convert the sample code they gave me from ASP to PHP? How would we know? Firstly, we have no idea of your PHP abilities and secondly we haven't see the code your talking about. If it looks like gibberish to you I would say its' going to be quite the difficult task. Personally, I don't read gibberish that well. Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194052 Share on other sites More sharing options...
doubledee Posted March 30, 2011 Author Share Posted March 30, 2011 How hard would it be for me to convert the sample code they gave me from ASP to PHP? How would we know? Firstly, we have no idea of your PHP abilities and secondly we haven't see the code your talking about. If it looks like gibberish to you I would say its' going to be quite the difficult task. Personally, I don't read gibberish that well. Uh, the point was how hard would it be to convert how you handle XML to how you handle it in PHP! If working with XML is independent of the programming language, then that probably makes the task easier. But if the way you do XML in ASP is radically different than how you do it in PHP, then it might be a real bear to work with since I don't know ASP. ---- I guess the idea of XML is that you are marking up data so that when you pass it, it can be identified, right? (As opposed to storing it in an array where you are working off of the $key->$value pair concept, right?) Debbie Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194058 Share on other sites More sharing options...
trq Posted March 30, 2011 Share Posted March 30, 2011 XML is essentially just another markup language like HTML. So really, your just dealing with strings. PHP does however have some functions that are useful if your trying to parse these strings for data. You haven't mentioned whether or not your receiving XML that needs to be parsed or creating XML that needs to be sent. Either way, it can be done via either hands on string manipulation or using PHP's built in functionality. Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194060 Share on other sites More sharing options...
doubledee Posted March 30, 2011 Author Share Posted March 30, 2011 XML is essentially just another markup language like HTML. Right, that much I know. I just don't know what "nodes" are or how to create an "XML Tree" or whatever it is called?! So really, your just dealing with strings. PHP does however have some functions that are useful if your trying to parse these strings for data. Okay, so some of the ASP I've been trying to decipher is probably ASP's built in XML functions. You haven't mentioned whether or not your receiving XML that needs to be parsed or creating XML that needs to be sent. Either way, it can be done via either hands on string manipulation or using PHP's built in functionality. Not trying to be secretive - just trying to take this in small steps as to not scare any help off! Well, to answer your question at a higher level... I not really sure how this entire e-commerce thing works?! (God knows they don't have any useful online help or tutorials?! Conceptually, this much I *think* I know about how a Payment Gateway works... (Feel free to jump in and correct me!) 1.) I gather the *right* fields in my "Checkout Form" 2.) I make sure they are in the *right* format 3.) I also obviously need to do data-validation 4.) I bundle up everything and create some long XML string? 5.) I send that XML-string to the Payment Gateway's server 6.) It reads the data and either sends back a "Pass" or "Fail" message and maybe some additional codes (Don't know what format that is in?!) Authorize.net's system looks much easier because it doesn't use XML and it just has a cleaner interface (um, API??) based on the sample code - in PHP - I got from them today. Unfortunately, I'm not sure if I can use Authorize.net with Elavon and my bank or how much trouble that will cause, so I am *trying* to figure out how Internet Secure does things. The tech told me I should be able to figure this out in a few days to a week, but I'm skeptical!!! As always, I am eager to roll up my sleeves and get dirty, but I also clearly need some help. So that is sorta where I am... Debbie Quote Link to comment https://forums.phpfreaks.com/topic/232128-php-and-xml/#findComment-1194064 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.