1 / 11

Two Wheel Philanthropy And Beyond

Two Wheel Philanthropy And Beyond. Practical uses for PHP. Two Wheel Philanthropy. The Hard Lessons Action-equals-whaa? How does this server thingy work? Solutions Do this and print that! Host base this! Money Issues What do I need? (Linkpoint, merchant accounts, security certificates)

Download Presentation

Two Wheel Philanthropy And Beyond

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Two Wheel Philanthropy And Beyond Practical uses for PHP

  2. Two Wheel Philanthropy • The Hard Lessons • Action-equals-whaa? • How does this server thingy work? • Solutions • Do this and print that! • Host base this! • Money Issues • What do I need? (Linkpoint, merchant accounts, security certificates) • How do I do that stuff? (Linkpoint XML sending and responding) • The Big Shabanga-Bang • How it works (our end). • How it works (their end). • Now, Sherman, what did we learn? • More about encapsulation (encapsul-wha-tion?) • Globals and security.

  3. The hard lessons – Action-equals-whaa? • Our menu was controlled by a form, and we planned on separating the files by the different screens. • Issue: only one action can be given to a form, but until we enter information into the menu, we don’t know which file to go to.

  4. The Hard Lessons – How Does This Server Thingy Work? • Assumption 1: We can use globals, right? (By the way, what’s a global?) • Assumption 2: Isn’t PHP just a big program attached to Apache? • Assumption 3: Can’t we just session_start and go?

  5. Do this and print that! • “Print” functions display a page requiring information with a tag of where they are coming from. • “Do” functions process the information and move on to the next print function. • Other functions are for use within these. • We have one BIG file to work with.

  6. Host Base This ! • We’ll store a variable containing our host base URL and add the server variable from there. • We’ll explicitly state where we want our sessions stored. • We’ll deal with globals by declaring everything as global (not the best option).

  7. What do I need? Merchant Account (a place to put your money, not a matress) Security certificate (a reason for people to trust you to take their money) A service provider (to transfer money from their hands to yours) How do I get that? Merchant Accounts: Apply for them through banks and such. Security Certificates: Provide proof of business to a security company (Thawte). Program using an API of a company which has access to bank networks (Linkpoint, in our case). Money Issues

  8. The Big Shabanga-Bang – How it works on our end. • All users are stored in an SQL table (their passwords have been encrypted to protect the innocent). • All transactions are stored in an SQL table (and are tagged with a random ID so PHP can tell the difference between them). • All events are stored in an SQL table (with any notes, the time, date, and location, and price attached).

  9. The Big Shabanga-Bang – How it works on their (Linkpoint’s) end. • We collect the credit card and cost data. • We produce an XML string according to Linkpoint’s specifications. • [Show the code] • We receive a response in XML indicating the success or failure of the transaction, and order number, and a message. • [Show the documentation] • We store this data in a table, noting the server’s response and only the last 4 digit of the credit card number.

  10. Now, Sherman, what did we learn? – More about encapsulation (encapsul-wha-tion?) • Encapsulation- keeping tasks apart from each other so that we can change algorithms without changing the larger program. • Using PHP include files helps solve for this problem. • [Show the code (duh)…] • Not using forms as flow control allows us to split the tasks into different files. • [Yep, show the code again.]

  11. Now, Sherman, what did we learn? – Globals and Security • Globalizing variables means they came from anywhere. • The reason we had to declare each variable global was because PHP was running with a safety protocol. • [Show the dang code] • This opens up doors for people to “trick” the server. We can solve that by explicitly stating where the globals are supposed to come from. • [Okay, last time, show the code.]

More Related