Finally made it! This is the 5th and final sprint for Lamba Labs. When we started our project, it seemed like so much had to be done and that 5 weeks would not be enough. However, as each developer on the team got down to work, we broke the project down from a huge boulder into smaller rocks and divided responsibilities. My responsibilities included setting up the basic Node.js/Express server, helping plan the database structure, developing Firebase Authentication for the backend, and finally, in this last sprint, I incorporated Stripe.js to allow our app to accept credit card payments.
To incorporate Stripe.js I actually Googled to learn how and came across a wonderful tutorial written on HackerNoon.com by a former Lambda student, Jameson Brown. It was an excellent tutorial and I almost got it working. However, I could not seem to get it to work so I contacted Jameson on Slack and he was so wonderful in Zooming with me and peer programming with me to get my code to work. Even though I was working on the backend part of Stripe, I needed to create a small simple React client in order to test it. Here is the code for that (note: I replaced the publishable key with meaningless data — keys should be kept as secret as possible):
After I created this client component, then I could test the backend Stripe code. Here is the heart of the backend Stripe code:
In line 3 I pass in the secret key to stripe. Then a get is called against the Stripe checkout server which returns to us a message and a timestamp. This is a response to the client that Stripe is ready to receive a request. Finally, the post is called passing in the data inside the body object where we pass into the Stripe API the charges and a create method passing in the body and the stripeChargeCallback. If an error occurs, an error message is passed back, if all checks out, a status 200 and a message is passed.
After this we entered a feature-freeze stage — no new features. It is time now to prettify and make solid our app. Working on a team is both challenging as well as immensely rewarding. There were personal issues that took members out of commission for awhile. But every time that happened a fellow teammate stepped up! Also, as we entered the final sprint, we began communicating a lot more often. This is the key. A team is only as good as its ability to communicate. We also learned a lot about how each other works. Some like to work late late at night (guilty !). While others kept to a strict schedule. There were also times where our Team Leader, Josue Peralta, really helped us to debug some pretty sneaky problems. This Lambda Labs project was really valuable to me in that the next project I am on I will know much more what to expect.