Wednesday, March 17, 2010

PayPal Competition No Good

So I slaved away and rushed and put together my application for the competition. It turned out very well and I got it approved. It is live if you want to use it, which of course you do. http://textbooks.donomall.com/exchange gets you there.

Anyway we developers had to turn in a video of somebody using our application. I just did one with a screen capture video and me trying to narrate. My computer kept locking up and crashing. grrrrr. But I got one to them.

Next step was for the "community" to vote on which application we thought was the best. The top 10 move to the final round of judging. Well, this was their big mistake. ANYBODY could sign up as a developer and vote. So of course I found a number of places where people were PAYING for votes. One guy was up to $1/vote. WOW!

Obviously I did not get in the top 10. I think I ended up with 5 votes. I filed a complaint with the people running the contest saying that there was massive fraud going on. They don't care.

How should they fix it? Say that ONLY the people who submitted an application can vote and then we can only vote for somebody else's application. Maybe 3 votes so we can pick our top 3 or even 10. Let each of us pick our own top 10. Basically saying "what are the top 10 applications AFTER yours of course". This would have been a much better way of doing it.

But what can you do? Nothing.

Anyway, I'm working on my next major project which will be using the parallel payments. I want a shopping cart where a buyer can pick items from a store where there are different vendors and make just 1 payment. What use is this? Just wait and see!

Labels: , , ,

Friday, January 29, 2010

Sending Encrypted Data via URL?

Another lesson learned.

I am working on my PayPal Adaptive Payments application and I want buyers to be able to report when books are received or not received. Being the clever type of guy I am, I decided I should encrypt the data being sent in the email like the pay key that PayPal sends when first creating a sale through the AP. It is only good for a few hours after it is created for finishing the transaction but it is a great number for tracking payments. But I don't want it getting out to just anybody.

I tried doing a straight encryption but that ends up with all sorts of garbage that is not URL compatible. Being the genius guru I am, I figured I would just urlencode it to fix that problem.

Didn't work.

Turns out that it is pretty much impossible to reverse this process. Ends up with some garbage coming out. Oh well.

Just for everyones' enjoyment, the site I'm working on is at http://www.donomall.com. You can get to the book section from there. Anybody wanting to comment on the sites can do so. I have thick skin. Usually. I am NOT a designer. Keep that in mind. :)

Labels: , , ,

Tuesday, January 26, 2010

Unexpected Action from ColdFusion Tag

Don't you hate it when things don't work the way you think they should? Especially when you check and recheck trying to find a problem only to find out that something is not doing what you think it should be doing.

I just had this experience. I was working hard on a website but part of the layout was turning out totally weird. Somehow a table was ending up enveloping more than it should. This came about because a ColdFusion tag was not doing what I thought it should be doing. Even re-reading the documentation it seems that it should be working like I thought it should.

Okay, the tag? CFTRY. Now maybe this is something that is already documented but I've never seen anything about the problem I ran into. Matter-of-fact the documentation says it should be working exactly as I think it should. But it doesn't.

The documentation says that you put code that may cause an error inside cftry tags then use cfcatch to deal with errors. So what does this tell us? That IF there is ANY error inside the cftry area then it will go to the cfcatch without processing anything. Not so.

Here is what I had
< cftry >
< table >
[call API ] [ parse results ] [ display results ]
< /table >
< cfcatch >
No Results
< /cfcatch >
< /cftry>

Now I look at that if the API call or the parsing results in an error this will fail into the cfcatch and show "No Results". Not so. After much messing with the borders etc to see what exactly was being displayed, I found that the table tag was actually being processed. So inside a cftry tag everything will be processed UNTIL it hits an error. This is NOT what the documentation leads you to believe. So of course I just had to move the table tag after the parsing function and it worked as I wanted it to. But I burned a WHOLE lot of time figuring that one out.

Labels: , , ,

Wednesday, January 20, 2010

Bring in the APIs!

I am finally opening up my big project. Not pretty yet but it is functional so far. It has passed through months of testing and sobbing and pounding of head on monitor. But here it is. I'd love to see if you can break it.

What does it do? It combines shopping APIs from all over the place. eBay, Amazon, LinkShare, Commission Junction, Valore and many others to give the biggest internet comparison shopping site around. Is it slow? Not really. That took the most work but I did it with ColdFusion 8 and cfthread.

First thing I did was to build the API search functions into a CFC. Make the cfc an application object since it is used by everybody all the time. 1 function for each API. When run in sequence it was taking up to 1 minute to get any results. What was I to do?

Okay, I did threads. Each api call is a thread. This also helped if there was an error along the way in any of them it wouldn't jam up the whole thing. So this got results in around 15 seconds. What I did to take up the time was put an intermediate page in. You enter your search and you go to this "doing search" page where you see advertisements for other products. The searches themselves are actually happening in an iFrame that is 1px by 1px. When it is done loading it redirects the parent page to the results page.

BUT where are the results? To keep from jamming up my server memory I decided to jam up my database instead. Everybody who comes on the site gets their own temp table that holds the results of their searches. This way subsequent searches to narrow down the results are faster and easier. Of course this leaves the problem much like abandoned shopping carts. No biggy tho. Same solution. On session end the table is dropped. If that doesn't get it I have a scheduled task that runs every hour that clears out any tables that are over 2 hours old, which just happens to be the same as the session time out.  I seriously doubt anybody is going to be searching on my site for over 2 hours. But if they are they will get a new table because that is the first check I do in the onRequest function.

Anyway, it is still a work in progress but it is doing great so far. It is also the foundation for my entry into the PayPal new Advanced Payment API contest. Wish me luck on that. I have my application submitted for approval.

The site of my most awesome project? http://www.donomall.com/

Labels: , , , ,