Setting up a PayPal Sandbox Account

March 29, 2011

I’m trying to get my webapp set up to accept payments via PayPal. Trying to get it set up was a bit overwhelming, just because of all the PayPal options out there. So here’s a quick walkthrough on how to set up a sandbox account for Website Payments Standard, the simplest way to just add a single Buy Now button to your web site.

Note: you do not need to have a real PayPal Business account set up in order to set up a sandbox account. They’re totally separate.

  1. Go to developer.paypal.com.
  2. Click “Sign Up Now”, and fill in your information to register. This creates a developer account. You can use this to create multiple test accounts. For example, if you wanted to test a setup where you’re paid via bank account, and another setup where you’re paid via credit card, you could set up one test account for each. You sign into developer.paypal.com with your developer account, and you will sign into http://www.sandbox.paypal.com with your test accounts.
  3. Once you’re logged in to developer.paypal.com under your new developer account, click “Create a preconfigured account”.
  4. Choose the “Seller” account type, then enter any other information you’d like.
  5. Once that account is created, go to the Test Accounts tab. This will list your sandbox accounts, showing the e-mail address login for each.
  6. Click “Enter Sandbox Test Site” to be sent to www.sandbox.paypal.com (or you could just go there manually).
  7. Sign in using your test account.
  8. When you’re logged in here, a warning: make sure the address of the site always says http://www.sandbox.paypal.com. I clicked a certain link and was incorrectly sent to the production PayPal site, so that could have been unfortunate.
  9. On the top tab bar, click “Products & Services.”
  10. Then click “Get Paid” on the bar below that.
  11. Scroll down to find the “Add Payment Buttons” link and click it.
  12. Click the “Setting Up” tab in the middle of the page.
  13. Choose the style of button you want, and click it.
  14. Make sure you’re still on http://www.sandbox.paypal.com–if not, go there and start over.
  15. Follow the instructions on the screen to customize your button. In particular, under Step 3 you may want to enter a success and cancel URL to send users to, so they can get back to your app and so your app gets information about the purchase.
  16. Click “Create Button” and you’ll be given the code for your button. That’s it!

When you’re ready to create your real business account, it’s easy: just go to paypal.com, click Sign Up, choose Business account, create it, then start at step 9 above and go through the same steps to create the production version of your button.

Advertisements

Monospace Fonts on iOS

December 20, 2010

Today I just had what might be my biggest disappointment of the year: monospace fonts are not monospaced on iOS. Specifically, the hyphen and question mark are wider than other characters in Courier New on iOS. Of course, this completely messes up any kind of monospace-based layout you might want to do.

Here are the alternatives I’ve investigated that didn’t work:

  1. Leaving the programming industry. Unfortunately, I’m not smart enough to do anything else. On to more reasonable alternatives.
  2. Tried other installed fonts. Courier is supported, but has the same problem. Monaco isn’t supported. And that’s all the built-in font options.
  3. Web fonts. I searched through the Google Font Directory and found “Droid Sans Mono.” If that had worked, man, what a slap in the face, huh? Unfortunately, it exhibited the same problem.

Here are options that could or did work:

  1. In app store apps, custom views to lay out text. If you draw one character at a time, you can make sure they’re placed properly. Unfortunately, if you need to use this for an editor (as I do), that would mean re-implementing a ton of functionality.
  2. On the web, replace dashes with HTML entities. This works for webapps and UIWebViews. If you replace all dashes/hyphens with –, you will see an identical (in Courier New) looking dash, that is spaced properly. This works for displaying text, but wouldn’t work for editors, which are just displaying bare characters and not interpreting HTML entities. Also, this doesn’t solve the question mark problem.

Does anyone else have any suggestions?


iPhone Development Options

March 9, 2010

Either I’m behind the times, or Apple isn’t great about communicating all the options out there for iPhone development. I just found out about Dashcode, an iPhone SDK for creating web apps with all the standard awesome iPhone widgets. It even lets your web app run offline! This being the case, I thought I’d put together a summary of the options you have for creating iPhone web sites/apps. Please comment if I’ve gotten anything incorrect, and help me out by providing better links =]

Web Site iPhone Site Offline Site App Store
Accessible y y y y
Other Mobile y y ? n
Offline n n y y
Zooming y n n n
App Store Approval n n n y
App Store Sales n n n y
iPhone Data n n n y
Push n n n y
  • Web Site – This refers to a regular web site, without any adjustments for the iPhone.
  • iPhone Site – This refers to a web site with some changes for the iPhone. It might be as simple as a few meta tags and CSS styles, or you might have to rewrite your views to be iPhone targeted. Either way, though, it’s not much effort. More Info
  • Offline Site – This refers to a webapp that’s set up to be able to run offline. If your users save your app to the home screen, everything on that page is saved as well, including JavaScript. If the app is set up to use a JavaScript-accessible local storage library, that data will be accessible as well. Apple has created an SDK called Dashcode that offers not only offline storage, but also easy drag-and-drop usage of regular iPhone UI widgets as well. More Info
  • App Store – This is what most people think of when they think of iPhone apps. These are written in Objective C using the iPhone SDK. They require App Store approval to be sold. More Info

IE Performance Issues Adding Dom Nodes

October 12, 2009

My app has a search screen that fetches the results via Ajax and displays them in a table. Worked fine in Firefox, but in IE there’s a slight processor jump for a second or so. Strange, but not a problem. The users of this app, however, use a remote desktop app to run IE to access it. And when they did the search, their CPU would hit 100% for 1-5 minutes, making the entire terminal completely unusable.

I agonized over different JavaScript fixes: removed a table JS widget, switched off of tables altogether, switched to innerHTML, used DocumentFragments. Nothing worked.

Then, on a whim, I disabled all the CSS files on the app, and it worked like a charm. As I narrowed it down, I discovered that some CSS I was using to emulate frames (non-scrolling header, footer, and sidebar) was the offending code.

Let’s step back and think about that one again. What caused the processor to hit 100% for 5 minutes was not JavaScript, but CSS.

Sigh. So, if you have an issue with IE hitting 100% processor load for any reason, don’t assume that JS is necessarily the problem. Try disabling your CSS and see if that fixes it.