ChrisNTR

Just another web developer weblog

Recently the Microsoft Permissive License, along with the Microsoft Community License were both submitted to the Open Source Initiative (OSI) to allow them to be fully supported as ‘Open Source’ licenses however these were both turned down for approval, mainly due to the fact that the names of licenses were misleading.

On the 12th October, after renaming the Microsoft Permissive License to Microsoft Public License and the Microsoft Community License to Microsoft Reciprocal License, as well as a few other minor changes, the OSI approved both of the licenses. This means that projects, such as IronRuby and IronPython, are now under these licenses officially open source.

A full round up can be found over on the OSI website.

Chris

Last week sometime the videos of *most* of the sessions at Mix 07 UK went online. Which you can go and view over at the Mix site. Out of the sessions that I missed whilst I was down at the conference, one which has caught my eye was Michael Foord’s session called IronPython et al: Using Dynamic Languages in .Net and Silverlight. It’s great to see Silverlight working really well with other languages and hopefully it’s a sign of more things to come and also maybe what IronRuby might turn out to be like. Another video that I found interesting was the Building of next generation web apps using Windows Live Services. This featured a site called SportsDo which tracked a users run/cycle/walk/swim path using a mobile phone and a GPS tracker. It’ll certainly be interesting - privacy aside - to see what people come up with when GPS is much more ubiquitous along side with the internet.

Also watch out for the BasePlayer.js - Bad NPObject as private data! Javascript bug on the Mix site which is nicely clocking up over 5000 errors on firebug.

Goodnight,

Chris

For the last two or so weeks I have been working on donation section for a client at work. What they needed was a way to take online payments/donations through a Barclaycard merchant account. The MPI ePDQ is a way of seemlessly using the Barclays system without re-directing a user to their site at all. This gives an overall better user experience and can stop users from leaving the page after a successful payment. CPI is the other which is a paypal like integration of a payments system which allows custom colours and a custom image but is generic for all sites. Using MPI, originally, the only way to communicate with this system was to either use C (yup, C, not C++...) or Java. As we both know, C is an old old language and Java has not really taken off as well on the web as other technologies. Although it seems most financial websites seem to use Java Script Pages (jsp), most other small business don't which left them stuck.

Recently Barclaycard have opened up a XML API which really is just a way for a web developer to send a formed XML document over to Barclaycard for them to process on their side. The Barclaycard site does include some documents on what you can put into a XML document but doesn't really say what is required at all.

A way of implementing this within PHP was to use a custom ePDQ class created by Aqua Technologies Limited. What this does is basically take out all the fiddly bits which allows to concentrate on how you want to handle the transaction when it comes back. A few things to look out for if you use this path is that although the ePDQ class is very useful, it was not bug proof and still contained typos on variable names and broken logic checking on some passed in variables such as the post code. As side from this, the ePDQ is a useful class which creates an object with all your customer details and your merchant store details and creates the needed XML for you. So with a 600 line class you can cut down the amount of lines needed to validate and send credit card details off to Barclaycard.

PHP:
  1. //Create new ePDQ object and populate values
  2. $epdq = new EPDQc();
  3. $epdq->setCardNumber($card_number);
  4. $epdq->setEndDate($card_end_month."/".$card_end_year);
  5. $epdq->setCvv2($card_cvv);
  6. $epdq->setTransactionType("Auth");
  7. $epdq->setAmount($total);
  8. $epdq->setOrderId($orderID);
  9. $epdq->setEmailAddress($email);
  10. $epdq->setStreet1($addr_1);
  11. $epdq->setPostalCode($addr_postcode);
  12.  
  13. //If the card is Maestro or Switch then populate these values too.
  14. if ($_REQUEST['card_switch_issue'] != ""
  15. && $card_type == "Maestro/Switch") {
  16. $epdq->setIssueNumber($card_switch_issue);
  17. }
  18. if($_REQUEST['card_start_month'] != ""
  19. && $_REQUEST['card_start_year'] != ""
  20. && $card_type == "Maestro/Switch") {
  21. $epdq->setStartDate($card_start_month. "/" .$card_start_year);
  22. }
  23.  
  24. if($epdq->getErrormessage != '') {
  25. // display your error
  26. } else {
  27. $epdq->ProcessTransaction();
  28.  
  29. unset($SUCCESS);
  30. unset($_REQUEST['SUCCESS']);
  31. $SUCCESS = false;
  32. $error = $epdq->getCcErrorCode();
  33. if ($errorcode != 1) {
  34. echo "ePDQ:ProcessTransaction():Payment Authorisation".
  35. "Failed - Please check you card details.";
  36. // handle failed txn here
  37. } else {
  38. $SUCCESS = true;
  39. }

As simple as that! And of course you can modify the class to you specific needs if you have some extra validation that you need to have or what not. I would be quite interested to see what asp.net has in the way of dealing with ePDQ transactions. I'm sure it would be rather simple to create, especially if you use linq but has it actually been done yet?

I will probably be covering payments using Paypal in the near future which is a different kettle of fish completely.
I hope this helps out someone needing some PHP ePDQ developer help and feel free to contact me for more information,

ChrisNTR

Scott just recently updated his blog to go briefly over a few more details on the MVC framework so it's worth checking out here:

http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx

Chris

During the Alt.Net conference in Austin, TX, Scott Guthrie announced publicly that Microsoft were working on a MVC framework for ASP.NET. A video of this presentation can be found over on Scott Hanselman's blog here but don't be put off by the swaying camera too much, it's definitely worth it. A few things which I find interesting about this implementation of MVC is that it will have the Django way of plugging in different projects that people may have created with the MVC framework such as forums or image galleries. This will allow a more contribution based way of creating web apps using the framework. Another thing that I do like is that you can have full control over how the code source comes out. So unlike the horrible source I've become accustomed to whilst using ASP.NET, the source will come out nice and clean, easier to modify styles with CSS and much nicer for various accessibility reasons.

As much as I do like (love?) the MVC framework without even had a chance to play around with it yet, I have a feeling that it will be used for a lot more simple web applications than for what you would normally use ASP.NET for. For me, as I do both PHP and ASP.NET, I have a choice. A rather simple choice. If I want to make a fully functional, high load web app then I'd use ASP.NET. If I just want to make a simple blog.. I'd probably go with either Rails or PHP. I'm not saying you can't write a high load PHP site just initial set up and scalability will be a little trickier. But with the new framework I might decide to do those types of apps using MVC.

Whilst the MVC framework probably won't change much in the ASP.NET developer view point, I'm hoping that it might make more of an impression with the hobbyist web developers currently using PHP to make the jump over to the darkside and give ASP.NET a try.

A few weeks I attended Mix O7 - the UK version of the Las Vegas event back in April. The first evening I was there, the day before the event, I met a few new people with Phil and headed to a Thai restaurant which I cannot remember the name of. It was very well set out and had incense burning throughout the meal. Here's a picture of the meal I had along with sticky rice:

Thai Dinner

Early the next morning was the start of Mix. Although some of the material was borrowed from the Las Vegas Mix, some of the sessions such as "A nice cup of tea and a sit down" provided some good insights on the current situation of the internet and where it may be leading.

That evening a group of 40 odd delegates headed to Tas, a turkish restaurant right by the conference centre. Despite hearing that some people *cough* didn't get a main meal at all, even though they had been there for 3 hours, my meal was rather tasty and here's the obligatory picture:

Tas Dinner

The next day at Mix provided a closer look at VS 2008 and .Net 3.5. I've only been coding with ASP.NET for about 3 months now so most of the things are new to me anyway but it seems that LINQ and ListView (amongst others) are really making life a lot easier than with previous versions.

After a tasty Indian meal for my final night - sadly no pictures of this, I didn't want to seem to weird taking photos of my meal every night... - I was soon on the train back to Manchester with a warm feeling in myself thinking that Microsoft are really doing something right with the whole asp.net/silverlight aspect of things. Innovating and really doing things for the ease of developers so more creative and unique web apps can be created.

I will be touching more on IronRuby soon, so something to look out for. :o)

ChrisNTR

I've just moved onto a "new" server and got wordpress installed... More to come later.