Success with Stripe

In a previous post, I remarked on my difficulty with getting Stripe running.  I see it’s been almost 2 months since I posted that. Boy, I take a while sometimes, but I get stuff done. I finally found success with the help of an excellent tutorial by the handsome and intelligent Mark Hagan.

It turned out that it actually was easy, once I saw how it was done. But like changing a tire or getting a date with an attractive stranger, lots of “easy” things aren’t, until you actually do them.

I had no idea how to use an API from an external website. Some of the pieces I was missing:

  • That you need to include reference to an external library, and how to do so
  • Realizing that the term “library” refers to the C# git repository that was linked to on the Stripe APIs page, which I downloaded, but had no idea what to do with.
  • Adding an API key to an XML file – XML is another one of those things that’s very easy, provided you know how.

Well, I learned.

For a little extra drama, I should let you know how close this project came to helping me fail a course this semester. I decided to use Stripe in a project that required the use of a REST API in a .NET application.

I was motivated to master Stripe. But I couldn’t figure it out. I looked for “Stripe tutorial” on youtube, and got videos about nail polish. I googled everything I could think of, but even when something looked helpful, my rising panic made it difficult to comprehend. The assignment was 30% of the course mark. I did badly on the midterm and had low hopes for the final. On the due date, I had nothing to show for 2 weeks of work, had given up panicking, and almost given up altogether.

But the teacher decided not to show up that day, and we were given another week. That night, Mark uploaded the tutorial I linked to. It looks like it was sitting on his hard drive for a year before he got around to posting it, just in time to save me. I didn’t even look for it, youtube suggested it. From there, Stripe, ASP.NET, my Windows 7 installation,  and the rest of my life fell neatly into place, and the assignment is waiting for it’s A.

Thanks Mark. PS, I tried to buy you a beer, but I got an error, LOL! Message me if you fix it and see this.

 

For non-experts:

REST stands for Representational State Transfer, and is a standard method for taking information from another website, and using it on your own website.

API means Application Programming Interface. An API is a library of computer code that can be used to implement REST.

.NET is a big library of code provided by Microsoft to make it easier to write Microsoft-style software.

Visual Studio is a program that helps programmers tie all of the above methods together into an application or website.

Would you like to receive updates by email?

Getting a little further with Stripe

Edit: I had some success getting it running with C#, read it about it here.

 

Ok, so now I’ve got the code for the payment form and the action for it on my server and running, and I can at least tell whether stuff is working or not (it’s not). Check it out at rocketships.ca/stripe/payment.php if you want.

A typical use case:

For this to happen I need:

A product page that contains:

  1. An item
  2. An “add to cart” button
  3. A “checkout” button

A checkout page that contains:

  1. A list of the customer’s items
  2. A “pay now” button

For these pages to work I need

  1. A database of items
  2. A method to get an item from the database
  3. A method to handle the “add to cart” button
  4. A way to list the customers items on the checkout page

And the last ingredient, of course, is someone who knows way more than I do, cause I feel super lost, and pretty sure that most people reading this from HackerNews or Proggit are just gonna laugh at me. Oh well, soldier on. You only learn the hard way.

 

Would you like to receive updates by email?